From de9c327544b08588e71d4f67576ccfee6b6dad16 Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:09:53 +0800 Subject: [PATCH 1/8] Generated from specification/web/resource-manager/readme.md tag package-2021-03 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- profiles/latest/web/mgmt/web/models.go | 154 +- profiles/latest/web/mgmt/web/webapi/models.go | 4 +- profiles/preview/web/mgmt/web/models.go | 154 +- .../preview/web/mgmt/web/webapi/models.go | 4 +- services/web/mgmt/2021-03-01/web/CHANGELOG.md | 2 + services/web/mgmt/2021-03-01/web/_meta.json | 11 + services/web/mgmt/2021-03-01/web/apps.go | 37361 ++++++++++++++++ .../web/appservicecertificateorders.go | 1851 + .../2021-03-01/web/appserviceenvironments.go | 4656 ++ .../mgmt/2021-03-01/web/appserviceplans.go | 2632 ++ .../web/certificateordersdiagnostics.go | 263 + .../web/certificateregistrationprovider.go | 142 + .../web/mgmt/2021-03-01/web/certificates.go | 616 + services/web/mgmt/2021-03-01/web/client.go | 1622 + .../web/mgmt/2021-03-01/web/containerapps.go | 602 + .../2021-03-01/web/containerappsrevisions.go | 500 + .../web/mgmt/2021-03-01/web/deletedwebapps.go | 333 + .../web/mgmt/2021-03-01/web/diagnostics.go | 2434 + .../web/domainregistrationprovider.go | 142 + services/web/mgmt/2021-03-01/web/domains.go | 1585 + services/web/mgmt/2021-03-01/web/enums.go | 1794 + services/web/mgmt/2021-03-01/web/global.go | 254 + .../mgmt/2021-03-01/web/kubeenvironments.go | 617 + services/web/mgmt/2021-03-01/web/models.go | 32941 ++++++++++++++ services/web/mgmt/2021-03-01/web/provider.go | 836 + .../mgmt/2021-03-01/web/recommendations.go | 1543 + .../2021-03-01/web/resourcehealthmetadata.go | 695 + .../web/mgmt/2021-03-01/web/staticsites.go | 4631 ++ .../mgmt/2021-03-01/web/topleveldomains.go | 337 + services/web/mgmt/2021-03-01/web/version.go | 19 + .../mgmt/2021-03-01/web/webapi/interfaces.go | 942 + 31 files changed, 99647 insertions(+), 30 deletions(-) create mode 100644 services/web/mgmt/2021-03-01/web/CHANGELOG.md create mode 100644 services/web/mgmt/2021-03-01/web/_meta.json create mode 100644 services/web/mgmt/2021-03-01/web/apps.go create mode 100644 services/web/mgmt/2021-03-01/web/appservicecertificateorders.go create mode 100644 services/web/mgmt/2021-03-01/web/appserviceenvironments.go create mode 100644 services/web/mgmt/2021-03-01/web/appserviceplans.go create mode 100644 services/web/mgmt/2021-03-01/web/certificateordersdiagnostics.go create mode 100644 services/web/mgmt/2021-03-01/web/certificateregistrationprovider.go create mode 100644 services/web/mgmt/2021-03-01/web/certificates.go create mode 100644 services/web/mgmt/2021-03-01/web/client.go create mode 100644 services/web/mgmt/2021-03-01/web/containerapps.go create mode 100644 services/web/mgmt/2021-03-01/web/containerappsrevisions.go create mode 100644 services/web/mgmt/2021-03-01/web/deletedwebapps.go create mode 100644 services/web/mgmt/2021-03-01/web/diagnostics.go create mode 100644 services/web/mgmt/2021-03-01/web/domainregistrationprovider.go create mode 100644 services/web/mgmt/2021-03-01/web/domains.go create mode 100644 services/web/mgmt/2021-03-01/web/enums.go create mode 100644 services/web/mgmt/2021-03-01/web/global.go create mode 100644 services/web/mgmt/2021-03-01/web/kubeenvironments.go create mode 100644 services/web/mgmt/2021-03-01/web/models.go create mode 100644 services/web/mgmt/2021-03-01/web/provider.go create mode 100644 services/web/mgmt/2021-03-01/web/recommendations.go create mode 100644 services/web/mgmt/2021-03-01/web/resourcehealthmetadata.go create mode 100644 services/web/mgmt/2021-03-01/web/staticsites.go create mode 100644 services/web/mgmt/2021-03-01/web/topleveldomains.go create mode 100644 services/web/mgmt/2021-03-01/web/version.go create mode 100644 services/web/mgmt/2021-03-01/web/webapi/interfaces.go diff --git a/profiles/latest/web/mgmt/web/models.go b/profiles/latest/web/mgmt/web/models.go index 0650cc768672..f85499e58c66 100644 --- a/profiles/latest/web/mgmt/web/models.go +++ b/profiles/latest/web/mgmt/web/models.go @@ -12,13 +12,20 @@ package web import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type ActiveRevisionsMode = original.ActiveRevisionsMode + +const ( + ActiveRevisionsModeMultiple ActiveRevisionsMode = original.ActiveRevisionsModeMultiple + ActiveRevisionsModeSingle ActiveRevisionsMode = original.ActiveRevisionsModeSingle +) + type AppServicePlanRestrictions = original.AppServicePlanRestrictions const ( @@ -225,6 +232,15 @@ const ( ConnectionStringTypeSQLServer ConnectionStringType = original.ConnectionStringTypeSQLServer ) +type ContainerAppProvisioningState = original.ContainerAppProvisioningState + +const ( + ContainerAppProvisioningStateCanceled ContainerAppProvisioningState = original.ContainerAppProvisioningStateCanceled + ContainerAppProvisioningStateFailed ContainerAppProvisioningState = original.ContainerAppProvisioningStateFailed + ContainerAppProvisioningStateInProgress ContainerAppProvisioningState = original.ContainerAppProvisioningStateInProgress + ContainerAppProvisioningStateSucceeded ContainerAppProvisioningState = original.ContainerAppProvisioningStateSucceeded +) + type ContinuousWebJobStatus = original.ContinuousWebJobStatus const ( @@ -325,6 +341,15 @@ const ( DomainTypeSoftDeleted DomainType = original.DomainTypeSoftDeleted ) +type EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatus + +const ( + EnterpriseGradeCdnStatusDisabled EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusDisabled + EnterpriseGradeCdnStatusDisabling EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusDisabling + EnterpriseGradeCdnStatusEnabled EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusEnabled + EnterpriseGradeCdnStatusEnabling EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusEnabling +) + type ForwardProxyConvention = original.ForwardProxyConvention const ( @@ -393,6 +418,14 @@ const ( InAvailabilityReasonTypeInvalid InAvailabilityReasonType = original.InAvailabilityReasonTypeInvalid ) +type IngressTransportMethod = original.IngressTransportMethod + +const ( + IngressTransportMethodAuto IngressTransportMethod = original.IngressTransportMethodAuto + IngressTransportMethodHTTP IngressTransportMethod = original.IngressTransportMethodHTTP + IngressTransportMethodHTTP2 IngressTransportMethod = original.IngressTransportMethodHTTP2 +) + type InsightStatus = original.InsightStatus const ( @@ -623,6 +656,24 @@ const ( ResourceScopeTypeWebSite ResourceScopeType = original.ResourceScopeTypeWebSite ) +type RevisionHealthState = original.RevisionHealthState + +const ( + RevisionHealthStateHealthy RevisionHealthState = original.RevisionHealthStateHealthy + RevisionHealthStateNone RevisionHealthState = original.RevisionHealthStateNone + RevisionHealthStateUnhealthy RevisionHealthState = original.RevisionHealthStateUnhealthy +) + +type RevisionProvisioningState = original.RevisionProvisioningState + +const ( + RevisionProvisioningStateDeprovisioned RevisionProvisioningState = original.RevisionProvisioningStateDeprovisioned + RevisionProvisioningStateDeprovisioning RevisionProvisioningState = original.RevisionProvisioningStateDeprovisioning + RevisionProvisioningStateFailed RevisionProvisioningState = original.RevisionProvisioningStateFailed + RevisionProvisioningStateProvisioned RevisionProvisioningState = original.RevisionProvisioningStateProvisioned + RevisionProvisioningStateProvisioning RevisionProvisioningState = original.RevisionProvisioningStateProvisioning +) + type RouteType = original.RouteType const ( @@ -831,7 +882,6 @@ type AddressResponse = original.AddressResponse type AddressResponseProperties = original.AddressResponseProperties type AllowedAudiencesValidation = original.AllowedAudiencesValidation type AllowedPrincipals = original.AllowedPrincipals -type AllowedPrincipalsProperties = original.AllowedPrincipalsProperties type AnalysisData = original.AnalysisData type AnalysisDefinition = original.AnalysisDefinition type AnalysisDefinitionProperties = original.AnalysisDefinitionProperties @@ -846,7 +896,6 @@ type AppLogsConfiguration = original.AppLogsConfiguration type AppMajorVersion = original.AppMajorVersion type AppMinorVersion = original.AppMinorVersion type AppRegistration = original.AppRegistration -type AppRegistrationProperties = original.AppRegistrationProperties type AppRuntimeSettings = original.AppRuntimeSettings type AppRuntimes = original.AppRuntimes type AppServiceCertificate = original.AppServiceCertificate @@ -899,7 +948,6 @@ type AppStackCollectionIterator = original.AppStackCollectionIterator type AppStackCollectionPage = original.AppStackCollectionPage type AppStackProperties = original.AppStackProperties type Apple = original.Apple -type AppleProperties = original.AppleProperties type AppleRegistration = original.AppleRegistration type ApplicationLogsConfig = original.ApplicationLogsConfig type ApplicationStack = original.ApplicationStack @@ -956,15 +1004,11 @@ type AutoHealRules = original.AutoHealRules type AutoHealTriggers = original.AutoHealTriggers type AzureActiveDirectory = original.AzureActiveDirectory type AzureActiveDirectoryLogin = original.AzureActiveDirectoryLogin -type AzureActiveDirectoryLoginProperties = original.AzureActiveDirectoryLoginProperties type AzureActiveDirectoryRegistration = original.AzureActiveDirectoryRegistration -type AzureActiveDirectoryRegistrationProperties = original.AzureActiveDirectoryRegistrationProperties type AzureActiveDirectoryValidation = original.AzureActiveDirectoryValidation -type AzureActiveDirectoryValidationProperties = original.AzureActiveDirectoryValidationProperties type AzureBlobStorageApplicationLogsConfig = original.AzureBlobStorageApplicationLogsConfig type AzureBlobStorageHTTPLogsConfig = original.AzureBlobStorageHTTPLogsConfig type AzureStaticWebApps = original.AzureStaticWebApps -type AzureStaticWebAppsProperties = original.AzureStaticWebAppsProperties type AzureStaticWebAppsRegistration = original.AzureStaticWebAppsRegistration type AzureStorageInfoValue = original.AzureStorageInfoValue type AzureStoragePropertyDictionaryResource = original.AzureStoragePropertyDictionaryResource @@ -984,7 +1028,6 @@ type BillingMeterCollectionIterator = original.BillingMeterCollectionIterator type BillingMeterCollectionPage = original.BillingMeterCollectionPage type BillingMeterProperties = original.BillingMeterProperties type BlobStorageTokenStore = original.BlobStorageTokenStore -type BlobStorageTokenStoreProperties = original.BlobStorageTokenStoreProperties type Capability = original.Capability type Certificate = original.Certificate type CertificateCollection = original.CertificateCollection @@ -1004,15 +1047,29 @@ type CertificateRegistrationProviderClient = original.CertificateRegistrationPro type CertificatesClient = original.CertificatesClient type ClientRegistration = original.ClientRegistration type CloningInfo = original.CloningInfo +type Configuration = original.Configuration type ConnStringInfo = original.ConnStringInfo type ConnStringValueTypePair = original.ConnStringValueTypePair type ConnectionStringDictionary = original.ConnectionStringDictionary type Contact = original.Contact +type Container = original.Container +type ContainerApp = original.ContainerApp +type ContainerAppCollection = original.ContainerAppCollection +type ContainerAppCollectionIterator = original.ContainerAppCollectionIterator +type ContainerAppCollectionPage = original.ContainerAppCollectionPage +type ContainerAppProperties = original.ContainerAppProperties +type ContainerAppSecret = original.ContainerAppSecret +type ContainerAppsClient = original.ContainerAppsClient +type ContainerAppsConfiguration = original.ContainerAppsConfiguration +type ContainerAppsCreateOrUpdateFuture = original.ContainerAppsCreateOrUpdateFuture +type ContainerAppsDeleteFuture = original.ContainerAppsDeleteFuture +type ContainerAppsRevisionsClient = original.ContainerAppsRevisionsClient type ContainerCPUStatistics = original.ContainerCPUStatistics type ContainerCPUUsage = original.ContainerCPUUsage type ContainerInfo = original.ContainerInfo type ContainerMemoryStatistics = original.ContainerMemoryStatistics type ContainerNetworkInterfaceStatistics = original.ContainerNetworkInterfaceStatistics +type ContainerResources = original.ContainerResources type ContainerThrottlingData = original.ContainerThrottlingData type ContinuousWebJob = original.ContinuousWebJob type ContinuousWebJobCollection = original.ContinuousWebJobCollection @@ -1038,8 +1095,16 @@ type CsmUsageQuotaCollectionIterator = original.CsmUsageQuotaCollectionIterator type CsmUsageQuotaCollectionPage = original.CsmUsageQuotaCollectionPage type CustomHostnameAnalysisResult = original.CustomHostnameAnalysisResult type CustomHostnameAnalysisResultProperties = original.CustomHostnameAnalysisResultProperties +type CustomHostnameSites = original.CustomHostnameSites +type CustomHostnameSitesCollection = original.CustomHostnameSitesCollection +type CustomHostnameSitesCollectionIterator = original.CustomHostnameSitesCollectionIterator +type CustomHostnameSitesCollectionPage = original.CustomHostnameSitesCollectionPage +type CustomHostnameSitesProperties = original.CustomHostnameSitesProperties type CustomOpenIDConnectProvider = original.CustomOpenIDConnectProvider -type CustomOpenIDConnectProviderProperties = original.CustomOpenIDConnectProviderProperties +type CustomScaleRule = original.CustomScaleRule +type Dapr = original.Dapr +type DaprComponent = original.DaprComponent +type DaprMetadata = original.DaprMetadata type DataProviderMetadata = original.DataProviderMetadata type DataSource = original.DataSource type DataTableResponseColumn = original.DataTableResponseColumn @@ -1114,6 +1179,7 @@ type DomainsCreateOrUpdateFuture = original.DomainsCreateOrUpdateFuture type EnabledConfig = original.EnabledConfig type EndpointDependency = original.EndpointDependency type EndpointDetail = original.EndpointDetail +type EnvironmentVar = original.EnvironmentVar type ErrorEntity = original.ErrorEntity type Experiments = original.Experiments type ExtendedLocation = original.ExtendedLocation @@ -1148,13 +1214,12 @@ type GitHubActionCodeConfiguration = original.GitHubActionCodeConfiguration type GitHubActionConfiguration = original.GitHubActionConfiguration type GitHubActionContainerConfiguration = original.GitHubActionContainerConfiguration type GitHubActionWebAppStackSettings = original.GitHubActionWebAppStackSettings -type GitHubProperties = original.GitHubProperties type GlobalClient = original.GlobalClient type GlobalCsmSkuDescription = original.GlobalCsmSkuDescription type GlobalValidation = original.GlobalValidation type Google = original.Google -type GoogleProperties = original.GoogleProperties type HTTPLogsConfig = original.HTTPLogsConfig +type HTTPScaleRule = original.HTTPScaleRule type HTTPSettings = original.HTTPSettings type HTTPSettingsRoutes = original.HTTPSettingsRoutes type HandlerMapping = original.HandlerMapping @@ -1189,6 +1254,7 @@ type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint type InboundEnvironmentEndpointCollection = original.InboundEnvironmentEndpointCollection type InboundEnvironmentEndpointCollectionIterator = original.InboundEnvironmentEndpointCollectionIterator type InboundEnvironmentEndpointCollectionPage = original.InboundEnvironmentEndpointCollectionPage +type Ingress = original.Ingress type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -1209,7 +1275,6 @@ type KubeEnvironmentsClient = original.KubeEnvironmentsClient type KubeEnvironmentsCreateOrUpdateFuture = original.KubeEnvironmentsCreateOrUpdateFuture type KubeEnvironmentsDeleteFuture = original.KubeEnvironmentsDeleteFuture type LegacyMicrosoftAccount = original.LegacyMicrosoftAccount -type LegacyMicrosoftAccountProperties = original.LegacyMicrosoftAccountProperties type LinuxJavaContainerSettings = original.LinuxJavaContainerSettings type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail @@ -1315,6 +1380,7 @@ type PushSettings = original.PushSettings type PushSettingsProperties = original.PushSettingsProperties type QueryUtterancesResult = original.QueryUtterancesResult type QueryUtterancesResults = original.QueryUtterancesResults +type QueueScaleRule = original.QueueScaleRule type RampUpRule = original.RampUpRule type ReadCloser = original.ReadCloser type Recommendation = original.Recommendation @@ -1325,6 +1391,7 @@ type RecommendationProperties = original.RecommendationProperties type RecommendationRule = original.RecommendationRule type RecommendationRuleProperties = original.RecommendationRuleProperties type RecommendationsClient = original.RecommendationsClient +type RegistryCredentials = original.RegistryCredentials type ReissueCertificateOrderRequest = original.ReissueCertificateOrderRequest type ReissueCertificateOrderRequestProperties = original.ReissueCertificateOrderRequestProperties type RelayServiceConnectionEntity = original.RelayServiceConnectionEntity @@ -1359,7 +1426,17 @@ type ResponseMessageEnvelopeRemotePrivateEndpointConnection = original.ResponseM type ResponseMetaData = original.ResponseMetaData type RestoreRequest = original.RestoreRequest type RestoreRequestProperties = original.RestoreRequestProperties +type Revision = original.Revision +type RevisionCollection = original.RevisionCollection +type RevisionCollectionIterator = original.RevisionCollectionIterator +type RevisionCollectionPage = original.RevisionCollectionPage +type RevisionProperties = original.RevisionProperties type SampleUtterance = original.SampleUtterance +type Scale = original.Scale +type ScaleRule = original.ScaleRule +type ScaleRuleAuth = original.ScaleRuleAuth +type Secret = original.Secret +type SecretsCollection = original.SecretsCollection type ServiceSpecification = original.ServiceSpecification type SetObject = original.SetObject type Site = original.Site @@ -1512,6 +1589,7 @@ type StringList = original.StringList type SupportTopic = original.SupportTopic type SwiftVirtualNetwork = original.SwiftVirtualNetwork type SwiftVirtualNetworkProperties = original.SwiftVirtualNetworkProperties +type Template = original.Template type TldLegalAgreement = original.TldLegalAgreement type TldLegalAgreementCollection = original.TldLegalAgreementCollection type TldLegalAgreementCollectionIterator = original.TldLegalAgreementCollectionIterator @@ -1524,6 +1602,7 @@ type TopLevelDomainCollectionIterator = original.TopLevelDomainCollectionIterato type TopLevelDomainCollectionPage = original.TopLevelDomainCollectionPage type TopLevelDomainProperties = original.TopLevelDomainProperties type TopLevelDomainsClient = original.TopLevelDomainsClient +type TrafficWeight = original.TrafficWeight type TriggeredJobHistory = original.TriggeredJobHistory type TriggeredJobHistoryCollection = original.TriggeredJobHistoryCollection type TriggeredJobHistoryCollectionIterator = original.TriggeredJobHistoryCollectionIterator @@ -1536,7 +1615,6 @@ type TriggeredWebJobCollectionIterator = original.TriggeredWebJobCollectionItera type TriggeredWebJobCollectionPage = original.TriggeredWebJobCollectionPage type TriggeredWebJobProperties = original.TriggeredWebJobProperties type Twitter = original.Twitter -type TwitterProperties = original.TwitterProperties type TwitterRegistration = original.TwitterRegistration type Usage = original.Usage type UsageCollection = original.UsageCollection @@ -1690,6 +1768,24 @@ func NewCertificatesClient(subscriptionID string) CertificatesClient { func NewCertificatesClientWithBaseURI(baseURI string, subscriptionID string) CertificatesClient { return original.NewCertificatesClientWithBaseURI(baseURI, subscriptionID) } +func NewContainerAppCollectionIterator(page ContainerAppCollectionPage) ContainerAppCollectionIterator { + return original.NewContainerAppCollectionIterator(page) +} +func NewContainerAppCollectionPage(cur ContainerAppCollection, getNextPage func(context.Context, ContainerAppCollection) (ContainerAppCollection, error)) ContainerAppCollectionPage { + return original.NewContainerAppCollectionPage(cur, getNextPage) +} +func NewContainerAppsClient(subscriptionID string) ContainerAppsClient { + return original.NewContainerAppsClient(subscriptionID) +} +func NewContainerAppsClientWithBaseURI(baseURI string, subscriptionID string) ContainerAppsClient { + return original.NewContainerAppsClientWithBaseURI(baseURI, subscriptionID) +} +func NewContainerAppsRevisionsClient(subscriptionID string) ContainerAppsRevisionsClient { + return original.NewContainerAppsRevisionsClient(subscriptionID) +} +func NewContainerAppsRevisionsClientWithBaseURI(baseURI string, subscriptionID string) ContainerAppsRevisionsClient { + return original.NewContainerAppsRevisionsClientWithBaseURI(baseURI, subscriptionID) +} func NewContinuousWebJobCollectionIterator(page ContinuousWebJobCollectionPage) ContinuousWebJobCollectionIterator { return original.NewContinuousWebJobCollectionIterator(page) } @@ -1708,6 +1804,12 @@ func NewCsmUsageQuotaCollectionIterator(page CsmUsageQuotaCollectionPage) CsmUsa func NewCsmUsageQuotaCollectionPage(cur CsmUsageQuotaCollection, getNextPage func(context.Context, CsmUsageQuotaCollection) (CsmUsageQuotaCollection, error)) CsmUsageQuotaCollectionPage { return original.NewCsmUsageQuotaCollectionPage(cur, getNextPage) } +func NewCustomHostnameSitesCollectionIterator(page CustomHostnameSitesCollectionPage) CustomHostnameSitesCollectionIterator { + return original.NewCustomHostnameSitesCollectionIterator(page) +} +func NewCustomHostnameSitesCollectionPage(cur CustomHostnameSitesCollection, getNextPage func(context.Context, CustomHostnameSitesCollection) (CustomHostnameSitesCollection, error)) CustomHostnameSitesCollectionPage { + return original.NewCustomHostnameSitesCollectionPage(cur, getNextPage) +} func NewDeletedWebAppCollectionIterator(page DeletedWebAppCollectionPage) DeletedWebAppCollectionIterator { return original.NewDeletedWebAppCollectionIterator(page) } @@ -1948,6 +2050,12 @@ func NewResourceMetricDefinitionCollectionIterator(page ResourceMetricDefinition func NewResourceMetricDefinitionCollectionPage(cur ResourceMetricDefinitionCollection, getNextPage func(context.Context, ResourceMetricDefinitionCollection) (ResourceMetricDefinitionCollection, error)) ResourceMetricDefinitionCollectionPage { return original.NewResourceMetricDefinitionCollectionPage(cur, getNextPage) } +func NewRevisionCollectionIterator(page RevisionCollectionPage) RevisionCollectionIterator { + return original.NewRevisionCollectionIterator(page) +} +func NewRevisionCollectionPage(cur RevisionCollection, getNextPage func(context.Context, RevisionCollection) (RevisionCollection, error)) RevisionCollectionPage { + return original.NewRevisionCollectionPage(cur, getNextPage) +} func NewSiteConfigResourceCollectionIterator(page SiteConfigResourceCollectionPage) SiteConfigResourceCollectionIterator { return original.NewSiteConfigResourceCollectionIterator(page) } @@ -2083,6 +2191,9 @@ func NewWorkerPoolCollectionIterator(page WorkerPoolCollectionPage) WorkerPoolCo func NewWorkerPoolCollectionPage(cur WorkerPoolCollection, getNextPage func(context.Context, WorkerPoolCollection) (WorkerPoolCollection, error)) WorkerPoolCollectionPage { return original.NewWorkerPoolCollectionPage(cur, getNextPage) } +func PossibleActiveRevisionsModeValues() []ActiveRevisionsMode { + return original.PossibleActiveRevisionsModeValues() +} func PossibleAppServicePlanRestrictionsValues() []AppServicePlanRestrictions { return original.PossibleAppServicePlanRestrictionsValues() } @@ -2143,6 +2254,9 @@ func PossibleConfigReferenceSourceValues() []ConfigReferenceSource { func PossibleConnectionStringTypeValues() []ConnectionStringType { return original.PossibleConnectionStringTypeValues() } +func PossibleContainerAppProvisioningStateValues() []ContainerAppProvisioningState { + return original.PossibleContainerAppProvisioningStateValues() +} func PossibleContinuousWebJobStatusValues() []ContinuousWebJobStatus { return original.PossibleContinuousWebJobStatusValues() } @@ -2173,6 +2287,9 @@ func PossibleDomainStatusValues() []DomainStatus { func PossibleDomainTypeValues() []DomainType { return original.PossibleDomainTypeValues() } +func PossibleEnterpriseGradeCdnStatusValues() []EnterpriseGradeCdnStatus { + return original.PossibleEnterpriseGradeCdnStatusValues() +} func PossibleForwardProxyConventionValues() []ForwardProxyConvention { return original.PossibleForwardProxyConventionValues() } @@ -2200,6 +2317,9 @@ func PossibleIPFilterTagValues() []IPFilterTag { func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { return original.PossibleInAvailabilityReasonTypeValues() } +func PossibleIngressTransportMethodValues() []IngressTransportMethod { + return original.PossibleIngressTransportMethodValues() +} func PossibleInsightStatusValues() []InsightStatus { return original.PossibleInsightStatusValues() } @@ -2263,6 +2383,12 @@ func PossibleResolveStatusValues() []ResolveStatus { func PossibleResourceScopeTypeValues() []ResourceScopeType { return original.PossibleResourceScopeTypeValues() } +func PossibleRevisionHealthStateValues() []RevisionHealthState { + return original.PossibleRevisionHealthStateValues() +} +func PossibleRevisionProvisioningStateValues() []RevisionProvisioningState { + return original.PossibleRevisionProvisioningStateValues() +} func PossibleRouteTypeValues() []RouteType { return original.PossibleRouteTypeValues() } diff --git a/profiles/latest/web/mgmt/web/webapi/models.go b/profiles/latest/web/mgmt/web/webapi/models.go index c84c8c556c8f..a8a61687aa4d 100644 --- a/profiles/latest/web/mgmt/web/webapi/models.go +++ b/profiles/latest/web/mgmt/web/webapi/models.go @@ -9,7 +9,7 @@ package webapi -import original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web/webapi" +import original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web/webapi" type AppServiceCertificateOrdersClientAPI = original.AppServiceCertificateOrdersClientAPI type AppServiceEnvironmentsClientAPI = original.AppServiceEnvironmentsClientAPI @@ -19,6 +19,8 @@ type BaseClientAPI = original.BaseClientAPI type CertificateOrdersDiagnosticsClientAPI = original.CertificateOrdersDiagnosticsClientAPI type CertificateRegistrationProviderClientAPI = original.CertificateRegistrationProviderClientAPI type CertificatesClientAPI = original.CertificatesClientAPI +type ContainerAppsClientAPI = original.ContainerAppsClientAPI +type ContainerAppsRevisionsClientAPI = original.ContainerAppsRevisionsClientAPI type DeletedWebAppsClientAPI = original.DeletedWebAppsClientAPI type DiagnosticsClientAPI = original.DiagnosticsClientAPI type DomainRegistrationProviderClientAPI = original.DomainRegistrationProviderClientAPI diff --git a/profiles/preview/web/mgmt/web/models.go b/profiles/preview/web/mgmt/web/models.go index 2eba1623b50e..32a5fe7c369c 100644 --- a/profiles/preview/web/mgmt/web/models.go +++ b/profiles/preview/web/mgmt/web/models.go @@ -12,13 +12,20 @@ package web import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web" + original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web" ) const ( DefaultBaseURI = original.DefaultBaseURI ) +type ActiveRevisionsMode = original.ActiveRevisionsMode + +const ( + ActiveRevisionsModeMultiple ActiveRevisionsMode = original.ActiveRevisionsModeMultiple + ActiveRevisionsModeSingle ActiveRevisionsMode = original.ActiveRevisionsModeSingle +) + type AppServicePlanRestrictions = original.AppServicePlanRestrictions const ( @@ -225,6 +232,15 @@ const ( ConnectionStringTypeSQLServer ConnectionStringType = original.ConnectionStringTypeSQLServer ) +type ContainerAppProvisioningState = original.ContainerAppProvisioningState + +const ( + ContainerAppProvisioningStateCanceled ContainerAppProvisioningState = original.ContainerAppProvisioningStateCanceled + ContainerAppProvisioningStateFailed ContainerAppProvisioningState = original.ContainerAppProvisioningStateFailed + ContainerAppProvisioningStateInProgress ContainerAppProvisioningState = original.ContainerAppProvisioningStateInProgress + ContainerAppProvisioningStateSucceeded ContainerAppProvisioningState = original.ContainerAppProvisioningStateSucceeded +) + type ContinuousWebJobStatus = original.ContinuousWebJobStatus const ( @@ -325,6 +341,15 @@ const ( DomainTypeSoftDeleted DomainType = original.DomainTypeSoftDeleted ) +type EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatus + +const ( + EnterpriseGradeCdnStatusDisabled EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusDisabled + EnterpriseGradeCdnStatusDisabling EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusDisabling + EnterpriseGradeCdnStatusEnabled EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusEnabled + EnterpriseGradeCdnStatusEnabling EnterpriseGradeCdnStatus = original.EnterpriseGradeCdnStatusEnabling +) + type ForwardProxyConvention = original.ForwardProxyConvention const ( @@ -393,6 +418,14 @@ const ( InAvailabilityReasonTypeInvalid InAvailabilityReasonType = original.InAvailabilityReasonTypeInvalid ) +type IngressTransportMethod = original.IngressTransportMethod + +const ( + IngressTransportMethodAuto IngressTransportMethod = original.IngressTransportMethodAuto + IngressTransportMethodHTTP IngressTransportMethod = original.IngressTransportMethodHTTP + IngressTransportMethodHTTP2 IngressTransportMethod = original.IngressTransportMethodHTTP2 +) + type InsightStatus = original.InsightStatus const ( @@ -623,6 +656,24 @@ const ( ResourceScopeTypeWebSite ResourceScopeType = original.ResourceScopeTypeWebSite ) +type RevisionHealthState = original.RevisionHealthState + +const ( + RevisionHealthStateHealthy RevisionHealthState = original.RevisionHealthStateHealthy + RevisionHealthStateNone RevisionHealthState = original.RevisionHealthStateNone + RevisionHealthStateUnhealthy RevisionHealthState = original.RevisionHealthStateUnhealthy +) + +type RevisionProvisioningState = original.RevisionProvisioningState + +const ( + RevisionProvisioningStateDeprovisioned RevisionProvisioningState = original.RevisionProvisioningStateDeprovisioned + RevisionProvisioningStateDeprovisioning RevisionProvisioningState = original.RevisionProvisioningStateDeprovisioning + RevisionProvisioningStateFailed RevisionProvisioningState = original.RevisionProvisioningStateFailed + RevisionProvisioningStateProvisioned RevisionProvisioningState = original.RevisionProvisioningStateProvisioned + RevisionProvisioningStateProvisioning RevisionProvisioningState = original.RevisionProvisioningStateProvisioning +) + type RouteType = original.RouteType const ( @@ -831,7 +882,6 @@ type AddressResponse = original.AddressResponse type AddressResponseProperties = original.AddressResponseProperties type AllowedAudiencesValidation = original.AllowedAudiencesValidation type AllowedPrincipals = original.AllowedPrincipals -type AllowedPrincipalsProperties = original.AllowedPrincipalsProperties type AnalysisData = original.AnalysisData type AnalysisDefinition = original.AnalysisDefinition type AnalysisDefinitionProperties = original.AnalysisDefinitionProperties @@ -846,7 +896,6 @@ type AppLogsConfiguration = original.AppLogsConfiguration type AppMajorVersion = original.AppMajorVersion type AppMinorVersion = original.AppMinorVersion type AppRegistration = original.AppRegistration -type AppRegistrationProperties = original.AppRegistrationProperties type AppRuntimeSettings = original.AppRuntimeSettings type AppRuntimes = original.AppRuntimes type AppServiceCertificate = original.AppServiceCertificate @@ -899,7 +948,6 @@ type AppStackCollectionIterator = original.AppStackCollectionIterator type AppStackCollectionPage = original.AppStackCollectionPage type AppStackProperties = original.AppStackProperties type Apple = original.Apple -type AppleProperties = original.AppleProperties type AppleRegistration = original.AppleRegistration type ApplicationLogsConfig = original.ApplicationLogsConfig type ApplicationStack = original.ApplicationStack @@ -956,15 +1004,11 @@ type AutoHealRules = original.AutoHealRules type AutoHealTriggers = original.AutoHealTriggers type AzureActiveDirectory = original.AzureActiveDirectory type AzureActiveDirectoryLogin = original.AzureActiveDirectoryLogin -type AzureActiveDirectoryLoginProperties = original.AzureActiveDirectoryLoginProperties type AzureActiveDirectoryRegistration = original.AzureActiveDirectoryRegistration -type AzureActiveDirectoryRegistrationProperties = original.AzureActiveDirectoryRegistrationProperties type AzureActiveDirectoryValidation = original.AzureActiveDirectoryValidation -type AzureActiveDirectoryValidationProperties = original.AzureActiveDirectoryValidationProperties type AzureBlobStorageApplicationLogsConfig = original.AzureBlobStorageApplicationLogsConfig type AzureBlobStorageHTTPLogsConfig = original.AzureBlobStorageHTTPLogsConfig type AzureStaticWebApps = original.AzureStaticWebApps -type AzureStaticWebAppsProperties = original.AzureStaticWebAppsProperties type AzureStaticWebAppsRegistration = original.AzureStaticWebAppsRegistration type AzureStorageInfoValue = original.AzureStorageInfoValue type AzureStoragePropertyDictionaryResource = original.AzureStoragePropertyDictionaryResource @@ -984,7 +1028,6 @@ type BillingMeterCollectionIterator = original.BillingMeterCollectionIterator type BillingMeterCollectionPage = original.BillingMeterCollectionPage type BillingMeterProperties = original.BillingMeterProperties type BlobStorageTokenStore = original.BlobStorageTokenStore -type BlobStorageTokenStoreProperties = original.BlobStorageTokenStoreProperties type Capability = original.Capability type Certificate = original.Certificate type CertificateCollection = original.CertificateCollection @@ -1004,15 +1047,29 @@ type CertificateRegistrationProviderClient = original.CertificateRegistrationPro type CertificatesClient = original.CertificatesClient type ClientRegistration = original.ClientRegistration type CloningInfo = original.CloningInfo +type Configuration = original.Configuration type ConnStringInfo = original.ConnStringInfo type ConnStringValueTypePair = original.ConnStringValueTypePair type ConnectionStringDictionary = original.ConnectionStringDictionary type Contact = original.Contact +type Container = original.Container +type ContainerApp = original.ContainerApp +type ContainerAppCollection = original.ContainerAppCollection +type ContainerAppCollectionIterator = original.ContainerAppCollectionIterator +type ContainerAppCollectionPage = original.ContainerAppCollectionPage +type ContainerAppProperties = original.ContainerAppProperties +type ContainerAppSecret = original.ContainerAppSecret +type ContainerAppsClient = original.ContainerAppsClient +type ContainerAppsConfiguration = original.ContainerAppsConfiguration +type ContainerAppsCreateOrUpdateFuture = original.ContainerAppsCreateOrUpdateFuture +type ContainerAppsDeleteFuture = original.ContainerAppsDeleteFuture +type ContainerAppsRevisionsClient = original.ContainerAppsRevisionsClient type ContainerCPUStatistics = original.ContainerCPUStatistics type ContainerCPUUsage = original.ContainerCPUUsage type ContainerInfo = original.ContainerInfo type ContainerMemoryStatistics = original.ContainerMemoryStatistics type ContainerNetworkInterfaceStatistics = original.ContainerNetworkInterfaceStatistics +type ContainerResources = original.ContainerResources type ContainerThrottlingData = original.ContainerThrottlingData type ContinuousWebJob = original.ContinuousWebJob type ContinuousWebJobCollection = original.ContinuousWebJobCollection @@ -1038,8 +1095,16 @@ type CsmUsageQuotaCollectionIterator = original.CsmUsageQuotaCollectionIterator type CsmUsageQuotaCollectionPage = original.CsmUsageQuotaCollectionPage type CustomHostnameAnalysisResult = original.CustomHostnameAnalysisResult type CustomHostnameAnalysisResultProperties = original.CustomHostnameAnalysisResultProperties +type CustomHostnameSites = original.CustomHostnameSites +type CustomHostnameSitesCollection = original.CustomHostnameSitesCollection +type CustomHostnameSitesCollectionIterator = original.CustomHostnameSitesCollectionIterator +type CustomHostnameSitesCollectionPage = original.CustomHostnameSitesCollectionPage +type CustomHostnameSitesProperties = original.CustomHostnameSitesProperties type CustomOpenIDConnectProvider = original.CustomOpenIDConnectProvider -type CustomOpenIDConnectProviderProperties = original.CustomOpenIDConnectProviderProperties +type CustomScaleRule = original.CustomScaleRule +type Dapr = original.Dapr +type DaprComponent = original.DaprComponent +type DaprMetadata = original.DaprMetadata type DataProviderMetadata = original.DataProviderMetadata type DataSource = original.DataSource type DataTableResponseColumn = original.DataTableResponseColumn @@ -1114,6 +1179,7 @@ type DomainsCreateOrUpdateFuture = original.DomainsCreateOrUpdateFuture type EnabledConfig = original.EnabledConfig type EndpointDependency = original.EndpointDependency type EndpointDetail = original.EndpointDetail +type EnvironmentVar = original.EnvironmentVar type ErrorEntity = original.ErrorEntity type Experiments = original.Experiments type ExtendedLocation = original.ExtendedLocation @@ -1148,13 +1214,12 @@ type GitHubActionCodeConfiguration = original.GitHubActionCodeConfiguration type GitHubActionConfiguration = original.GitHubActionConfiguration type GitHubActionContainerConfiguration = original.GitHubActionContainerConfiguration type GitHubActionWebAppStackSettings = original.GitHubActionWebAppStackSettings -type GitHubProperties = original.GitHubProperties type GlobalClient = original.GlobalClient type GlobalCsmSkuDescription = original.GlobalCsmSkuDescription type GlobalValidation = original.GlobalValidation type Google = original.Google -type GoogleProperties = original.GoogleProperties type HTTPLogsConfig = original.HTTPLogsConfig +type HTTPScaleRule = original.HTTPScaleRule type HTTPSettings = original.HTTPSettings type HTTPSettingsRoutes = original.HTTPSettingsRoutes type HandlerMapping = original.HandlerMapping @@ -1189,6 +1254,7 @@ type InboundEnvironmentEndpoint = original.InboundEnvironmentEndpoint type InboundEnvironmentEndpointCollection = original.InboundEnvironmentEndpointCollection type InboundEnvironmentEndpointCollectionIterator = original.InboundEnvironmentEndpointCollectionIterator type InboundEnvironmentEndpointCollectionPage = original.InboundEnvironmentEndpointCollectionPage +type Ingress = original.Ingress type Job = original.Job type JobCollection = original.JobCollection type JobCollectionIterator = original.JobCollectionIterator @@ -1209,7 +1275,6 @@ type KubeEnvironmentsClient = original.KubeEnvironmentsClient type KubeEnvironmentsCreateOrUpdateFuture = original.KubeEnvironmentsCreateOrUpdateFuture type KubeEnvironmentsDeleteFuture = original.KubeEnvironmentsDeleteFuture type LegacyMicrosoftAccount = original.LegacyMicrosoftAccount -type LegacyMicrosoftAccountProperties = original.LegacyMicrosoftAccountProperties type LinuxJavaContainerSettings = original.LinuxJavaContainerSettings type ListCapability = original.ListCapability type ListCertificateEmail = original.ListCertificateEmail @@ -1315,6 +1380,7 @@ type PushSettings = original.PushSettings type PushSettingsProperties = original.PushSettingsProperties type QueryUtterancesResult = original.QueryUtterancesResult type QueryUtterancesResults = original.QueryUtterancesResults +type QueueScaleRule = original.QueueScaleRule type RampUpRule = original.RampUpRule type ReadCloser = original.ReadCloser type Recommendation = original.Recommendation @@ -1325,6 +1391,7 @@ type RecommendationProperties = original.RecommendationProperties type RecommendationRule = original.RecommendationRule type RecommendationRuleProperties = original.RecommendationRuleProperties type RecommendationsClient = original.RecommendationsClient +type RegistryCredentials = original.RegistryCredentials type ReissueCertificateOrderRequest = original.ReissueCertificateOrderRequest type ReissueCertificateOrderRequestProperties = original.ReissueCertificateOrderRequestProperties type RelayServiceConnectionEntity = original.RelayServiceConnectionEntity @@ -1359,7 +1426,17 @@ type ResponseMessageEnvelopeRemotePrivateEndpointConnection = original.ResponseM type ResponseMetaData = original.ResponseMetaData type RestoreRequest = original.RestoreRequest type RestoreRequestProperties = original.RestoreRequestProperties +type Revision = original.Revision +type RevisionCollection = original.RevisionCollection +type RevisionCollectionIterator = original.RevisionCollectionIterator +type RevisionCollectionPage = original.RevisionCollectionPage +type RevisionProperties = original.RevisionProperties type SampleUtterance = original.SampleUtterance +type Scale = original.Scale +type ScaleRule = original.ScaleRule +type ScaleRuleAuth = original.ScaleRuleAuth +type Secret = original.Secret +type SecretsCollection = original.SecretsCollection type ServiceSpecification = original.ServiceSpecification type SetObject = original.SetObject type Site = original.Site @@ -1512,6 +1589,7 @@ type StringList = original.StringList type SupportTopic = original.SupportTopic type SwiftVirtualNetwork = original.SwiftVirtualNetwork type SwiftVirtualNetworkProperties = original.SwiftVirtualNetworkProperties +type Template = original.Template type TldLegalAgreement = original.TldLegalAgreement type TldLegalAgreementCollection = original.TldLegalAgreementCollection type TldLegalAgreementCollectionIterator = original.TldLegalAgreementCollectionIterator @@ -1524,6 +1602,7 @@ type TopLevelDomainCollectionIterator = original.TopLevelDomainCollectionIterato type TopLevelDomainCollectionPage = original.TopLevelDomainCollectionPage type TopLevelDomainProperties = original.TopLevelDomainProperties type TopLevelDomainsClient = original.TopLevelDomainsClient +type TrafficWeight = original.TrafficWeight type TriggeredJobHistory = original.TriggeredJobHistory type TriggeredJobHistoryCollection = original.TriggeredJobHistoryCollection type TriggeredJobHistoryCollectionIterator = original.TriggeredJobHistoryCollectionIterator @@ -1536,7 +1615,6 @@ type TriggeredWebJobCollectionIterator = original.TriggeredWebJobCollectionItera type TriggeredWebJobCollectionPage = original.TriggeredWebJobCollectionPage type TriggeredWebJobProperties = original.TriggeredWebJobProperties type Twitter = original.Twitter -type TwitterProperties = original.TwitterProperties type TwitterRegistration = original.TwitterRegistration type Usage = original.Usage type UsageCollection = original.UsageCollection @@ -1690,6 +1768,24 @@ func NewCertificatesClient(subscriptionID string) CertificatesClient { func NewCertificatesClientWithBaseURI(baseURI string, subscriptionID string) CertificatesClient { return original.NewCertificatesClientWithBaseURI(baseURI, subscriptionID) } +func NewContainerAppCollectionIterator(page ContainerAppCollectionPage) ContainerAppCollectionIterator { + return original.NewContainerAppCollectionIterator(page) +} +func NewContainerAppCollectionPage(cur ContainerAppCollection, getNextPage func(context.Context, ContainerAppCollection) (ContainerAppCollection, error)) ContainerAppCollectionPage { + return original.NewContainerAppCollectionPage(cur, getNextPage) +} +func NewContainerAppsClient(subscriptionID string) ContainerAppsClient { + return original.NewContainerAppsClient(subscriptionID) +} +func NewContainerAppsClientWithBaseURI(baseURI string, subscriptionID string) ContainerAppsClient { + return original.NewContainerAppsClientWithBaseURI(baseURI, subscriptionID) +} +func NewContainerAppsRevisionsClient(subscriptionID string) ContainerAppsRevisionsClient { + return original.NewContainerAppsRevisionsClient(subscriptionID) +} +func NewContainerAppsRevisionsClientWithBaseURI(baseURI string, subscriptionID string) ContainerAppsRevisionsClient { + return original.NewContainerAppsRevisionsClientWithBaseURI(baseURI, subscriptionID) +} func NewContinuousWebJobCollectionIterator(page ContinuousWebJobCollectionPage) ContinuousWebJobCollectionIterator { return original.NewContinuousWebJobCollectionIterator(page) } @@ -1708,6 +1804,12 @@ func NewCsmUsageQuotaCollectionIterator(page CsmUsageQuotaCollectionPage) CsmUsa func NewCsmUsageQuotaCollectionPage(cur CsmUsageQuotaCollection, getNextPage func(context.Context, CsmUsageQuotaCollection) (CsmUsageQuotaCollection, error)) CsmUsageQuotaCollectionPage { return original.NewCsmUsageQuotaCollectionPage(cur, getNextPage) } +func NewCustomHostnameSitesCollectionIterator(page CustomHostnameSitesCollectionPage) CustomHostnameSitesCollectionIterator { + return original.NewCustomHostnameSitesCollectionIterator(page) +} +func NewCustomHostnameSitesCollectionPage(cur CustomHostnameSitesCollection, getNextPage func(context.Context, CustomHostnameSitesCollection) (CustomHostnameSitesCollection, error)) CustomHostnameSitesCollectionPage { + return original.NewCustomHostnameSitesCollectionPage(cur, getNextPage) +} func NewDeletedWebAppCollectionIterator(page DeletedWebAppCollectionPage) DeletedWebAppCollectionIterator { return original.NewDeletedWebAppCollectionIterator(page) } @@ -1948,6 +2050,12 @@ func NewResourceMetricDefinitionCollectionIterator(page ResourceMetricDefinition func NewResourceMetricDefinitionCollectionPage(cur ResourceMetricDefinitionCollection, getNextPage func(context.Context, ResourceMetricDefinitionCollection) (ResourceMetricDefinitionCollection, error)) ResourceMetricDefinitionCollectionPage { return original.NewResourceMetricDefinitionCollectionPage(cur, getNextPage) } +func NewRevisionCollectionIterator(page RevisionCollectionPage) RevisionCollectionIterator { + return original.NewRevisionCollectionIterator(page) +} +func NewRevisionCollectionPage(cur RevisionCollection, getNextPage func(context.Context, RevisionCollection) (RevisionCollection, error)) RevisionCollectionPage { + return original.NewRevisionCollectionPage(cur, getNextPage) +} func NewSiteConfigResourceCollectionIterator(page SiteConfigResourceCollectionPage) SiteConfigResourceCollectionIterator { return original.NewSiteConfigResourceCollectionIterator(page) } @@ -2083,6 +2191,9 @@ func NewWorkerPoolCollectionIterator(page WorkerPoolCollectionPage) WorkerPoolCo func NewWorkerPoolCollectionPage(cur WorkerPoolCollection, getNextPage func(context.Context, WorkerPoolCollection) (WorkerPoolCollection, error)) WorkerPoolCollectionPage { return original.NewWorkerPoolCollectionPage(cur, getNextPage) } +func PossibleActiveRevisionsModeValues() []ActiveRevisionsMode { + return original.PossibleActiveRevisionsModeValues() +} func PossibleAppServicePlanRestrictionsValues() []AppServicePlanRestrictions { return original.PossibleAppServicePlanRestrictionsValues() } @@ -2143,6 +2254,9 @@ func PossibleConfigReferenceSourceValues() []ConfigReferenceSource { func PossibleConnectionStringTypeValues() []ConnectionStringType { return original.PossibleConnectionStringTypeValues() } +func PossibleContainerAppProvisioningStateValues() []ContainerAppProvisioningState { + return original.PossibleContainerAppProvisioningStateValues() +} func PossibleContinuousWebJobStatusValues() []ContinuousWebJobStatus { return original.PossibleContinuousWebJobStatusValues() } @@ -2173,6 +2287,9 @@ func PossibleDomainStatusValues() []DomainStatus { func PossibleDomainTypeValues() []DomainType { return original.PossibleDomainTypeValues() } +func PossibleEnterpriseGradeCdnStatusValues() []EnterpriseGradeCdnStatus { + return original.PossibleEnterpriseGradeCdnStatusValues() +} func PossibleForwardProxyConventionValues() []ForwardProxyConvention { return original.PossibleForwardProxyConventionValues() } @@ -2200,6 +2317,9 @@ func PossibleIPFilterTagValues() []IPFilterTag { func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { return original.PossibleInAvailabilityReasonTypeValues() } +func PossibleIngressTransportMethodValues() []IngressTransportMethod { + return original.PossibleIngressTransportMethodValues() +} func PossibleInsightStatusValues() []InsightStatus { return original.PossibleInsightStatusValues() } @@ -2263,6 +2383,12 @@ func PossibleResolveStatusValues() []ResolveStatus { func PossibleResourceScopeTypeValues() []ResourceScopeType { return original.PossibleResourceScopeTypeValues() } +func PossibleRevisionHealthStateValues() []RevisionHealthState { + return original.PossibleRevisionHealthStateValues() +} +func PossibleRevisionProvisioningStateValues() []RevisionProvisioningState { + return original.PossibleRevisionProvisioningStateValues() +} func PossibleRouteTypeValues() []RouteType { return original.PossibleRouteTypeValues() } diff --git a/profiles/preview/web/mgmt/web/webapi/models.go b/profiles/preview/web/mgmt/web/webapi/models.go index c84c8c556c8f..a8a61687aa4d 100644 --- a/profiles/preview/web/mgmt/web/webapi/models.go +++ b/profiles/preview/web/mgmt/web/webapi/models.go @@ -9,7 +9,7 @@ package webapi -import original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-02-01/web/webapi" +import original "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web/webapi" type AppServiceCertificateOrdersClientAPI = original.AppServiceCertificateOrdersClientAPI type AppServiceEnvironmentsClientAPI = original.AppServiceEnvironmentsClientAPI @@ -19,6 +19,8 @@ type BaseClientAPI = original.BaseClientAPI type CertificateOrdersDiagnosticsClientAPI = original.CertificateOrdersDiagnosticsClientAPI type CertificateRegistrationProviderClientAPI = original.CertificateRegistrationProviderClientAPI type CertificatesClientAPI = original.CertificatesClientAPI +type ContainerAppsClientAPI = original.ContainerAppsClientAPI +type ContainerAppsRevisionsClientAPI = original.ContainerAppsRevisionsClientAPI type DeletedWebAppsClientAPI = original.DeletedWebAppsClientAPI type DiagnosticsClientAPI = original.DiagnosticsClientAPI type DomainRegistrationProviderClientAPI = original.DomainRegistrationProviderClientAPI diff --git a/services/web/mgmt/2021-03-01/web/CHANGELOG.md b/services/web/mgmt/2021-03-01/web/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/web/mgmt/2021-03-01/web/_meta.json b/services/web/mgmt/2021-03-01/web/_meta.json new file mode 100644 index 000000000000..0d0b046dd1df --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", + "readme": "/_/azure-rest-api-specs/specification/web/resource-manager/readme.md", + "tag": "package-2021-03", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-03 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/web/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" + } +} \ No newline at end of file diff --git a/services/web/mgmt/2021-03-01/web/apps.go b/services/web/mgmt/2021-03-01/web/apps.go new file mode 100644 index 000000000000..31cff2b913d3 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/apps.go @@ -0,0 +1,37361 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AppsClient is the webSite Management Client +type AppsClient struct { + BaseClient +} + +// NewAppsClient creates an instance of the AppsClient client. +func NewAppsClient(subscriptionID string) AppsClient { + return NewAppsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAppsClientWithBaseURI creates an instance of the AppsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAppsClientWithBaseURI(baseURI string, subscriptionID string) AppsClient { + return AppsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// AddPremierAddOn description for Updates a named add-on of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +// premierAddOn - a JSON representation of the edited premier add-on. +func (client AppsClient) AddPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.AddPremierAddOn") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "AddPremierAddOn", err.Error()) + } + + req, err := client.AddPremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName, premierAddOn) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AddPremierAddOn", nil, "Failure preparing request") + return + } + + resp, err := client.AddPremierAddOnSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "AddPremierAddOn", resp, "Failure sending request") + return + } + + result, err = client.AddPremierAddOnResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AddPremierAddOn", resp, "Failure responding to request") + return + } + + return +} + +// AddPremierAddOnPreparer prepares the AddPremierAddOn request. +func (client AppsClient) AddPremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithJSON(premierAddOn), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddPremierAddOnSender sends the AddPremierAddOn request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) AddPremierAddOnSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AddPremierAddOnResponder handles the response to the AddPremierAddOn request. The method always +// closes the http.Response Body. +func (client AppsClient) AddPremierAddOnResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AddPremierAddOnSlot description for Updates a named add-on of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +// premierAddOn - a JSON representation of the edited premier add-on. +// slot - name of the deployment slot. If a slot is not specified, the API will update the named add-on for the +// production slot. +func (client AppsClient) AddPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn, slot string) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.AddPremierAddOnSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "AddPremierAddOnSlot", err.Error()) + } + + req, err := client.AddPremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, premierAddOn, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AddPremierAddOnSlot", nil, "Failure preparing request") + return + } + + resp, err := client.AddPremierAddOnSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "AddPremierAddOnSlot", resp, "Failure sending request") + return + } + + result, err = client.AddPremierAddOnSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AddPremierAddOnSlot", resp, "Failure responding to request") + return + } + + return +} + +// AddPremierAddOnSlotPreparer prepares the AddPremierAddOnSlot request. +func (client AppsClient) AddPremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOn, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithJSON(premierAddOn), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AddPremierAddOnSlotSender sends the AddPremierAddOnSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) AddPremierAddOnSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AddPremierAddOnSlotResponder handles the response to the AddPremierAddOnSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) AddPremierAddOnSlotResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeCustomHostname description for Analyze a custom hostname. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// hostName - custom hostname. +func (client AppsClient) AnalyzeCustomHostname(ctx context.Context, resourceGroupName string, name string, hostName string) (result CustomHostnameAnalysisResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.AnalyzeCustomHostname") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "AnalyzeCustomHostname", err.Error()) + } + + req, err := client.AnalyzeCustomHostnamePreparer(ctx, resourceGroupName, name, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AnalyzeCustomHostname", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeCustomHostnameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "AnalyzeCustomHostname", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeCustomHostnameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AnalyzeCustomHostname", resp, "Failure responding to request") + return + } + + return +} + +// AnalyzeCustomHostnamePreparer prepares the AnalyzeCustomHostname request. +func (client AppsClient) AnalyzeCustomHostnamePreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(hostName) > 0 { + queryParameters["hostName"] = autorest.Encode("query", hostName) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/analyzeCustomHostname", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeCustomHostnameSender sends the AnalyzeCustomHostname request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) AnalyzeCustomHostnameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AnalyzeCustomHostnameResponder handles the response to the AnalyzeCustomHostname request. The method always +// closes the http.Response Body. +func (client AppsClient) AnalyzeCustomHostnameResponder(resp *http.Response) (result CustomHostnameAnalysisResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// AnalyzeCustomHostnameSlot description for Analyze a custom hostname. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// hostName - custom hostname. +func (client AppsClient) AnalyzeCustomHostnameSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result CustomHostnameAnalysisResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.AnalyzeCustomHostnameSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "AnalyzeCustomHostnameSlot", err.Error()) + } + + req, err := client.AnalyzeCustomHostnameSlotPreparer(ctx, resourceGroupName, name, slot, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AnalyzeCustomHostnameSlot", nil, "Failure preparing request") + return + } + + resp, err := client.AnalyzeCustomHostnameSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "AnalyzeCustomHostnameSlot", resp, "Failure sending request") + return + } + + result, err = client.AnalyzeCustomHostnameSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "AnalyzeCustomHostnameSlot", resp, "Failure responding to request") + return + } + + return +} + +// AnalyzeCustomHostnameSlotPreparer prepares the AnalyzeCustomHostnameSlot request. +func (client AppsClient) AnalyzeCustomHostnameSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(hostName) > 0 { + queryParameters["hostName"] = autorest.Encode("query", hostName) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/analyzeCustomHostname", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// AnalyzeCustomHostnameSlotSender sends the AnalyzeCustomHostnameSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) AnalyzeCustomHostnameSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// AnalyzeCustomHostnameSlotResponder handles the response to the AnalyzeCustomHostnameSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) AnalyzeCustomHostnameSlotResponder(resp *http.Response) (result CustomHostnameAnalysisResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApplySlotConfigToProduction description for Applies the configuration settings from the target slot onto the current +// slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotSwapEntity - JSON object that contains the target slot name. See example. +func (client AppsClient) ApplySlotConfigToProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ApplySlotConfigToProduction") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: slotSwapEntity, + Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ApplySlotConfigToProduction", err.Error()) + } + + req, err := client.ApplySlotConfigToProductionPreparer(ctx, resourceGroupName, name, slotSwapEntity) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApplySlotConfigToProduction", nil, "Failure preparing request") + return + } + + resp, err := client.ApplySlotConfigToProductionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApplySlotConfigToProduction", resp, "Failure sending request") + return + } + + result, err = client.ApplySlotConfigToProductionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApplySlotConfigToProduction", resp, "Failure responding to request") + return + } + + return +} + +// ApplySlotConfigToProductionPreparer prepares the ApplySlotConfigToProduction request. +func (client AppsClient) ApplySlotConfigToProductionPreparer(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/applySlotConfig", pathParameters), + autorest.WithJSON(slotSwapEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplySlotConfigToProductionSender sends the ApplySlotConfigToProduction request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ApplySlotConfigToProductionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ApplySlotConfigToProductionResponder handles the response to the ApplySlotConfigToProduction request. The method always +// closes the http.Response Body. +func (client AppsClient) ApplySlotConfigToProductionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ApplySlotConfigurationSlot description for Applies the configuration settings from the target slot onto the current +// slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotSwapEntity - JSON object that contains the target slot name. See example. +// slot - name of the source slot. If a slot is not specified, the production slot is used as the source slot. +func (client AppsClient) ApplySlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ApplySlotConfigurationSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: slotSwapEntity, + Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ApplySlotConfigurationSlot", err.Error()) + } + + req, err := client.ApplySlotConfigurationSlotPreparer(ctx, resourceGroupName, name, slotSwapEntity, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApplySlotConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ApplySlotConfigurationSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApplySlotConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.ApplySlotConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApplySlotConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// ApplySlotConfigurationSlotPreparer prepares the ApplySlotConfigurationSlot request. +func (client AppsClient) ApplySlotConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/applySlotConfig", pathParameters), + autorest.WithJSON(slotSwapEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApplySlotConfigurationSlotSender sends the ApplySlotConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ApplySlotConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ApplySlotConfigurationSlotResponder handles the response to the ApplySlotConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ApplySlotConfigurationSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ApproveOrRejectPrivateEndpointConnection description for Approves or rejects a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (result AppsApproveOrRejectPrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ApproveOrRejectPrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ApproveOrRejectPrivateEndpointConnection", err.Error()) + } + + req, err := client.ApproveOrRejectPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApproveOrRejectPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.ApproveOrRejectPrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApproveOrRejectPrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// ApproveOrRejectPrivateEndpointConnectionPreparer prepares the ApproveOrRejectPrivateEndpointConnection request. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointWrapper), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApproveOrRejectPrivateEndpointConnectionSender sends the ApproveOrRejectPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionSender(req *http.Request) (future AppsApproveOrRejectPrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApproveOrRejectPrivateEndpointConnectionResponder handles the response to the ApproveOrRejectPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ApproveOrRejectPrivateEndpointConnectionSlot description for Approves or rejects a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, slot string) (result AppsApproveOrRejectPrivateEndpointConnectionSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ApproveOrRejectPrivateEndpointConnectionSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ApproveOrRejectPrivateEndpointConnectionSlot", err.Error()) + } + + req, err := client.ApproveOrRejectPrivateEndpointConnectionSlotPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApproveOrRejectPrivateEndpointConnectionSlot", nil, "Failure preparing request") + return + } + + result, err = client.ApproveOrRejectPrivateEndpointConnectionSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ApproveOrRejectPrivateEndpointConnectionSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// ApproveOrRejectPrivateEndpointConnectionSlotPreparer prepares the ApproveOrRejectPrivateEndpointConnectionSlot request. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointWrapper), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApproveOrRejectPrivateEndpointConnectionSlotSender sends the ApproveOrRejectPrivateEndpointConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionSlotSender(req *http.Request) (future AppsApproveOrRejectPrivateEndpointConnectionSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApproveOrRejectPrivateEndpointConnectionSlotResponder handles the response to the ApproveOrRejectPrivateEndpointConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ApproveOrRejectPrivateEndpointConnectionSlotResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Backup description for Creates a backup of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - backup configuration. You can use the JSON response from the POST action as input here. +func (client AppsClient) Backup(ctx context.Context, resourceGroupName string, name string, request BackupRequest) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Backup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Backup", err.Error()) + } + + req, err := client.BackupPreparer(ctx, resourceGroupName, name, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Backup", nil, "Failure preparing request") + return + } + + resp, err := client.BackupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "Backup", resp, "Failure sending request") + return + } + + result, err = client.BackupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Backup", resp, "Failure responding to request") + return + } + + return +} + +// BackupPreparer prepares the Backup request. +func (client AppsClient) BackupPreparer(ctx context.Context, resourceGroupName string, name string, request BackupRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backup", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupSender sends the Backup request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) BackupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// BackupResponder handles the response to the Backup request. The method always +// closes the http.Response Body. +func (client AppsClient) BackupResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// BackupSlot description for Creates a backup of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - backup configuration. You can use the JSON response from the POST action as input here. +// slot - name of the deployment slot. If a slot is not specified, the API will create a backup for the +// production slot. +func (client AppsClient) BackupSlot(ctx context.Context, resourceGroupName string, name string, request BackupRequest, slot string) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.BackupSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "BackupSlot", err.Error()) + } + + req, err := client.BackupSlotPreparer(ctx, resourceGroupName, name, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "BackupSlot", nil, "Failure preparing request") + return + } + + resp, err := client.BackupSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "BackupSlot", resp, "Failure sending request") + return + } + + result, err = client.BackupSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "BackupSlot", resp, "Failure responding to request") + return + } + + return +} + +// BackupSlotPreparer prepares the BackupSlot request. +func (client AppsClient) BackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backup", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// BackupSlotSender sends the BackupSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) BackupSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// BackupSlotResponder handles the response to the BackupSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) BackupSlotResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateDeployment description for Create a deployment for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - ID of an existing deployment. +// deployment - deployment details. +func (client AppsClient) CreateDeployment(ctx context.Context, resourceGroupName string, name string, ID string, deployment Deployment) (result Deployment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateDeployment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateDeployment", err.Error()) + } + + req, err := client.CreateDeploymentPreparer(ctx, resourceGroupName, name, ID, deployment) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateDeployment", nil, "Failure preparing request") + return + } + + resp, err := client.CreateDeploymentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateDeployment", resp, "Failure sending request") + return + } + + result, err = client.CreateDeploymentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateDeployment", resp, "Failure responding to request") + return + } + + return +} + +// CreateDeploymentPreparer prepares the CreateDeployment request. +func (client AppsClient) CreateDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string, deployment Deployment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), + autorest.WithJSON(deployment), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateDeploymentSender sends the CreateDeployment request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateDeploymentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateDeploymentResponder handles the response to the CreateDeployment request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateDeploymentResponder(resp *http.Response) (result Deployment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateDeploymentSlot description for Create a deployment for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - ID of an existing deployment. +// slot - name of the deployment slot. If a slot is not specified, the API creates a deployment for the +// production slot. +// deployment - deployment details. +func (client AppsClient) CreateDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string, deployment Deployment) (result Deployment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateDeploymentSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateDeploymentSlot", err.Error()) + } + + req, err := client.CreateDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot, deployment) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateDeploymentSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateDeploymentSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateDeploymentSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateDeploymentSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateDeploymentSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateDeploymentSlotPreparer prepares the CreateDeploymentSlot request. +func (client AppsClient) CreateDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string, deployment Deployment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), + autorest.WithJSON(deployment), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateDeploymentSlotSender sends the CreateDeploymentSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateDeploymentSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateDeploymentSlotResponder handles the response to the CreateDeploymentSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateFunction description for Create function for web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// functionEnvelope - function details. +func (client AppsClient) CreateFunction(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope FunctionEnvelope) (result AppsCreateFunctionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateFunction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateFunction", err.Error()) + } + + req, err := client.CreateFunctionPreparer(ctx, resourceGroupName, name, functionName, functionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateFunction", nil, "Failure preparing request") + return + } + + result, err = client.CreateFunctionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateFunction", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateFunctionPreparer prepares the CreateFunction request. +func (client AppsClient) CreateFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope FunctionEnvelope) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), + autorest.WithJSON(functionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateFunctionSender sends the CreateFunction request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateFunctionSender(req *http.Request) (future AppsCreateFunctionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateFunctionResponder handles the response to the CreateFunction request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateFunctionResponder(resp *http.Response) (result FunctionEnvelope, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateInstanceFunctionSlot description for Create function for web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +// functionEnvelope - function details. +func (client AppsClient) CreateInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope) (result AppsCreateInstanceFunctionSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateInstanceFunctionSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateInstanceFunctionSlot", err.Error()) + } + + req, err := client.CreateInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot, functionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateInstanceFunctionSlot", nil, "Failure preparing request") + return + } + + result, err = client.CreateInstanceFunctionSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateInstanceFunctionSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateInstanceFunctionSlotPreparer prepares the CreateInstanceFunctionSlot request. +func (client AppsClient) CreateInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope FunctionEnvelope) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), + autorest.WithJSON(functionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateInstanceFunctionSlotSender sends the CreateInstanceFunctionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateInstanceFunctionSlotSender(req *http.Request) (future AppsCreateInstanceFunctionSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateInstanceFunctionSlotResponder handles the response to the CreateInstanceFunctionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateInstanceFunctionSlotResponder(resp *http.Response) (result FunctionEnvelope, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateInstanceMSDeployOperation description for Invoke the MSDeploy web app extension. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// instanceID - ID of web app instance. +// mSDeploy - details of MSDeploy operation +func (client AppsClient) CreateInstanceMSDeployOperation(ctx context.Context, resourceGroupName string, name string, instanceID string, mSDeploy MSDeploy) (result AppsCreateInstanceMSDeployOperationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateInstanceMSDeployOperation") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateInstanceMSDeployOperation", err.Error()) + } + + req, err := client.CreateInstanceMSDeployOperationPreparer(ctx, resourceGroupName, name, instanceID, mSDeploy) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateInstanceMSDeployOperation", nil, "Failure preparing request") + return + } + + result, err = client.CreateInstanceMSDeployOperationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateInstanceMSDeployOperation", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateInstanceMSDeployOperationPreparer prepares the CreateInstanceMSDeployOperation request. +func (client AppsClient) CreateInstanceMSDeployOperationPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string, mSDeploy MSDeploy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithJSON(mSDeploy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateInstanceMSDeployOperationSender sends the CreateInstanceMSDeployOperation request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateInstanceMSDeployOperationSender(req *http.Request) (future AppsCreateInstanceMSDeployOperationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateInstanceMSDeployOperationResponder handles the response to the CreateInstanceMSDeployOperation request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateInstanceMSDeployOperationResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateInstanceMSDeployOperationSlot description for Invoke the MSDeploy web app extension. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// instanceID - ID of web app instance. +// mSDeploy - details of MSDeploy operation +func (client AppsClient) CreateInstanceMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, mSDeploy MSDeploy) (result AppsCreateInstanceMSDeployOperationSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateInstanceMSDeployOperationSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateInstanceMSDeployOperationSlot", err.Error()) + } + + req, err := client.CreateInstanceMSDeployOperationSlotPreparer(ctx, resourceGroupName, name, slot, instanceID, mSDeploy) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateInstanceMSDeployOperationSlot", nil, "Failure preparing request") + return + } + + result, err = client.CreateInstanceMSDeployOperationSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateInstanceMSDeployOperationSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateInstanceMSDeployOperationSlotPreparer prepares the CreateInstanceMSDeployOperationSlot request. +func (client AppsClient) CreateInstanceMSDeployOperationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, mSDeploy MSDeploy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithJSON(mSDeploy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateInstanceMSDeployOperationSlotSender sends the CreateInstanceMSDeployOperationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateInstanceMSDeployOperationSlotSender(req *http.Request) (future AppsCreateInstanceMSDeployOperationSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateInstanceMSDeployOperationSlotResponder handles the response to the CreateInstanceMSDeployOperationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateInstanceMSDeployOperationSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateMSDeployOperation description for Invoke the MSDeploy web app extension. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// mSDeploy - details of MSDeploy operation +func (client AppsClient) CreateMSDeployOperation(ctx context.Context, resourceGroupName string, name string, mSDeploy MSDeploy) (result AppsCreateMSDeployOperationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateMSDeployOperation") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateMSDeployOperation", err.Error()) + } + + req, err := client.CreateMSDeployOperationPreparer(ctx, resourceGroupName, name, mSDeploy) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateMSDeployOperation", nil, "Failure preparing request") + return + } + + result, err = client.CreateMSDeployOperationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateMSDeployOperation", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateMSDeployOperationPreparer prepares the CreateMSDeployOperation request. +func (client AppsClient) CreateMSDeployOperationPreparer(ctx context.Context, resourceGroupName string, name string, mSDeploy MSDeploy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy", pathParameters), + autorest.WithJSON(mSDeploy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateMSDeployOperationSender sends the CreateMSDeployOperation request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateMSDeployOperationSender(req *http.Request) (future AppsCreateMSDeployOperationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateMSDeployOperationResponder handles the response to the CreateMSDeployOperation request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateMSDeployOperationResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateMSDeployOperationSlot description for Invoke the MSDeploy web app extension. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// mSDeploy - details of MSDeploy operation +func (client AppsClient) CreateMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, mSDeploy MSDeploy) (result AppsCreateMSDeployOperationSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateMSDeployOperationSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateMSDeployOperationSlot", err.Error()) + } + + req, err := client.CreateMSDeployOperationSlotPreparer(ctx, resourceGroupName, name, slot, mSDeploy) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateMSDeployOperationSlot", nil, "Failure preparing request") + return + } + + result, err = client.CreateMSDeployOperationSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateMSDeployOperationSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateMSDeployOperationSlotPreparer prepares the CreateMSDeployOperationSlot request. +func (client AppsClient) CreateMSDeployOperationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, mSDeploy MSDeploy) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", pathParameters), + autorest.WithJSON(mSDeploy), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateMSDeployOperationSlotSender sends the CreateMSDeployOperationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateMSDeployOperationSlotSender(req *http.Request) (future AppsCreateMSDeployOperationSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateMSDeployOperationSlotResponder handles the response to the CreateMSDeployOperationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateMSDeployOperationSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate description for Creates a new web, mobile, or API app in an existing resource group, or updates an +// existing app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} +// parameter. +// siteEnvelope - a JSON representation of the app properties. See example. +func (client AppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site) (result AppsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteEnvelope, + Constraints: []validation.Constraint{{Target: "siteEnvelope.SiteProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.FunctionAppScaleLimit", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.FunctionAppScaleLimit", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.MinimumElasticInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "siteEnvelope.SiteProperties.CloningInfo", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.CloningInfo.SourceWebAppID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, siteEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), + autorest.WithJSON(siteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateSender(req *http.Request) (future AppsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateResponder(resp *http.Response) (result Site, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateConfiguration description for Updates the configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteConfig - JSON representation of a SiteConfig object. See example. +func (client AppsClient) CreateOrUpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteConfig, + Constraints: []validation.Constraint{{Target: "siteConfig.SiteConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "siteConfig.SiteConfig.FunctionAppScaleLimit", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.FunctionAppScaleLimit", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + {Target: "siteConfig.SiteConfig.MinimumElasticInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "siteConfig.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateConfiguration", err.Error()) + } + + req, err := client.CreateOrUpdateConfigurationPreparer(ctx, resourceGroupName, name, siteConfig) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateConfiguration", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateConfigurationPreparer prepares the CreateOrUpdateConfiguration request. +func (client AppsClient) CreateOrUpdateConfigurationPreparer(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters), + autorest.WithJSON(siteConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateConfigurationSender sends the CreateOrUpdateConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateConfigurationResponder handles the response to the CreateOrUpdateConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateConfigurationResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateConfigurationSlot description for Updates the configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteConfig - JSON representation of a SiteConfig object. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update configuration for the +// production slot. +func (client AppsClient) CreateOrUpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, slot string) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteConfig, + Constraints: []validation.Constraint{{Target: "siteConfig.SiteConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteConfig.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "siteConfig.SiteConfig.FunctionAppScaleLimit", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.FunctionAppScaleLimit", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + {Target: "siteConfig.SiteConfig.MinimumElasticInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteConfig.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "siteConfig.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateConfigurationSlot", err.Error()) + } + + req, err := client.CreateOrUpdateConfigurationSlotPreparer(ctx, resourceGroupName, name, siteConfig, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateConfigurationSlotPreparer prepares the CreateOrUpdateConfigurationSlot request. +func (client AppsClient) CreateOrUpdateConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters), + autorest.WithJSON(siteConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateConfigurationSlotSender sends the CreateOrUpdateConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateConfigurationSlotResponder handles the response to the CreateOrUpdateConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateConfigurationSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateDomainOwnershipIdentifier description for Creates a domain ownership identifier for web app, or +// updates an existing ownership identifier. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// domainOwnershipIdentifier - a JSON representation of the domain ownership properties. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (result Identifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateDomainOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifier", err.Error()) + } + + req, err := client.CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateDomainOwnershipIdentifierSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateDomainOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateDomainOwnershipIdentifierPreparer prepares the CreateOrUpdateDomainOwnershipIdentifier request. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithJSON(domainOwnershipIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateDomainOwnershipIdentifierSender sends the CreateOrUpdateDomainOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateDomainOwnershipIdentifierResponder handles the response to the CreateOrUpdateDomainOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierResponder(resp *http.Response) (result Identifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateDomainOwnershipIdentifierSlot description for Creates a domain ownership identifier for web app, or +// updates an existing ownership identifier. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// domainOwnershipIdentifier - a JSON representation of the domain ownership properties. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (result Identifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateDomainOwnershipIdentifierSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifierSlot", err.Error()) + } + + req, err := client.CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifierSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateDomainOwnershipIdentifierSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifierSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateDomainOwnershipIdentifierSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateDomainOwnershipIdentifierSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateDomainOwnershipIdentifierSlotPreparer prepares the CreateOrUpdateDomainOwnershipIdentifierSlot request. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithJSON(domainOwnershipIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateDomainOwnershipIdentifierSlotSender sends the CreateOrUpdateDomainOwnershipIdentifierSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateDomainOwnershipIdentifierSlotResponder handles the response to the CreateOrUpdateDomainOwnershipIdentifierSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result Identifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateFunctionSecret description for Add or update a function secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - the name of the function. +// keyName - the name of the key. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key KeyInfo) (result KeyInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateFunctionSecret") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateFunctionSecret", err.Error()) + } + + req, err := client.CreateOrUpdateFunctionSecretPreparer(ctx, resourceGroupName, name, functionName, keyName, key) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecret", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateFunctionSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecret", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateFunctionSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecret", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateFunctionSecretPreparer prepares the CreateOrUpdateFunctionSecret request. +func (client AppsClient) CreateOrUpdateFunctionSecretPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key KeyInfo) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}", pathParameters), + autorest.WithJSON(key), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateFunctionSecretSender sends the CreateOrUpdateFunctionSecret request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateFunctionSecretSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateFunctionSecretResponder handles the response to the CreateOrUpdateFunctionSecret request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateFunctionSecretResponder(resp *http.Response) (result KeyInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateFunctionSecretSlot description for Add or update a function secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - the name of the function. +// keyName - the name of the key. +// slot - name of the deployment slot. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key KeyInfo) (result KeyInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateFunctionSecretSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateFunctionSecretSlot", err.Error()) + } + + req, err := client.CreateOrUpdateFunctionSecretSlotPreparer(ctx, resourceGroupName, name, functionName, keyName, slot, key) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecretSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateFunctionSecretSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecretSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateFunctionSecretSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateFunctionSecretSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateFunctionSecretSlotPreparer prepares the CreateOrUpdateFunctionSecretSlot request. +func (client AppsClient) CreateOrUpdateFunctionSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key KeyInfo) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}", pathParameters), + autorest.WithJSON(key), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateFunctionSecretSlotSender sends the CreateOrUpdateFunctionSecretSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateFunctionSecretSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateFunctionSecretSlotResponder handles the response to the CreateOrUpdateFunctionSecretSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateFunctionSecretSlotResponder(resp *http.Response) (result KeyInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateHostNameBinding description for Creates a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// hostName - hostname in the hostname binding. +// hostNameBinding - binding details. This is the JSON representation of a HostNameBinding object. +func (client AppsClient) CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (result HostNameBinding, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostNameBinding") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBinding", err.Error()) + } + + req, err := client.CreateOrUpdateHostNameBindingPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateHostNameBindingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateHostNameBindingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBinding", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateHostNameBindingPreparer prepares the CreateOrUpdateHostNameBinding request. +func (client AppsClient) CreateOrUpdateHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), + autorest.WithJSON(hostNameBinding), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateHostNameBindingSender sends the CreateOrUpdateHostNameBinding request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateHostNameBindingSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateHostNameBindingResponder handles the response to the CreateOrUpdateHostNameBinding request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateHostNameBindingResponder(resp *http.Response) (result HostNameBinding, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateHostNameBindingSlot description for Creates a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// hostName - hostname in the hostname binding. +// hostNameBinding - binding details. This is the JSON representation of a HostNameBinding object. +// slot - name of the deployment slot. If a slot is not specified, the API will create a binding for the +// production slot. +func (client AppsClient) CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (result HostNameBinding, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostNameBindingSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostNameBindingSlot", err.Error()) + } + + req, err := client.CreateOrUpdateHostNameBindingSlotPreparer(ctx, resourceGroupName, name, hostName, hostNameBinding, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateHostNameBindingSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateHostNameBindingSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostNameBindingSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateHostNameBindingSlotPreparer prepares the CreateOrUpdateHostNameBindingSlot request. +func (client AppsClient) CreateOrUpdateHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding HostNameBinding, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), + autorest.WithJSON(hostNameBinding), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateHostNameBindingSlotSender sends the CreateOrUpdateHostNameBindingSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateHostNameBindingSlotResponder handles the response to the CreateOrUpdateHostNameBindingSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateHostNameBindingSlotResponder(resp *http.Response) (result HostNameBinding, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateHostSecret description for Add or update a host level secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key KeyInfo) (result KeyInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostSecret") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostSecret", err.Error()) + } + + req, err := client.CreateOrUpdateHostSecretPreparer(ctx, resourceGroupName, name, keyType, keyName, key) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecret", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateHostSecretSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecret", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateHostSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecret", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateHostSecretPreparer prepares the CreateOrUpdateHostSecret request. +func (client AppsClient) CreateOrUpdateHostSecretPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key KeyInfo) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}", pathParameters), + autorest.WithJSON(key), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateHostSecretSender sends the CreateOrUpdateHostSecret request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateHostSecretSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateHostSecretResponder handles the response to the CreateOrUpdateHostSecret request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateHostSecretResponder(resp *http.Response) (result KeyInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateHostSecretSlot description for Add or update a host level secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +// slot - name of the deployment slot. +// key - the key to create or update +func (client AppsClient) CreateOrUpdateHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key KeyInfo) (result KeyInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHostSecretSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHostSecretSlot", err.Error()) + } + + req, err := client.CreateOrUpdateHostSecretSlotPreparer(ctx, resourceGroupName, name, keyType, keyName, slot, key) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecretSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateHostSecretSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecretSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateHostSecretSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHostSecretSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateHostSecretSlotPreparer prepares the CreateOrUpdateHostSecretSlot request. +func (client AppsClient) CreateOrUpdateHostSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key KeyInfo) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}", pathParameters), + autorest.WithJSON(key), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateHostSecretSlotSender sends the CreateOrUpdateHostSecretSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateHostSecretSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateHostSecretSlotResponder handles the response to the CreateOrUpdateHostSecretSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateHostSecretSlotResponder(resp *http.Response) (result KeyInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateHybridConnection description for Creates a new Hybrid Connection using a Service Bus relay. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// connectionEnvelope - the details of the hybrid connection. +func (client AppsClient) CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHybridConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnection", err.Error()) + } + + req, err := client.CreateOrUpdateHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateHybridConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnection", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateHybridConnectionPreparer prepares the CreateOrUpdateHybridConnection request. +func (client AppsClient) CreateOrUpdateHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateHybridConnectionSender sends the CreateOrUpdateHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateHybridConnectionResponder handles the response to the CreateOrUpdateHybridConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateHybridConnectionSlot description for Creates a new Hybrid Connection using a Service Bus relay. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// connectionEnvelope - the details of the hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateHybridConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateHybridConnectionSlot", err.Error()) + } + + req, err := client.CreateOrUpdateHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateHybridConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateHybridConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateHybridConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateHybridConnectionSlotPreparer prepares the CreateOrUpdateHybridConnectionSlot request. +func (client AppsClient) CreateOrUpdateHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateHybridConnectionSlotSender sends the CreateOrUpdateHybridConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateHybridConnectionSlotResponder handles the response to the CreateOrUpdateHybridConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdatePublicCertificate description for Creates a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// publicCertificateName - public certificate name. +// publicCertificate - public certificate details. This is the JSON representation of a PublicCertificate +// object. +func (client AppsClient) CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (result PublicCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdatePublicCertificate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificate", err.Error()) + } + + req, err := client.CreateOrUpdatePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdatePublicCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdatePublicCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePublicCertificatePreparer prepares the CreateOrUpdatePublicCertificate request. +func (client AppsClient) CreateOrUpdatePublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithJSON(publicCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdatePublicCertificateSender sends the CreateOrUpdatePublicCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdatePublicCertificateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdatePublicCertificateResponder handles the response to the CreateOrUpdatePublicCertificate request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdatePublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdatePublicCertificateSlot description for Creates a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// publicCertificateName - public certificate name. +// publicCertificate - public certificate details. This is the JSON representation of a PublicCertificate +// object. +// slot - name of the deployment slot. If a slot is not specified, the API will create a binding for the +// production slot. +func (client AppsClient) CreateOrUpdatePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (result PublicCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdatePublicCertificateSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdatePublicCertificateSlot", err.Error()) + } + + req, err := client.CreateOrUpdatePublicCertificateSlotPreparer(ctx, resourceGroupName, name, publicCertificateName, publicCertificate, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdatePublicCertificateSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdatePublicCertificateSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdatePublicCertificateSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePublicCertificateSlotPreparer prepares the CreateOrUpdatePublicCertificateSlot request. +func (client AppsClient) CreateOrUpdatePublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate PublicCertificate, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithJSON(publicCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdatePublicCertificateSlotSender sends the CreateOrUpdatePublicCertificateSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdatePublicCertificateSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdatePublicCertificateSlotResponder handles the response to the CreateOrUpdatePublicCertificateSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdatePublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateRelayServiceConnection description for Creates a new hybrid connection configuration (PUT), or updates +// an existing one (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection configuration. +// connectionEnvelope - details of the hybrid connection configuration. +func (client AppsClient) CreateOrUpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateRelayServiceConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnection", err.Error()) + } + + req, err := client.CreateOrUpdateRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateRelayServiceConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateRelayServiceConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnection", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateRelayServiceConnectionPreparer prepares the CreateOrUpdateRelayServiceConnection request. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateRelayServiceConnectionSender sends the CreateOrUpdateRelayServiceConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateRelayServiceConnectionResponder handles the response to the CreateOrUpdateRelayServiceConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateRelayServiceConnectionSlot description for Creates a new hybrid connection configuration (PUT), or +// updates an existing one (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection configuration. +// connectionEnvelope - details of the hybrid connection configuration. +// slot - name of the deployment slot. If a slot is not specified, the API will create or update a hybrid +// connection for the production slot. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateRelayServiceConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", err.Error()) + } + + req, err := client.CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateRelayServiceConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateRelayServiceConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateRelayServiceConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateRelayServiceConnectionSlotPreparer prepares the CreateOrUpdateRelayServiceConnectionSlot request. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateRelayServiceConnectionSlotSender sends the CreateOrUpdateRelayServiceConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateRelayServiceConnectionSlotResponder handles the response to the CreateOrUpdateRelayServiceConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSlot description for Creates a new web, mobile, or API app in an existing resource group, or updates +// an existing app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} +// parameter. +// siteEnvelope - a JSON representation of the app properties. See example. +// slot - name of the deployment slot to create or update. By default, this API attempts to create or modify +// the production slot. +func (client AppsClient) CreateOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string) (result AppsCreateOrUpdateSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteEnvelope, + Constraints: []validation.Constraint{{Target: "siteEnvelope.SiteProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.Push.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(10), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.PreWarmedInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.FunctionAppScaleLimit", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.FunctionAppScaleLimit", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}}}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.MinimumElasticInstanceCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMaximum, Rule: int64(20), Chain: nil}, + {Target: "siteEnvelope.SiteProperties.SiteConfig.MinimumElasticInstanceCount", Name: validation.InclusiveMinimum, Rule: int64(0), Chain: nil}, + }}, + }}, + {Target: "siteEnvelope.SiteProperties.CloningInfo", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteEnvelope.SiteProperties.CloningInfo.SourceWebAppID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSlot", err.Error()) + } + + req, err := client.CreateOrUpdateSlotPreparer(ctx, resourceGroupName, name, siteEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSlot", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateSlotPreparer prepares the CreateOrUpdateSlot request. +func (client AppsClient) CreateOrUpdateSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope Site, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithJSON(siteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSlotSender sends the CreateOrUpdateSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateSlotSender(req *http.Request) (future AppsCreateOrUpdateSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateSlotResponder handles the response to the CreateOrUpdateSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateSlotResponder(resp *http.Response) (result Site, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSourceControl description for Updates the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteSourceControl - JSON representation of a SiteSourceControl object. See example. +func (client AppsClient) CreateOrUpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result AppsCreateOrUpdateSourceControlFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSourceControl") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControl", err.Error()) + } + + req, err := client.CreateOrUpdateSourceControlPreparer(ctx, resourceGroupName, name, siteSourceControl) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControl", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSourceControlSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControl", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateSourceControlPreparer prepares the CreateOrUpdateSourceControl request. +func (client AppsClient) CreateOrUpdateSourceControlPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithJSON(siteSourceControl), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSourceControlSender sends the CreateOrUpdateSourceControl request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateSourceControlSender(req *http.Request) (future AppsCreateOrUpdateSourceControlFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateSourceControlResponder handles the response to the CreateOrUpdateSourceControl request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSourceControlSlot description for Updates the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteSourceControl - JSON representation of a SiteSourceControl object. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update the source control +// configuration for the production slot. +func (client AppsClient) CreateOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result AppsCreateOrUpdateSourceControlSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSourceControlSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSourceControlSlot", err.Error()) + } + + req, err := client.CreateOrUpdateSourceControlSlotPreparer(ctx, resourceGroupName, name, siteSourceControl, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSourceControlSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSourceControlSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateSourceControlSlotPreparer prepares the CreateOrUpdateSourceControlSlot request. +func (client AppsClient) CreateOrUpdateSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithJSON(siteSourceControl), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSourceControlSlotSender sends the CreateOrUpdateSourceControlSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateSourceControlSlotSender(req *http.Request) (future AppsCreateOrUpdateSourceControlSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateSourceControlSlotResponder handles the response to the CreateOrUpdateSourceControlSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck description for Integrates this Web App with a Virtual Network. +// This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet +// has already been delegated, and is not +// in use by another App Service Plan other than the one this App is in. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// connectionEnvelope - properties of the Virtual Network connection. See example. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (result SwiftVirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck", err.Error()) + } + + req, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckPreparer(ctx, resourceGroupName, name, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckPreparer prepares the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck request. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSender sends the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponder handles the response to the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot description for Integrates this Web App with a Virtual +// Network. This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the +// target Subnet has already been delegated, and is not +// in use by another App Service Plan other than the one this App is in. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// connectionEnvelope - properties of the Virtual Network connection. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for +// the production slot. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (result SwiftVirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot", err.Error()) + } + + req, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotPreparer(ctx, resourceGroupName, name, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotPreparer prepares the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot request. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotSender sends the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponder handles the response to the CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateVnetConnection description for Adds a Virtual Network connection to an app or slot (PUT) or updates +// the connection properties (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of an existing Virtual Network. +// connectionEnvelope - properties of the Virtual Network connection. See example. +func (client AppsClient) CreateOrUpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnection", err.Error()) + } + + req, err := client.CreateOrUpdateVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateVnetConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateVnetConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnection", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateVnetConnectionPreparer prepares the CreateOrUpdateVnetConnection request. +func (client AppsClient) CreateOrUpdateVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateVnetConnectionSender sends the CreateOrUpdateVnetConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateVnetConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateVnetConnectionResponder handles the response to the CreateOrUpdateVnetConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateVnetConnectionResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateVnetConnectionGateway description for Adds a gateway to a connected Virtual Network (PUT) or updates +// it (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// connectionEnvelope - the properties to update this gateway with. +func (client AppsClient) CreateOrUpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionGateway") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: connectionEnvelope, + Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGateway", err.Error()) + } + + req, err := client.CreateOrUpdateVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateVnetConnectionGatewaySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateVnetConnectionGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGateway", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateVnetConnectionGatewayPreparer prepares the CreateOrUpdateVnetConnectionGateway request. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateVnetConnectionGatewaySender sends the CreateOrUpdateVnetConnectionGateway request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateVnetConnectionGatewayResponder handles the response to the CreateOrUpdateVnetConnectionGateway request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateVnetConnectionGatewaySlot description for Adds a gateway to a connected Virtual Network (PUT) or +// updates it (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// connectionEnvelope - the properties to update this gateway with. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the +// production slot's Virtual Network. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionGatewaySlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: connectionEnvelope, + Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", err.Error()) + } + + req, err := client.CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateVnetConnectionGatewaySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateVnetConnectionGatewaySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionGatewaySlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateVnetConnectionGatewaySlotPreparer prepares the CreateOrUpdateVnetConnectionGatewaySlot request. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateVnetConnectionGatewaySlotSender sends the CreateOrUpdateVnetConnectionGatewaySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateVnetConnectionGatewaySlotResponder handles the response to the CreateOrUpdateVnetConnectionGatewaySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateVnetConnectionSlot description for Adds a Virtual Network connection to an app or slot (PUT) or +// updates the connection properties (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of an existing Virtual Network. +// connectionEnvelope - properties of the Virtual Network connection. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for +// the production slot. +func (client AppsClient) CreateOrUpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, slot string) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.CreateOrUpdateVnetConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "CreateOrUpdateVnetConnectionSlot", err.Error()) + } + + req, err := client.CreateOrUpdateVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateVnetConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateVnetConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "CreateOrUpdateVnetConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateVnetConnectionSlotPreparer prepares the CreateOrUpdateVnetConnectionSlot request. +func (client AppsClient) CreateOrUpdateVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateVnetConnectionSlotSender sends the CreateOrUpdateVnetConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) CreateOrUpdateVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateVnetConnectionSlotResponder handles the response to the CreateOrUpdateVnetConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) CreateOrUpdateVnetConnectionSlotResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Deletes a web, mobile, or API app, or one of the deployment slots. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app to delete. +// deleteMetrics - if true, web app metrics are also deleted. +// deleteEmptyServerFarm - specify false if you want to keep empty App Service plan. By default, empty App +// Service plan is deleted. +func (client AppsClient) Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name, deleteMetrics, deleteEmptyServerFarm) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if deleteMetrics != nil { + queryParameters["deleteMetrics"] = autorest.Encode("query", *deleteMetrics) + } + if deleteEmptyServerFarm != nil { + queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteBackup description for Deletes a backup of an app by its ID. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// backupID - ID of the backup. +func (client AppsClient) DeleteBackup(ctx context.Context, resourceGroupName string, name string, backupID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackup") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteBackup", err.Error()) + } + + req, err := client.DeleteBackupPreparer(ctx, resourceGroupName, name, backupID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteBackupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", resp, "Failure sending request") + return + } + + result, err = client.DeleteBackupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackup", resp, "Failure responding to request") + return + } + + return +} + +// DeleteBackupPreparer prepares the DeleteBackup request. +func (client AppsClient) DeleteBackupPreparer(ctx context.Context, resourceGroupName string, name string, backupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteBackupSender sends the DeleteBackup request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteBackupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteBackupResponder handles the response to the DeleteBackup request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteBackupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteBackupConfiguration description for Deletes the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) DeleteBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupConfiguration") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteBackupConfiguration", err.Error()) + } + + req, err := client.DeleteBackupConfigurationPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteBackupConfigurationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", resp, "Failure sending request") + return + } + + result, err = client.DeleteBackupConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// DeleteBackupConfigurationPreparer prepares the DeleteBackupConfiguration request. +func (client AppsClient) DeleteBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteBackupConfigurationSender sends the DeleteBackupConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteBackupConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteBackupConfigurationResponder handles the response to the DeleteBackupConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteBackupConfigurationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteBackupConfigurationSlot description for Deletes the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the backup configuration +// for the production slot. +func (client AppsClient) DeleteBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupConfigurationSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteBackupConfigurationSlot", err.Error()) + } + + req, err := client.DeleteBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteBackupConfigurationSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteBackupConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteBackupConfigurationSlotPreparer prepares the DeleteBackupConfigurationSlot request. +func (client AppsClient) DeleteBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteBackupConfigurationSlotSender sends the DeleteBackupConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteBackupConfigurationSlotResponder handles the response to the DeleteBackupConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteBackupConfigurationSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteBackupSlot description for Deletes a backup of an app by its ID. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// backupID - ID of the backup. +// slot - name of the deployment slot. If a slot is not specified, the API will delete a backup of the +// production slot. +func (client AppsClient) DeleteBackupSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteBackupSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteBackupSlot", err.Error()) + } + + req, err := client.DeleteBackupSlotPreparer(ctx, resourceGroupName, name, backupID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteBackupSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteBackupSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteBackupSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteBackupSlotPreparer prepares the DeleteBackupSlot request. +func (client AppsClient) DeleteBackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteBackupSlotSender sends the DeleteBackupSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteBackupSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteBackupSlotResponder handles the response to the DeleteBackupSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteBackupSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteContinuousWebJob description for Delete a continuous web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) DeleteContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteContinuousWebJob") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJob", err.Error()) + } + + req, err := client.DeleteContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteContinuousWebJobSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", resp, "Failure sending request") + return + } + + result, err = client.DeleteContinuousWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJob", resp, "Failure responding to request") + return + } + + return +} + +// DeleteContinuousWebJobPreparer prepares the DeleteContinuousWebJob request. +func (client AppsClient) DeleteContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteContinuousWebJobSender sends the DeleteContinuousWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteContinuousWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteContinuousWebJobResponder handles the response to the DeleteContinuousWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteContinuousWebJobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteContinuousWebJobSlot description for Delete a continuous web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) DeleteContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteContinuousWebJobSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteContinuousWebJobSlot", err.Error()) + } + + req, err := client.DeleteContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteContinuousWebJobSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteContinuousWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteContinuousWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteContinuousWebJobSlotPreparer prepares the DeleteContinuousWebJobSlot request. +func (client AppsClient) DeleteContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteContinuousWebJobSlotSender sends the DeleteContinuousWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteContinuousWebJobSlotResponder handles the response to the DeleteContinuousWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteContinuousWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteDeployment description for Delete a deployment by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - deployment ID. +func (client AppsClient) DeleteDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDeployment") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteDeployment", err.Error()) + } + + req, err := client.DeleteDeploymentPreparer(ctx, resourceGroupName, name, ID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteDeploymentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", resp, "Failure sending request") + return + } + + result, err = client.DeleteDeploymentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeployment", resp, "Failure responding to request") + return + } + + return +} + +// DeleteDeploymentPreparer prepares the DeleteDeployment request. +func (client AppsClient) DeleteDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteDeploymentSender sends the DeleteDeployment request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteDeploymentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteDeploymentResponder handles the response to the DeleteDeployment request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteDeploymentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteDeploymentSlot description for Delete a deployment by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - deployment ID. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) DeleteDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDeploymentSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteDeploymentSlot", err.Error()) + } + + req, err := client.DeleteDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteDeploymentSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteDeploymentSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDeploymentSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteDeploymentSlotPreparer prepares the DeleteDeploymentSlot request. +func (client AppsClient) DeleteDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteDeploymentSlotSender sends the DeleteDeploymentSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteDeploymentSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteDeploymentSlotResponder handles the response to the DeleteDeploymentSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteDeploymentSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteDomainOwnershipIdentifier description for Deletes a domain ownership identifier for a web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +func (client AppsClient) DeleteDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDomainOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifier", err.Error()) + } + + req, err := client.DeleteDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteDomainOwnershipIdentifierSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.DeleteDomainOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// DeleteDomainOwnershipIdentifierPreparer prepares the DeleteDomainOwnershipIdentifier request. +func (client AppsClient) DeleteDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteDomainOwnershipIdentifierSender sends the DeleteDomainOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteDomainOwnershipIdentifierResponder handles the response to the DeleteDomainOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteDomainOwnershipIdentifierResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteDomainOwnershipIdentifierSlot description for Deletes a domain ownership identifier for a web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteDomainOwnershipIdentifierSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", err.Error()) + } + + req, err := client.DeleteDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteDomainOwnershipIdentifierSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteDomainOwnershipIdentifierSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteDomainOwnershipIdentifierSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteDomainOwnershipIdentifierSlotPreparer prepares the DeleteDomainOwnershipIdentifierSlot request. +func (client AppsClient) DeleteDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteDomainOwnershipIdentifierSlotSender sends the DeleteDomainOwnershipIdentifierSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteDomainOwnershipIdentifierSlotResponder handles the response to the DeleteDomainOwnershipIdentifierSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteFunction description for Delete a function for web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +func (client AppsClient) DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunction") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteFunction", err.Error()) + } + + req, err := client.DeleteFunctionPreparer(ctx, resourceGroupName, name, functionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteFunctionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", resp, "Failure sending request") + return + } + + result, err = client.DeleteFunctionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunction", resp, "Failure responding to request") + return + } + + return +} + +// DeleteFunctionPreparer prepares the DeleteFunction request. +func (client AppsClient) DeleteFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteFunctionSender sends the DeleteFunction request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteFunctionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteFunctionResponder handles the response to the DeleteFunction request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteFunctionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteFunctionSecret description for Delete a function secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - the name of the function. +// keyName - the name of the key. +func (client AppsClient) DeleteFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunctionSecret") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteFunctionSecret", err.Error()) + } + + req, err := client.DeleteFunctionSecretPreparer(ctx, resourceGroupName, name, functionName, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecret", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteFunctionSecretSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecret", resp, "Failure sending request") + return + } + + result, err = client.DeleteFunctionSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecret", resp, "Failure responding to request") + return + } + + return +} + +// DeleteFunctionSecretPreparer prepares the DeleteFunctionSecret request. +func (client AppsClient) DeleteFunctionSecretPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/keys/{keyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteFunctionSecretSender sends the DeleteFunctionSecret request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteFunctionSecretSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteFunctionSecretResponder handles the response to the DeleteFunctionSecret request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteFunctionSecretResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteFunctionSecretSlot description for Delete a function secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - the name of the function. +// keyName - the name of the key. +// slot - name of the deployment slot. +func (client AppsClient) DeleteFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteFunctionSecretSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteFunctionSecretSlot", err.Error()) + } + + req, err := client.DeleteFunctionSecretSlotPreparer(ctx, resourceGroupName, name, functionName, keyName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecretSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteFunctionSecretSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecretSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteFunctionSecretSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteFunctionSecretSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteFunctionSecretSlotPreparer prepares the DeleteFunctionSecretSlot request. +func (client AppsClient) DeleteFunctionSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "keyName": autorest.Encode("path", keyName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/keys/{keyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteFunctionSecretSlotSender sends the DeleteFunctionSecretSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteFunctionSecretSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteFunctionSecretSlotResponder handles the response to the DeleteFunctionSecretSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteFunctionSecretSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHostNameBinding description for Deletes a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// hostName - hostname in the hostname binding. +func (client AppsClient) DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostNameBinding") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteHostNameBinding", err.Error()) + } + + req, err := client.DeleteHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHostNameBindingSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", resp, "Failure sending request") + return + } + + result, err = client.DeleteHostNameBindingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBinding", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHostNameBindingPreparer prepares the DeleteHostNameBinding request. +func (client AppsClient) DeleteHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHostNameBindingSender sends the DeleteHostNameBinding request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteHostNameBindingSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHostNameBindingResponder handles the response to the DeleteHostNameBinding request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteHostNameBindingResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHostNameBindingSlot description for Deletes a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +// hostName - hostname in the hostname binding. +func (client AppsClient) DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostNameBindingSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteHostNameBindingSlot", err.Error()) + } + + req, err := client.DeleteHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHostNameBindingSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteHostNameBindingSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostNameBindingSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHostNameBindingSlotPreparer prepares the DeleteHostNameBindingSlot request. +func (client AppsClient) DeleteHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHostNameBindingSlotSender sends the DeleteHostNameBindingSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHostNameBindingSlotResponder handles the response to the DeleteHostNameBindingSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteHostNameBindingSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHostSecret description for Delete a host level secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +func (client AppsClient) DeleteHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostSecret") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteHostSecret", err.Error()) + } + + req, err := client.DeleteHostSecretPreparer(ctx, resourceGroupName, name, keyType, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecret", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHostSecretSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecret", resp, "Failure sending request") + return + } + + result, err = client.DeleteHostSecretResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecret", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHostSecretPreparer prepares the DeleteHostSecret request. +func (client AppsClient) DeleteHostSecretPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/{keyType}/{keyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHostSecretSender sends the DeleteHostSecret request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteHostSecretSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHostSecretResponder handles the response to the DeleteHostSecret request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteHostSecretResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHostSecretSlot description for Delete a host level secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// keyType - the type of host key. +// keyName - the name of the key. +// slot - name of the deployment slot. +func (client AppsClient) DeleteHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHostSecretSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteHostSecretSlot", err.Error()) + } + + req, err := client.DeleteHostSecretSlotPreparer(ctx, resourceGroupName, name, keyType, keyName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecretSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHostSecretSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecretSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteHostSecretSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHostSecretSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHostSecretSlotPreparer prepares the DeleteHostSecretSlot request. +func (client AppsClient) DeleteHostSecretSlotPreparer(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "keyType": autorest.Encode("path", keyType), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/{keyType}/{keyName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHostSecretSlotSender sends the DeleteHostSecretSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteHostSecretSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHostSecretSlotResponder handles the response to the DeleteHostSecretSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteHostSecretSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHybridConnection description for Removes a Hybrid Connection from this site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +func (client AppsClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHybridConnection") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteHybridConnection", err.Error()) + } + + req, err := client.DeleteHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHybridConnectionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", resp, "Failure sending request") + return + } + + result, err = client.DeleteHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnection", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHybridConnectionPreparer prepares the DeleteHybridConnection request. +func (client AppsClient) DeleteHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHybridConnectionSender sends the DeleteHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHybridConnectionResponder handles the response to the DeleteHybridConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteHybridConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHybridConnectionSlot description for Removes a Hybrid Connection from this site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteHybridConnectionSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteHybridConnectionSlot", err.Error()) + } + + req, err := client.DeleteHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHybridConnectionSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteHybridConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteHybridConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHybridConnectionSlotPreparer prepares the DeleteHybridConnectionSlot request. +func (client AppsClient) DeleteHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHybridConnectionSlotSender sends the DeleteHybridConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHybridConnectionSlotResponder handles the response to the DeleteHybridConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteHybridConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteInstanceFunctionSlot description for Delete a function for web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceFunctionSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteInstanceFunctionSlot", err.Error()) + } + + req, err := client.DeleteInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteInstanceFunctionSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteInstanceFunctionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceFunctionSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteInstanceFunctionSlotPreparer prepares the DeleteInstanceFunctionSlot request. +func (client AppsClient) DeleteInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteInstanceFunctionSlotSender sends the DeleteInstanceFunctionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteInstanceFunctionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteInstanceFunctionSlotResponder handles the response to the DeleteInstanceFunctionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteInstanceFunctionSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteInstanceProcess description for Terminate a process by its ID for a web site, or a deployment slot, or +// specific scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) DeleteInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceProcess") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteInstanceProcess", err.Error()) + } + + req, err := client.DeleteInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteInstanceProcessSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", resp, "Failure sending request") + return + } + + result, err = client.DeleteInstanceProcessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcess", resp, "Failure responding to request") + return + } + + return +} + +// DeleteInstanceProcessPreparer prepares the DeleteInstanceProcess request. +func (client AppsClient) DeleteInstanceProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteInstanceProcessSender sends the DeleteInstanceProcess request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteInstanceProcessSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteInstanceProcessResponder handles the response to the DeleteInstanceProcess request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteInstanceProcessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteInstanceProcessSlot description for Terminate a process by its ID for a web site, or a deployment slot, or +// specific scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteInstanceProcessSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteInstanceProcessSlot", err.Error()) + } + + req, err := client.DeleteInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteInstanceProcessSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteInstanceProcessSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteInstanceProcessSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteInstanceProcessSlotPreparer prepares the DeleteInstanceProcessSlot request. +func (client AppsClient) DeleteInstanceProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteInstanceProcessSlotSender sends the DeleteInstanceProcessSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteInstanceProcessSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteInstanceProcessSlotResponder handles the response to the DeleteInstanceProcessSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteInstanceProcessSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePremierAddOn description for Delete a premier add-on from an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +func (client AppsClient) DeletePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePremierAddOn") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePremierAddOn", err.Error()) + } + + req, err := client.DeletePremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", nil, "Failure preparing request") + return + } + + resp, err := client.DeletePremierAddOnSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", resp, "Failure sending request") + return + } + + result, err = client.DeletePremierAddOnResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOn", resp, "Failure responding to request") + return + } + + return +} + +// DeletePremierAddOnPreparer prepares the DeletePremierAddOn request. +func (client AppsClient) DeletePremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePremierAddOnSender sends the DeletePremierAddOn request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePremierAddOnSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeletePremierAddOnResponder handles the response to the DeletePremierAddOn request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePremierAddOnResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePremierAddOnSlot description for Delete a premier add-on from an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the named add-on for the +// production slot. +func (client AppsClient) DeletePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePremierAddOnSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePremierAddOnSlot", err.Error()) + } + + req, err := client.DeletePremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeletePremierAddOnSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", resp, "Failure sending request") + return + } + + result, err = client.DeletePremierAddOnSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePremierAddOnSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeletePremierAddOnSlotPreparer prepares the DeletePremierAddOnSlot request. +func (client AppsClient) DeletePremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePremierAddOnSlotSender sends the DeletePremierAddOnSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePremierAddOnSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeletePremierAddOnSlotResponder handles the response to the DeletePremierAddOnSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePremierAddOnSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePrivateEndpointConnection description for Deletes a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result AppsDeletePrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePrivateEndpointConnection", err.Error()) + } + + req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.DeletePrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. +func (client AppsClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future AppsDeletePrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeletePrivateEndpointConnectionSlot description for Deletes a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) DeletePrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string) (result AppsDeletePrivateEndpointConnectionSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePrivateEndpointConnectionSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePrivateEndpointConnectionSlot", err.Error()) + } + + req, err := client.DeletePrivateEndpointConnectionSlotPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePrivateEndpointConnectionSlot", nil, "Failure preparing request") + return + } + + result, err = client.DeletePrivateEndpointConnectionSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePrivateEndpointConnectionSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePrivateEndpointConnectionSlotPreparer prepares the DeletePrivateEndpointConnectionSlot request. +func (client AppsClient) DeletePrivateEndpointConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePrivateEndpointConnectionSlotSender sends the DeletePrivateEndpointConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePrivateEndpointConnectionSlotSender(req *http.Request) (future AppsDeletePrivateEndpointConnectionSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeletePrivateEndpointConnectionSlotResponder handles the response to the DeletePrivateEndpointConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePrivateEndpointConnectionSlotResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteProcess description for Terminate a process by its ID for a web site, or a deployment slot, or specific +// scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +func (client AppsClient) DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteProcess") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteProcess", err.Error()) + } + + req, err := client.DeleteProcessPreparer(ctx, resourceGroupName, name, processID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteProcessSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", resp, "Failure sending request") + return + } + + result, err = client.DeleteProcessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcess", resp, "Failure responding to request") + return + } + + return +} + +// DeleteProcessPreparer prepares the DeleteProcess request. +func (client AppsClient) DeleteProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteProcessSender sends the DeleteProcess request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteProcessSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteProcessResponder handles the response to the DeleteProcess request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteProcessResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteProcessSlot description for Terminate a process by its ID for a web site, or a deployment slot, or specific +// scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteProcessSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteProcessSlot", err.Error()) + } + + req, err := client.DeleteProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteProcessSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteProcessSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteProcessSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteProcessSlotPreparer prepares the DeleteProcessSlot request. +func (client AppsClient) DeleteProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteProcessSlotSender sends the DeleteProcessSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteProcessSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteProcessSlotResponder handles the response to the DeleteProcessSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteProcessSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePublicCertificate description for Deletes a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// publicCertificateName - public certificate name. +func (client AppsClient) DeletePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePublicCertificate") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePublicCertificate", err.Error()) + } + + req, err := client.DeletePublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.DeletePublicCertificateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", resp, "Failure sending request") + return + } + + result, err = client.DeletePublicCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificate", resp, "Failure responding to request") + return + } + + return +} + +// DeletePublicCertificatePreparer prepares the DeletePublicCertificate request. +func (client AppsClient) DeletePublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePublicCertificateSender sends the DeletePublicCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePublicCertificateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeletePublicCertificateResponder handles the response to the DeletePublicCertificate request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePublicCertificateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePublicCertificateSlot description for Deletes a hostname binding for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +// publicCertificateName - public certificate name. +func (client AppsClient) DeletePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeletePublicCertificateSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeletePublicCertificateSlot", err.Error()) + } + + req, err := client.DeletePublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeletePublicCertificateSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", resp, "Failure sending request") + return + } + + result, err = client.DeletePublicCertificateSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeletePublicCertificateSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeletePublicCertificateSlotPreparer prepares the DeletePublicCertificateSlot request. +func (client AppsClient) DeletePublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePublicCertificateSlotSender sends the DeletePublicCertificateSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeletePublicCertificateSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeletePublicCertificateSlotResponder handles the response to the DeletePublicCertificateSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeletePublicCertificateSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteRelayServiceConnection description for Deletes a relay service connection by its name. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection configuration. +func (client AppsClient) DeleteRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteRelayServiceConnection") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnection", err.Error()) + } + + req, err := client.DeleteRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteRelayServiceConnectionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", resp, "Failure sending request") + return + } + + result, err = client.DeleteRelayServiceConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnection", resp, "Failure responding to request") + return + } + + return +} + +// DeleteRelayServiceConnectionPreparer prepares the DeleteRelayServiceConnection request. +func (client AppsClient) DeleteRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteRelayServiceConnectionSender sends the DeleteRelayServiceConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteRelayServiceConnectionResponder handles the response to the DeleteRelayServiceConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteRelayServiceConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteRelayServiceConnectionSlot description for Deletes a relay service connection by its name. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection configuration. +// slot - name of the deployment slot. If a slot is not specified, the API will delete a hybrid connection for +// the production slot. +func (client AppsClient) DeleteRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteRelayServiceConnectionSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteRelayServiceConnectionSlot", err.Error()) + } + + req, err := client.DeleteRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteRelayServiceConnectionSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteRelayServiceConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteRelayServiceConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteRelayServiceConnectionSlotPreparer prepares the DeleteRelayServiceConnectionSlot request. +func (client AppsClient) DeleteRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteRelayServiceConnectionSlotSender sends the DeleteRelayServiceConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteRelayServiceConnectionSlotResponder handles the response to the DeleteRelayServiceConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteRelayServiceConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSiteExtension description for Remove a site extension from a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +func (client AppsClient) DeleteSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSiteExtension") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSiteExtension", err.Error()) + } + + req, err := client.DeleteSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSiteExtensionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", resp, "Failure sending request") + return + } + + result, err = client.DeleteSiteExtensionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtension", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSiteExtensionPreparer prepares the DeleteSiteExtension request. +func (client AppsClient) DeleteSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSiteExtensionSender sends the DeleteSiteExtension request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSiteExtensionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSiteExtensionResponder handles the response to the DeleteSiteExtension request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSiteExtensionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSiteExtensionSlot description for Remove a site extension from a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) DeleteSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSiteExtensionSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSiteExtensionSlot", err.Error()) + } + + req, err := client.DeleteSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSiteExtensionSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteSiteExtensionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSiteExtensionSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSiteExtensionSlotPreparer prepares the DeleteSiteExtensionSlot request. +func (client AppsClient) DeleteSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSiteExtensionSlotSender sends the DeleteSiteExtensionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSiteExtensionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSiteExtensionSlotResponder handles the response to the DeleteSiteExtensionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSiteExtensionSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSlot description for Deletes a web, mobile, or API app, or one of the deployment slots. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app to delete. +// slot - name of the deployment slot to delete. By default, the API deletes the production slot. +// deleteMetrics - if true, web app metrics are also deleted. +// deleteEmptyServerFarm - specify false if you want to keep empty App Service plan. By default, empty App +// Service plan is deleted. +func (client AppsClient) DeleteSlot(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSlot", err.Error()) + } + + req, err := client.DeleteSlotPreparer(ctx, resourceGroupName, name, slot, deleteMetrics, deleteEmptyServerFarm) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSlotPreparer prepares the DeleteSlot request. +func (client AppsClient) DeleteSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if deleteMetrics != nil { + queryParameters["deleteMetrics"] = autorest.Encode("query", *deleteMetrics) + } + if deleteEmptyServerFarm != nil { + queryParameters["deleteEmptyServerFarm"] = autorest.Encode("query", *deleteEmptyServerFarm) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSlotSender sends the DeleteSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSlotResponder handles the response to the DeleteSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSourceControl description for Deletes the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) DeleteSourceControl(ctx context.Context, resourceGroupName string, name string, additionalFlags string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSourceControl") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSourceControl", err.Error()) + } + + req, err := client.DeleteSourceControlPreparer(ctx, resourceGroupName, name, additionalFlags) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSourceControlSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", resp, "Failure sending request") + return + } + + result, err = client.DeleteSourceControlResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControl", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSourceControlPreparer prepares the DeleteSourceControl request. +func (client AppsClient) DeleteSourceControlPreparer(ctx context.Context, resourceGroupName string, name string, additionalFlags string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(additionalFlags) > 0 { + queryParameters["additionalFlags"] = autorest.Encode("query", additionalFlags) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSourceControlSender sends the DeleteSourceControl request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSourceControlSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSourceControlResponder handles the response to the DeleteSourceControl request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSourceControlResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSourceControlSlot description for Deletes the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the source control +// configuration for the production slot. +func (client AppsClient) DeleteSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, additionalFlags string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSourceControlSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSourceControlSlot", err.Error()) + } + + req, err := client.DeleteSourceControlSlotPreparer(ctx, resourceGroupName, name, slot, additionalFlags) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSourceControlSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteSourceControlSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSourceControlSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSourceControlSlotPreparer prepares the DeleteSourceControlSlot request. +func (client AppsClient) DeleteSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, additionalFlags string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(additionalFlags) > 0 { + queryParameters["additionalFlags"] = autorest.Encode("query", additionalFlags) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSourceControlSlotSender sends the DeleteSourceControlSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSourceControlSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSourceControlSlotResponder handles the response to the DeleteSourceControlSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSourceControlSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSwiftVirtualNetwork description for Deletes a Swift Virtual Network connection from an app (or deployment +// slot). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) DeleteSwiftVirtualNetwork(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSwiftVirtualNetwork") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSwiftVirtualNetwork", err.Error()) + } + + req, err := client.DeleteSwiftVirtualNetworkPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSwiftVirtualNetworkSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", resp, "Failure sending request") + return + } + + result, err = client.DeleteSwiftVirtualNetworkResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetwork", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSwiftVirtualNetworkPreparer prepares the DeleteSwiftVirtualNetwork request. +func (client AppsClient) DeleteSwiftVirtualNetworkPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSwiftVirtualNetworkSender sends the DeleteSwiftVirtualNetwork request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSwiftVirtualNetworkSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSwiftVirtualNetworkResponder handles the response to the DeleteSwiftVirtualNetwork request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSwiftVirtualNetworkResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteSwiftVirtualNetworkSlot description for Deletes a Swift Virtual Network connection from an app (or deployment +// slot). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the connection for the +// production slot. +func (client AppsClient) DeleteSwiftVirtualNetworkSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteSwiftVirtualNetworkSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteSwiftVirtualNetworkSlot", err.Error()) + } + + req, err := client.DeleteSwiftVirtualNetworkSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSwiftVirtualNetworkSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteSwiftVirtualNetworkSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteSwiftVirtualNetworkSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteSwiftVirtualNetworkSlotPreparer prepares the DeleteSwiftVirtualNetworkSlot request. +func (client AppsClient) DeleteSwiftVirtualNetworkSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSwiftVirtualNetworkSlotSender sends the DeleteSwiftVirtualNetworkSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteSwiftVirtualNetworkSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteSwiftVirtualNetworkSlotResponder handles the response to the DeleteSwiftVirtualNetworkSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteSwiftVirtualNetworkSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteTriggeredWebJob description for Delete a triggered web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) DeleteTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJob") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJob", err.Error()) + } + + req, err := client.DeleteTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteTriggeredWebJobSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", resp, "Failure sending request") + return + } + + result, err = client.DeleteTriggeredWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJob", resp, "Failure responding to request") + return + } + + return +} + +// DeleteTriggeredWebJobPreparer prepares the DeleteTriggeredWebJob request. +func (client AppsClient) DeleteTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteTriggeredWebJobSender sends the DeleteTriggeredWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteTriggeredWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteTriggeredWebJobResponder handles the response to the DeleteTriggeredWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteTriggeredWebJobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteTriggeredWebJobSlot description for Delete a triggered web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes web job for the production +// slot. +func (client AppsClient) DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteTriggeredWebJobSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteTriggeredWebJobSlot", err.Error()) + } + + req, err := client.DeleteTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteTriggeredWebJobSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteTriggeredWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteTriggeredWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteTriggeredWebJobSlotPreparer prepares the DeleteTriggeredWebJobSlot request. +func (client AppsClient) DeleteTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteTriggeredWebJobSlotSender sends the DeleteTriggeredWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteTriggeredWebJobSlotResponder handles the response to the DeleteTriggeredWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteTriggeredWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteVnetConnection description for Deletes a connection from an app (or deployment slot to a named virtual +// network. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the virtual network. +func (client AppsClient) DeleteVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteVnetConnection") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteVnetConnection", err.Error()) + } + + req, err := client.DeleteVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteVnetConnectionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", resp, "Failure sending request") + return + } + + result, err = client.DeleteVnetConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnection", resp, "Failure responding to request") + return + } + + return +} + +// DeleteVnetConnectionPreparer prepares the DeleteVnetConnection request. +func (client AppsClient) DeleteVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteVnetConnectionSender sends the DeleteVnetConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteVnetConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteVnetConnectionResponder handles the response to the DeleteVnetConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteVnetConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteVnetConnectionSlot description for Deletes a connection from an app (or deployment slot to a named virtual +// network. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the virtual network. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the connection for the +// production slot. +func (client AppsClient) DeleteVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DeleteVnetConnectionSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DeleteVnetConnectionSlot", err.Error()) + } + + req, err := client.DeleteVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteVnetConnectionSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.DeleteVnetConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DeleteVnetConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// DeleteVnetConnectionSlotPreparer prepares the DeleteVnetConnectionSlot request. +func (client AppsClient) DeleteVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteVnetConnectionSlotSender sends the DeleteVnetConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DeleteVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteVnetConnectionSlotResponder handles the response to the DeleteVnetConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DeleteVnetConnectionSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DiscoverBackup description for Discovers an existing app backup that can be restored from a blob in Azure storage. +// Use this to get information about the databases stored in a backup. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. +func (client AppsClient) DiscoverBackup(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (result RestoreRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DiscoverBackup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DiscoverBackup", err.Error()) + } + + req, err := client.DiscoverBackupPreparer(ctx, resourceGroupName, name, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", nil, "Failure preparing request") + return + } + + resp, err := client.DiscoverBackupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", resp, "Failure sending request") + return + } + + result, err = client.DiscoverBackupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackup", resp, "Failure responding to request") + return + } + + return +} + +// DiscoverBackupPreparer prepares the DiscoverBackup request. +func (client AppsClient) DiscoverBackupPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/discoverbackup", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverBackupSender sends the DiscoverBackup request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DiscoverBackupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DiscoverBackupResponder handles the response to the DiscoverBackup request. The method always +// closes the http.Response Body. +func (client AppsClient) DiscoverBackupResponder(resp *http.Response) (result RestoreRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DiscoverBackupSlot description for Discovers an existing app backup that can be restored from a blob in Azure +// storage. Use this to get information about the databases stored in a backup. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - a RestoreRequest object that includes Azure storage URL and blog name for discovery of backup. +// slot - name of the deployment slot. If a slot is not specified, the API will perform discovery for the +// production slot. +func (client AppsClient) DiscoverBackupSlot(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (result RestoreRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.DiscoverBackupSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "DiscoverBackupSlot", err.Error()) + } + + req, err := client.DiscoverBackupSlotPreparer(ctx, resourceGroupName, name, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", nil, "Failure preparing request") + return + } + + resp, err := client.DiscoverBackupSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", resp, "Failure sending request") + return + } + + result, err = client.DiscoverBackupSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "DiscoverBackupSlot", resp, "Failure responding to request") + return + } + + return +} + +// DiscoverBackupSlotPreparer prepares the DiscoverBackupSlot request. +func (client AppsClient) DiscoverBackupSlotPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/discoverbackup", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DiscoverBackupSlotSender sends the DiscoverBackupSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) DiscoverBackupSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DiscoverBackupSlotResponder handles the response to the DiscoverBackupSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) DiscoverBackupSlotResponder(resp *http.Response) (result RestoreRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GenerateNewSitePublishingPassword description for Generates a new publishing password for an app (or deployment +// slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GenerateNewSitePublishingPassword(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GenerateNewSitePublishingPassword") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPassword", err.Error()) + } + + req, err := client.GenerateNewSitePublishingPasswordPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateNewSitePublishingPasswordSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", resp, "Failure sending request") + return + } + + result, err = client.GenerateNewSitePublishingPasswordResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPassword", resp, "Failure responding to request") + return + } + + return +} + +// GenerateNewSitePublishingPasswordPreparer prepares the GenerateNewSitePublishingPassword request. +func (client AppsClient) GenerateNewSitePublishingPasswordPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/newpassword", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateNewSitePublishingPasswordSender sends the GenerateNewSitePublishingPassword request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GenerateNewSitePublishingPasswordSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateNewSitePublishingPasswordResponder handles the response to the GenerateNewSitePublishingPassword request. The method always +// closes the http.Response Body. +func (client AppsClient) GenerateNewSitePublishingPasswordResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateNewSitePublishingPasswordSlot description for Generates a new publishing password for an app (or deployment +// slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API generate a new publishing password +// for the production slot. +func (client AppsClient) GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GenerateNewSitePublishingPasswordSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GenerateNewSitePublishingPasswordSlot", err.Error()) + } + + req, err := client.GenerateNewSitePublishingPasswordSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateNewSitePublishingPasswordSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure sending request") + return + } + + result, err = client.GenerateNewSitePublishingPasswordSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GenerateNewSitePublishingPasswordSlot", resp, "Failure responding to request") + return + } + + return +} + +// GenerateNewSitePublishingPasswordSlotPreparer prepares the GenerateNewSitePublishingPasswordSlot request. +func (client AppsClient) GenerateNewSitePublishingPasswordSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/newpassword", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateNewSitePublishingPasswordSlotSender sends the GenerateNewSitePublishingPasswordSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GenerateNewSitePublishingPasswordSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateNewSitePublishingPasswordSlotResponder handles the response to the GenerateNewSitePublishingPasswordSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GenerateNewSitePublishingPasswordSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get description for Gets the details of a web, mobile, or API app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) Get(ctx context.Context, resourceGroupName string, name string) (result Site, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AppsClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AppsClient) GetResponder(resp *http.Response) (result Site, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAppSettingKeyVaultReference description for Gets the config reference and status of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// appSettingKey - app Setting key name. +func (client AppsClient) GetAppSettingKeyVaultReference(ctx context.Context, resourceGroupName string, name string, appSettingKey string) (result APIKVReference, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingKeyVaultReference") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAppSettingKeyVaultReference", err.Error()) + } + + req, err := client.GetAppSettingKeyVaultReferencePreparer(ctx, resourceGroupName, name, appSettingKey) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReference", nil, "Failure preparing request") + return + } + + resp, err := client.GetAppSettingKeyVaultReferenceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReference", resp, "Failure sending request") + return + } + + result, err = client.GetAppSettingKeyVaultReferenceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReference", resp, "Failure responding to request") + return + } + + return +} + +// GetAppSettingKeyVaultReferencePreparer prepares the GetAppSettingKeyVaultReference request. +func (client AppsClient) GetAppSettingKeyVaultReferencePreparer(ctx context.Context, resourceGroupName string, name string, appSettingKey string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appSettingKey": autorest.Encode("path", appSettingKey), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings/{appSettingKey}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAppSettingKeyVaultReferenceSender sends the GetAppSettingKeyVaultReference request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAppSettingKeyVaultReferenceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAppSettingKeyVaultReferenceResponder handles the response to the GetAppSettingKeyVaultReference request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAppSettingKeyVaultReferenceResponder(resp *http.Response) (result APIKVReference, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAppSettingKeyVaultReferenceSlot description for Gets the config reference and status of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// appSettingKey - app Setting key name. +func (client AppsClient) GetAppSettingKeyVaultReferenceSlot(ctx context.Context, resourceGroupName string, name string, appSettingKey string, slot string) (result APIKVReference, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingKeyVaultReferenceSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAppSettingKeyVaultReferenceSlot", err.Error()) + } + + req, err := client.GetAppSettingKeyVaultReferenceSlotPreparer(ctx, resourceGroupName, name, appSettingKey, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReferenceSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetAppSettingKeyVaultReferenceSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReferenceSlot", resp, "Failure sending request") + return + } + + result, err = client.GetAppSettingKeyVaultReferenceSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingKeyVaultReferenceSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetAppSettingKeyVaultReferenceSlotPreparer prepares the GetAppSettingKeyVaultReferenceSlot request. +func (client AppsClient) GetAppSettingKeyVaultReferenceSlotPreparer(ctx context.Context, resourceGroupName string, name string, appSettingKey string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "appSettingKey": autorest.Encode("path", appSettingKey), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings/{appSettingKey}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAppSettingKeyVaultReferenceSlotSender sends the GetAppSettingKeyVaultReferenceSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAppSettingKeyVaultReferenceSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAppSettingKeyVaultReferenceSlotResponder handles the response to the GetAppSettingKeyVaultReferenceSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAppSettingKeyVaultReferenceSlotResponder(resp *http.Response) (result APIKVReference, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAppSettingsKeyVaultReferences description for Gets the config reference app settings and status of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetAppSettingsKeyVaultReferences(ctx context.Context, resourceGroupName string, name string) (result APIKVReferenceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingsKeyVaultReferences") + defer func() { + sc := -1 + if result.arc.Response.Response != nil { + sc = result.arc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAppSettingsKeyVaultReferences", err.Error()) + } + + result.fn = client.getAppSettingsKeyVaultReferencesNextResults + req, err := client.GetAppSettingsKeyVaultReferencesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferences", nil, "Failure preparing request") + return + } + + resp, err := client.GetAppSettingsKeyVaultReferencesSender(req) + if err != nil { + result.arc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferences", resp, "Failure sending request") + return + } + + result.arc, err = client.GetAppSettingsKeyVaultReferencesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferences", resp, "Failure responding to request") + return + } + if result.arc.hasNextLink() && result.arc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetAppSettingsKeyVaultReferencesPreparer prepares the GetAppSettingsKeyVaultReferences request. +func (client AppsClient) GetAppSettingsKeyVaultReferencesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/appsettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAppSettingsKeyVaultReferencesSender sends the GetAppSettingsKeyVaultReferences request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAppSettingsKeyVaultReferencesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAppSettingsKeyVaultReferencesResponder handles the response to the GetAppSettingsKeyVaultReferences request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAppSettingsKeyVaultReferencesResponder(resp *http.Response) (result APIKVReferenceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getAppSettingsKeyVaultReferencesNextResults retrieves the next set of results, if any. +func (client AppsClient) getAppSettingsKeyVaultReferencesNextResults(ctx context.Context, lastResults APIKVReferenceCollection) (result APIKVReferenceCollection, err error) { + req, err := lastResults.aPIKVReferenceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getAppSettingsKeyVaultReferencesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetAppSettingsKeyVaultReferencesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getAppSettingsKeyVaultReferencesNextResults", resp, "Failure sending next results request") + } + result, err = client.GetAppSettingsKeyVaultReferencesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "getAppSettingsKeyVaultReferencesNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetAppSettingsKeyVaultReferencesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) GetAppSettingsKeyVaultReferencesComplete(ctx context.Context, resourceGroupName string, name string) (result APIKVReferenceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingsKeyVaultReferences") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetAppSettingsKeyVaultReferences(ctx, resourceGroupName, name) + return +} + +// GetAppSettingsKeyVaultReferencesSlot description for Gets the config reference app settings and status of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetAppSettingsKeyVaultReferencesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result APIKVReferenceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingsKeyVaultReferencesSlot") + defer func() { + sc := -1 + if result.arc.Response.Response != nil { + sc = result.arc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAppSettingsKeyVaultReferencesSlot", err.Error()) + } + + result.fn = client.getAppSettingsKeyVaultReferencesSlotNextResults + req, err := client.GetAppSettingsKeyVaultReferencesSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferencesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetAppSettingsKeyVaultReferencesSlotSender(req) + if err != nil { + result.arc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferencesSlot", resp, "Failure sending request") + return + } + + result.arc, err = client.GetAppSettingsKeyVaultReferencesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAppSettingsKeyVaultReferencesSlot", resp, "Failure responding to request") + return + } + if result.arc.hasNextLink() && result.arc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetAppSettingsKeyVaultReferencesSlotPreparer prepares the GetAppSettingsKeyVaultReferencesSlot request. +func (client AppsClient) GetAppSettingsKeyVaultReferencesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/appsettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAppSettingsKeyVaultReferencesSlotSender sends the GetAppSettingsKeyVaultReferencesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAppSettingsKeyVaultReferencesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAppSettingsKeyVaultReferencesSlotResponder handles the response to the GetAppSettingsKeyVaultReferencesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAppSettingsKeyVaultReferencesSlotResponder(resp *http.Response) (result APIKVReferenceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getAppSettingsKeyVaultReferencesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) getAppSettingsKeyVaultReferencesSlotNextResults(ctx context.Context, lastResults APIKVReferenceCollection) (result APIKVReferenceCollection, err error) { + req, err := lastResults.aPIKVReferenceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getAppSettingsKeyVaultReferencesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetAppSettingsKeyVaultReferencesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getAppSettingsKeyVaultReferencesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.GetAppSettingsKeyVaultReferencesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "getAppSettingsKeyVaultReferencesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetAppSettingsKeyVaultReferencesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) GetAppSettingsKeyVaultReferencesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result APIKVReferenceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAppSettingsKeyVaultReferencesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetAppSettingsKeyVaultReferencesSlot(ctx, resourceGroupName, name, slot) + return +} + +// GetAuthSettings description for Gets the Authentication/Authorization settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAuthSettings", err.Error()) + } + + req, err := client.GetAuthSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", nil, "Failure preparing request") + return + } + + resp, err := client.GetAuthSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure sending request") + return + } + + result, err = client.GetAuthSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettings", resp, "Failure responding to request") + return + } + + return +} + +// GetAuthSettingsPreparer prepares the GetAuthSettings request. +func (client AppsClient) GetAuthSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAuthSettingsSender sends the GetAuthSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAuthSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAuthSettingsResponder handles the response to the GetAuthSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAuthSettingsSlot description for Gets the Authentication/Authorization settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the settings for the +// production slot. +func (client AppsClient) GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAuthSettingsSlot", err.Error()) + } + + req, err := client.GetAuthSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetAuthSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.GetAuthSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetAuthSettingsSlotPreparer prepares the GetAuthSettingsSlot request. +func (client AppsClient) GetAuthSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAuthSettingsSlotSender sends the GetAuthSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAuthSettingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAuthSettingsSlotResponder handles the response to the GetAuthSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAuthSettingsV2 description for Gets site's Authentication / Authorization settings for apps via the V2 format +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetAuthSettingsV2(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettingsV2, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsV2") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAuthSettingsV2", err.Error()) + } + + req, err := client.GetAuthSettingsV2Preparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetAuthSettingsV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2", resp, "Failure sending request") + return + } + + result, err = client.GetAuthSettingsV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2", resp, "Failure responding to request") + return + } + + return +} + +// GetAuthSettingsV2Preparer prepares the GetAuthSettingsV2 request. +func (client AppsClient) GetAuthSettingsV2Preparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAuthSettingsV2Sender sends the GetAuthSettingsV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAuthSettingsV2Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAuthSettingsV2Responder handles the response to the GetAuthSettingsV2 request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAuthSettingsV2Responder(resp *http.Response) (result SiteAuthSettingsV2, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAuthSettingsV2Slot description for Gets site's Authentication / Authorization settings for apps via the V2 format +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the settings for the +// production slot. +func (client AppsClient) GetAuthSettingsV2Slot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteAuthSettingsV2, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsV2Slot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAuthSettingsV2Slot", err.Error()) + } + + req, err := client.GetAuthSettingsV2SlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2Slot", nil, "Failure preparing request") + return + } + + resp, err := client.GetAuthSettingsV2SlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2Slot", resp, "Failure sending request") + return + } + + result, err = client.GetAuthSettingsV2SlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2Slot", resp, "Failure responding to request") + return + } + + return +} + +// GetAuthSettingsV2SlotPreparer prepares the GetAuthSettingsV2Slot request. +func (client AppsClient) GetAuthSettingsV2SlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAuthSettingsV2SlotSender sends the GetAuthSettingsV2Slot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAuthSettingsV2SlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAuthSettingsV2SlotResponder handles the response to the GetAuthSettingsV2Slot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAuthSettingsV2SlotResponder(resp *http.Response) (result SiteAuthSettingsV2, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAuthSettingsV2WithoutSecrets description for Gets site's Authentication / Authorization settings for apps via the +// V2 format +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetAuthSettingsV2WithoutSecrets(ctx context.Context, resourceGroupName string, name string) (result SiteAuthSettingsV2, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetAuthSettingsV2WithoutSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetAuthSettingsV2WithoutSecrets", err.Error()) + } + + req, err := client.GetAuthSettingsV2WithoutSecretsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2WithoutSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.GetAuthSettingsV2WithoutSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2WithoutSecrets", resp, "Failure sending request") + return + } + + result, err = client.GetAuthSettingsV2WithoutSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetAuthSettingsV2WithoutSecrets", resp, "Failure responding to request") + return + } + + return +} + +// GetAuthSettingsV2WithoutSecretsPreparer prepares the GetAuthSettingsV2WithoutSecrets request. +func (client AppsClient) GetAuthSettingsV2WithoutSecretsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAuthSettingsV2WithoutSecretsSender sends the GetAuthSettingsV2WithoutSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetAuthSettingsV2WithoutSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAuthSettingsV2WithoutSecretsResponder handles the response to the GetAuthSettingsV2WithoutSecrets request. The method always +// closes the http.Response Body. +func (client AppsClient) GetAuthSettingsV2WithoutSecretsResponder(resp *http.Response) (result SiteAuthSettingsV2, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackupConfiguration description for Gets the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result BackupRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBackupConfiguration", err.Error()) + } + + req, err := client.GetBackupConfigurationPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetBackupConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// GetBackupConfigurationPreparer prepares the GetBackupConfiguration request. +func (client AppsClient) GetBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBackupConfigurationSender sends the GetBackupConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetBackupConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBackupConfigurationResponder handles the response to the GetBackupConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) GetBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackupConfigurationSlot description for Gets the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the backup configuration +// for the production slot. +func (client AppsClient) GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBackupConfigurationSlot", err.Error()) + } + + req, err := client.GetBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.GetBackupConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetBackupConfigurationSlotPreparer prepares the GetBackupConfigurationSlot request. +func (client AppsClient) GetBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBackupConfigurationSlotSender sends the GetBackupConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBackupConfigurationSlotResponder handles the response to the GetBackupConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetBackupConfigurationSlotResponder(resp *http.Response) (result BackupRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackupStatus description for Gets a backup of an app by its ID. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// backupID - ID of the backup. +func (client AppsClient) GetBackupStatus(ctx context.Context, resourceGroupName string, name string, backupID string) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBackupStatus", err.Error()) + } + + req, err := client.GetBackupStatusPreparer(ctx, resourceGroupName, name, backupID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", resp, "Failure sending request") + return + } + + result, err = client.GetBackupStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetBackupStatusPreparer prepares the GetBackupStatus request. +func (client AppsClient) GetBackupStatusPreparer(ctx context.Context, resourceGroupName string, name string, backupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBackupStatusSender sends the GetBackupStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetBackupStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBackupStatusResponder handles the response to the GetBackupStatus request. The method always +// closes the http.Response Body. +func (client AppsClient) GetBackupStatusResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBackupStatusSlot description for Gets a backup of an app by its ID. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// backupID - ID of the backup. +// slot - name of the deployment slot. If a slot is not specified, the API will get a backup of the production +// slot. +func (client AppsClient) GetBackupStatusSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetBackupStatusSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetBackupStatusSlot", err.Error()) + } + + req, err := client.GetBackupStatusSlotPreparer(ctx, resourceGroupName, name, backupID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetBackupStatusSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", resp, "Failure sending request") + return + } + + result, err = client.GetBackupStatusSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetBackupStatusSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetBackupStatusSlotPreparer prepares the GetBackupStatusSlot request. +func (client AppsClient) GetBackupStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBackupStatusSlotSender sends the GetBackupStatusSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetBackupStatusSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBackupStatusSlotResponder handles the response to the GetBackupStatusSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetBackupStatusSlotResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConfiguration description for Gets the configuration of an app, such as platform version and bitness, default +// documents, virtual applications, Always On, etc. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetConfiguration(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetConfiguration", err.Error()) + } + + req, err := client.GetConfigurationPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// GetConfigurationPreparer prepares the GetConfiguration request. +func (client AppsClient) GetConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConfigurationSender sends the GetConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetConfigurationResponder handles the response to the GetConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) GetConfigurationResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConfigurationSlot description for Gets the configuration of an app, such as platform version and bitness, default +// documents, virtual applications, Always On, etc. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) GetConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetConfigurationSlot", err.Error()) + } + + req, err := client.GetConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.GetConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetConfigurationSlotPreparer prepares the GetConfigurationSlot request. +func (client AppsClient) GetConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConfigurationSlotSender sends the GetConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetConfigurationSlotResponder handles the response to the GetConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetConfigurationSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConfigurationSnapshot description for Gets a snapshot of the configuration of an app at a previous point in time. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// snapshotID - the ID of the snapshot to read. +func (client AppsClient) GetConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSnapshot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshot", err.Error()) + } + + req, err := client.GetConfigurationSnapshotPreparer(ctx, resourceGroupName, name, snapshotID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", nil, "Failure preparing request") + return + } + + resp, err := client.GetConfigurationSnapshotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", resp, "Failure sending request") + return + } + + result, err = client.GetConfigurationSnapshotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshot", resp, "Failure responding to request") + return + } + + return +} + +// GetConfigurationSnapshotPreparer prepares the GetConfigurationSnapshot request. +func (client AppsClient) GetConfigurationSnapshotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotId": autorest.Encode("path", snapshotID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConfigurationSnapshotSender sends the GetConfigurationSnapshot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetConfigurationSnapshotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetConfigurationSnapshotResponder handles the response to the GetConfigurationSnapshot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetConfigurationSnapshotResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetConfigurationSnapshotSlot description for Gets a snapshot of the configuration of an app at a previous point in +// time. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// snapshotID - the ID of the snapshot to read. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) GetConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetConfigurationSnapshotSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetConfigurationSnapshotSlot", err.Error()) + } + + req, err := client.GetConfigurationSnapshotSlotPreparer(ctx, resourceGroupName, name, snapshotID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetConfigurationSnapshotSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", resp, "Failure sending request") + return + } + + result, err = client.GetConfigurationSnapshotSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetConfigurationSnapshotSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetConfigurationSnapshotSlotPreparer prepares the GetConfigurationSnapshotSlot request. +func (client AppsClient) GetConfigurationSnapshotSlotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "snapshotId": autorest.Encode("path", snapshotID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetConfigurationSnapshotSlotSender sends the GetConfigurationSnapshotSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetConfigurationSnapshotSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetConfigurationSnapshotSlotResponder handles the response to the GetConfigurationSnapshotSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetConfigurationSnapshotSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContainerLogsZip description for Gets the ZIP archived docker log files for the given site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetContainerLogsZip(ctx context.Context, resourceGroupName string, name string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContainerLogsZip") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetContainerLogsZip", err.Error()) + } + + req, err := client.GetContainerLogsZipPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", nil, "Failure preparing request") + return + } + + resp, err := client.GetContainerLogsZipSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", resp, "Failure sending request") + return + } + + result, err = client.GetContainerLogsZipResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZip", resp, "Failure responding to request") + return + } + + return +} + +// GetContainerLogsZipPreparer prepares the GetContainerLogsZip request. +func (client AppsClient) GetContainerLogsZipPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs/zip/download", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContainerLogsZipSender sends the GetContainerLogsZip request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetContainerLogsZipSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContainerLogsZipResponder handles the response to the GetContainerLogsZip request. The method always +// closes the http.Response Body. +func (client AppsClient) GetContainerLogsZipResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContainerLogsZipSlot description for Gets the ZIP archived docker log files for the given site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetContainerLogsZipSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContainerLogsZipSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetContainerLogsZipSlot", err.Error()) + } + + req, err := client.GetContainerLogsZipSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetContainerLogsZipSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", resp, "Failure sending request") + return + } + + result, err = client.GetContainerLogsZipSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContainerLogsZipSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetContainerLogsZipSlotPreparer prepares the GetContainerLogsZipSlot request. +func (client AppsClient) GetContainerLogsZipSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs/zip/download", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContainerLogsZipSlotSender sends the GetContainerLogsZipSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetContainerLogsZipSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContainerLogsZipSlotResponder handles the response to the GetContainerLogsZipSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetContainerLogsZipSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContinuousWebJob description for Gets a continuous web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) GetContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result ContinuousWebJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContinuousWebJob") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetContinuousWebJob", err.Error()) + } + + req, err := client.GetContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.GetContinuousWebJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", resp, "Failure sending request") + return + } + + result, err = client.GetContinuousWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJob", resp, "Failure responding to request") + return + } + + return +} + +// GetContinuousWebJobPreparer prepares the GetContinuousWebJob request. +func (client AppsClient) GetContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContinuousWebJobSender sends the GetContinuousWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetContinuousWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContinuousWebJobResponder handles the response to the GetContinuousWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) GetContinuousWebJobResponder(resp *http.Response) (result ContinuousWebJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetContinuousWebJobSlot description for Gets a continuous web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) GetContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result ContinuousWebJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetContinuousWebJobSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetContinuousWebJobSlot", err.Error()) + } + + req, err := client.GetContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetContinuousWebJobSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.GetContinuousWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetContinuousWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetContinuousWebJobSlotPreparer prepares the GetContinuousWebJobSlot request. +func (client AppsClient) GetContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetContinuousWebJobSlotSender sends the GetContinuousWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetContinuousWebJobSlotResponder handles the response to the GetContinuousWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetContinuousWebJobSlotResponder(resp *http.Response) (result ContinuousWebJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeployment description for Get a deployment by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - deployment ID. +func (client AppsClient) GetDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDeployment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetDeployment", err.Error()) + } + + req, err := client.GetDeploymentPreparer(ctx, resourceGroupName, name, ID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeploymentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", resp, "Failure sending request") + return + } + + result, err = client.GetDeploymentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeployment", resp, "Failure responding to request") + return + } + + return +} + +// GetDeploymentPreparer prepares the GetDeployment request. +func (client AppsClient) GetDeploymentPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeploymentSender sends the GetDeployment request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetDeploymentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDeploymentResponder handles the response to the GetDeployment request. The method always +// closes the http.Response Body. +func (client AppsClient) GetDeploymentResponder(resp *http.Response) (result Deployment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeploymentSlot description for Get a deployment by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - deployment ID. +// slot - name of the deployment slot. If a slot is not specified, the API gets a deployment for the production +// slot. +func (client AppsClient) GetDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDeploymentSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetDeploymentSlot", err.Error()) + } + + req, err := client.GetDeploymentSlotPreparer(ctx, resourceGroupName, name, ID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeploymentSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", resp, "Failure sending request") + return + } + + result, err = client.GetDeploymentSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDeploymentSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetDeploymentSlotPreparer prepares the GetDeploymentSlot request. +func (client AppsClient) GetDeploymentSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeploymentSlotSender sends the GetDeploymentSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetDeploymentSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDeploymentSlotResponder handles the response to the GetDeploymentSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetDeploymentSlotResponder(resp *http.Response) (result Deployment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDiagnosticLogsConfiguration description for Gets the logging configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetDiagnosticLogsConfiguration(ctx context.Context, resourceGroupName string, name string) (result SiteLogsConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDiagnosticLogsConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfiguration", err.Error()) + } + + req, err := client.GetDiagnosticLogsConfigurationPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetDiagnosticLogsConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetDiagnosticLogsConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// GetDiagnosticLogsConfigurationPreparer prepares the GetDiagnosticLogsConfiguration request. +func (client AppsClient) GetDiagnosticLogsConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDiagnosticLogsConfigurationSender sends the GetDiagnosticLogsConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetDiagnosticLogsConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDiagnosticLogsConfigurationResponder handles the response to the GetDiagnosticLogsConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) GetDiagnosticLogsConfigurationResponder(resp *http.Response) (result SiteLogsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDiagnosticLogsConfigurationSlot description for Gets the logging configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the logging configuration +// for the production slot. +func (client AppsClient) GetDiagnosticLogsConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteLogsConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDiagnosticLogsConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetDiagnosticLogsConfigurationSlot", err.Error()) + } + + req, err := client.GetDiagnosticLogsConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetDiagnosticLogsConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.GetDiagnosticLogsConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDiagnosticLogsConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetDiagnosticLogsConfigurationSlotPreparer prepares the GetDiagnosticLogsConfigurationSlot request. +func (client AppsClient) GetDiagnosticLogsConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDiagnosticLogsConfigurationSlotSender sends the GetDiagnosticLogsConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetDiagnosticLogsConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDiagnosticLogsConfigurationSlotResponder handles the response to the GetDiagnosticLogsConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetDiagnosticLogsConfigurationSlotResponder(resp *http.Response) (result SiteLogsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDomainOwnershipIdentifier description for Get domain ownership identifier for web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +func (client AppsClient) GetDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result Identifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDomainOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifier", err.Error()) + } + + req, err := client.GetDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.GetDomainOwnershipIdentifierSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.GetDomainOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// GetDomainOwnershipIdentifierPreparer prepares the GetDomainOwnershipIdentifier request. +func (client AppsClient) GetDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDomainOwnershipIdentifierSender sends the GetDomainOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDomainOwnershipIdentifierResponder handles the response to the GetDomainOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client AppsClient) GetDomainOwnershipIdentifierResponder(resp *http.Response) (result Identifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDomainOwnershipIdentifierSlot description for Get domain ownership identifier for web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) GetDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result Identifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetDomainOwnershipIdentifierSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetDomainOwnershipIdentifierSlot", err.Error()) + } + + req, err := client.GetDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetDomainOwnershipIdentifierSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", resp, "Failure sending request") + return + } + + result, err = client.GetDomainOwnershipIdentifierSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetDomainOwnershipIdentifierSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetDomainOwnershipIdentifierSlotPreparer prepares the GetDomainOwnershipIdentifierSlot request. +func (client AppsClient) GetDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDomainOwnershipIdentifierSlotSender sends the GetDomainOwnershipIdentifierSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDomainOwnershipIdentifierSlotResponder handles the response to the GetDomainOwnershipIdentifierSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result Identifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFtpAllowed description for Returns whether FTP is allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetFtpAllowed(ctx context.Context, resourceGroupName string, name string) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFtpAllowed") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetFtpAllowed", err.Error()) + } + + req, err := client.GetFtpAllowedPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFtpAllowed", nil, "Failure preparing request") + return + } + + resp, err := client.GetFtpAllowedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFtpAllowed", resp, "Failure sending request") + return + } + + result, err = client.GetFtpAllowedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFtpAllowed", resp, "Failure responding to request") + return + } + + return +} + +// GetFtpAllowedPreparer prepares the GetFtpAllowed request. +func (client AppsClient) GetFtpAllowedPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFtpAllowedSender sends the GetFtpAllowed request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetFtpAllowedSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetFtpAllowedResponder handles the response to the GetFtpAllowed request. The method always +// closes the http.Response Body. +func (client AppsClient) GetFtpAllowedResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFtpAllowedSlot description for Returns whether FTP is allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetFtpAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFtpAllowedSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetFtpAllowedSlot", err.Error()) + } + + req, err := client.GetFtpAllowedSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFtpAllowedSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetFtpAllowedSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFtpAllowedSlot", resp, "Failure sending request") + return + } + + result, err = client.GetFtpAllowedSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFtpAllowedSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetFtpAllowedSlotPreparer prepares the GetFtpAllowedSlot request. +func (client AppsClient) GetFtpAllowedSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFtpAllowedSlotSender sends the GetFtpAllowedSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetFtpAllowedSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetFtpAllowedSlotResponder handles the response to the GetFtpAllowedSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetFtpAllowedSlotResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFunction description for Get function information by its ID for web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +func (client AppsClient) GetFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionEnvelope, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunction") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetFunction", err.Error()) + } + + req, err := client.GetFunctionPreparer(ctx, resourceGroupName, name, functionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", nil, "Failure preparing request") + return + } + + resp, err := client.GetFunctionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", resp, "Failure sending request") + return + } + + result, err = client.GetFunctionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunction", resp, "Failure responding to request") + return + } + + return +} + +// GetFunctionPreparer prepares the GetFunction request. +func (client AppsClient) GetFunctionPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFunctionSender sends the GetFunction request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetFunctionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetFunctionResponder handles the response to the GetFunction request. The method always +// closes the http.Response Body. +func (client AppsClient) GetFunctionResponder(resp *http.Response) (result FunctionEnvelope, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFunctionsAdminToken description for Fetch a short lived token that can be exchanged for a master key. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetFunctionsAdminToken(ctx context.Context, resourceGroupName string, name string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunctionsAdminToken") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetFunctionsAdminToken", err.Error()) + } + + req, err := client.GetFunctionsAdminTokenPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", nil, "Failure preparing request") + return + } + + resp, err := client.GetFunctionsAdminTokenSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", resp, "Failure sending request") + return + } + + result, err = client.GetFunctionsAdminTokenResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminToken", resp, "Failure responding to request") + return + } + + return +} + +// GetFunctionsAdminTokenPreparer prepares the GetFunctionsAdminToken request. +func (client AppsClient) GetFunctionsAdminTokenPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/admin/token", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFunctionsAdminTokenSender sends the GetFunctionsAdminToken request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetFunctionsAdminTokenSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetFunctionsAdminTokenResponder handles the response to the GetFunctionsAdminToken request. The method always +// closes the http.Response Body. +func (client AppsClient) GetFunctionsAdminTokenResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetFunctionsAdminTokenSlot description for Fetch a short lived token that can be exchanged for a master key. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetFunctionsAdminTokenSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetFunctionsAdminTokenSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetFunctionsAdminTokenSlot", err.Error()) + } + + req, err := client.GetFunctionsAdminTokenSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetFunctionsAdminTokenSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", resp, "Failure sending request") + return + } + + result, err = client.GetFunctionsAdminTokenSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetFunctionsAdminTokenSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetFunctionsAdminTokenSlotPreparer prepares the GetFunctionsAdminTokenSlot request. +func (client AppsClient) GetFunctionsAdminTokenSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/admin/token", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFunctionsAdminTokenSlotSender sends the GetFunctionsAdminTokenSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetFunctionsAdminTokenSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetFunctionsAdminTokenSlotResponder handles the response to the GetFunctionsAdminTokenSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetFunctionsAdminTokenSlotResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHostNameBinding description for Get the named hostname binding for an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// hostName - hostname in the hostname binding. +func (client AppsClient) GetHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result HostNameBinding, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHostNameBinding") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetHostNameBinding", err.Error()) + } + + req, err := client.GetHostNameBindingPreparer(ctx, resourceGroupName, name, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", nil, "Failure preparing request") + return + } + + resp, err := client.GetHostNameBindingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", resp, "Failure sending request") + return + } + + result, err = client.GetHostNameBindingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBinding", resp, "Failure responding to request") + return + } + + return +} + +// GetHostNameBindingPreparer prepares the GetHostNameBinding request. +func (client AppsClient) GetHostNameBindingPreparer(ctx context.Context, resourceGroupName string, name string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings/{hostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHostNameBindingSender sends the GetHostNameBinding request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetHostNameBindingSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHostNameBindingResponder handles the response to the GetHostNameBinding request. The method always +// closes the http.Response Body. +func (client AppsClient) GetHostNameBindingResponder(resp *http.Response) (result HostNameBinding, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHostNameBindingSlot description for Get the named hostname binding for an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production +// slot. +// hostName - hostname in the hostname binding. +func (client AppsClient) GetHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result HostNameBinding, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHostNameBindingSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetHostNameBindingSlot", err.Error()) + } + + req, err := client.GetHostNameBindingSlotPreparer(ctx, resourceGroupName, name, slot, hostName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetHostNameBindingSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", resp, "Failure sending request") + return + } + + result, err = client.GetHostNameBindingSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHostNameBindingSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetHostNameBindingSlotPreparer prepares the GetHostNameBindingSlot request. +func (client AppsClient) GetHostNameBindingSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostName": autorest.Encode("path", hostName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings/{hostName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHostNameBindingSlotSender sends the GetHostNameBindingSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetHostNameBindingSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHostNameBindingSlotResponder handles the response to the GetHostNameBindingSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetHostNameBindingSlotResponder(resp *http.Response) (result HostNameBinding, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHybridConnection description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +func (client AppsClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHybridConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetHybridConnection", err.Error()) + } + + req, err := client.GetHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetHybridConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", resp, "Failure sending request") + return + } + + result, err = client.GetHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetHybridConnectionPreparer prepares the GetHybridConnection request. +func (client AppsClient) GetHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHybridConnectionSender sends the GetHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHybridConnectionResponder handles the response to the GetHybridConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) GetHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHybridConnectionSlot description for Retrieves a specific Service Bus Hybrid Connection used by this Web App. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetHybridConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetHybridConnectionSlot", err.Error()) + } + + req, err := client.GetHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetHybridConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetHybridConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetHybridConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetHybridConnectionSlotPreparer prepares the GetHybridConnectionSlot request. +func (client AppsClient) GetHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHybridConnectionSlotSender sends the GetHybridConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHybridConnectionSlotResponder handles the response to the GetHybridConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceFunctionSlot description for Get function information by its ID for web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionEnvelope, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceFunctionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceFunctionSlot", err.Error()) + } + + req, err := client.GetInstanceFunctionSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceFunctionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceFunctionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceFunctionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceFunctionSlotPreparer prepares the GetInstanceFunctionSlot request. +func (client AppsClient) GetInstanceFunctionSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceFunctionSlotSender sends the GetInstanceFunctionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceFunctionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceFunctionSlotResponder handles the response to the GetInstanceFunctionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceFunctionSlotResponder(resp *http.Response) (result FunctionEnvelope, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceInfo description for Gets all scale-out instances of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetInstanceInfo(ctx context.Context, resourceGroupName string, name string, instanceID string) (result SiteInstanceStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceInfo", err.Error()) + } + + req, err := client.GetInstanceInfoPreparer(ctx, resourceGroupName, name, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfo", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfo", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceInfoPreparer prepares the GetInstanceInfo request. +func (client AppsClient) GetInstanceInfoPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceInfoSender sends the GetInstanceInfo request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceInfoSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceInfoResponder handles the response to the GetInstanceInfo request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceInfoResponder(resp *http.Response) (result SiteInstanceStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceInfoSlot description for Gets all scale-out instances of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API gets the production slot instances. +func (client AppsClient) GetInstanceInfoSlot(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string) (result SiteInstanceStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceInfoSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceInfoSlot", err.Error()) + } + + req, err := client.GetInstanceInfoSlotPreparer(ctx, resourceGroupName, name, instanceID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfoSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceInfoSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfoSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceInfoSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceInfoSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceInfoSlotPreparer prepares the GetInstanceInfoSlot request. +func (client AppsClient) GetInstanceInfoSlotPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceInfoSlotSender sends the GetInstanceInfoSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceInfoSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceInfoSlotResponder handles the response to the GetInstanceInfoSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceInfoSlotResponder(resp *http.Response) (result SiteInstanceStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceMSDeployLog description for Get the MSDeploy Log for the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployLog, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLog") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLog", err.Error()) + } + + req, err := client.GetInstanceMSDeployLogPreparer(ctx, resourceGroupName, name, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceMSDeployLogSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceMSDeployLogResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLog", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceMSDeployLogPreparer prepares the GetInstanceMSDeployLog request. +func (client AppsClient) GetInstanceMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceMSDeployLogSender sends the GetInstanceMSDeployLog request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceMSDeployLogSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceMSDeployLogResponder handles the response to the GetInstanceMSDeployLog request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceMSDeployLogSlot description for Get the MSDeploy Log for the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployLog, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMSDeployLogSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceMSDeployLogSlot", err.Error()) + } + + req, err := client.GetInstanceMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceMSDeployLogSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceMSDeployLogSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMSDeployLogSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceMSDeployLogSlotPreparer prepares the GetInstanceMSDeployLogSlot request. +func (client AppsClient) GetInstanceMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceMSDeployLogSlotSender sends the GetInstanceMSDeployLogSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceMSDeployLogSlotResponder handles the response to the GetInstanceMSDeployLogSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceMsDeployStatus description for Get the status of the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result MSDeployStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatus", err.Error()) + } + + req, err := client.GetInstanceMsDeployStatusPreparer(ctx, resourceGroupName, name, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceMsDeployStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceMsDeployStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceMsDeployStatusPreparer prepares the GetInstanceMsDeployStatus request. +func (client AppsClient) GetInstanceMsDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceMsDeployStatusSender sends the GetInstanceMsDeployStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceMsDeployStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceMsDeployStatusResponder handles the response to the GetInstanceMsDeployStatus request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceMsDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceMsDeployStatusSlot description for Get the status of the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// instanceID - ID of web app instance. +func (client AppsClient) GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result MSDeployStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceMsDeployStatusSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceMsDeployStatusSlot", err.Error()) + } + + req, err := client.GetInstanceMsDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceMsDeployStatusSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceMsDeployStatusSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceMsDeployStatusSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceMsDeployStatusSlotPreparer prepares the GetInstanceMsDeployStatusSlot request. +func (client AppsClient) GetInstanceMsDeployStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/extensions/MSDeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceMsDeployStatusSlotSender sends the GetInstanceMsDeployStatusSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceMsDeployStatusSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceMsDeployStatusSlotResponder handles the response to the GetInstanceMsDeployStatusSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceMsDeployStatusSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceProcess description for Get process information by its ID for a specific scaled-out instance in a web +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcess") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceProcess", err.Error()) + } + + req, err := client.GetInstanceProcessPreparer(ctx, resourceGroupName, name, processID, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceProcessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceProcessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcess", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceProcessPreparer prepares the GetInstanceProcess request. +func (client AppsClient) GetInstanceProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceProcessSender sends the GetInstanceProcess request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceProcessSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceProcessResponder handles the response to the GetInstanceProcess request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceProcessResponder(resp *http.Response) (result ProcessInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceProcessDump description for Get a memory dump of a process by its ID for a specific scaled-out instance +// in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessDump") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceProcessDump", err.Error()) + } + + req, err := client.GetInstanceProcessDumpPreparer(ctx, resourceGroupName, name, processID, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceProcessDumpSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceProcessDumpResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDump", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceProcessDumpPreparer prepares the GetInstanceProcessDump request. +func (client AppsClient) GetInstanceProcessDumpPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/dump", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceProcessDumpSender sends the GetInstanceProcessDump request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceProcessDumpSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceProcessDumpResponder handles the response to the GetInstanceProcessDump request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceProcessDumpResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceProcessDumpSlot description for Get a memory dump of a process by its ID for a specific scaled-out +// instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessDumpSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceProcessDumpSlot", err.Error()) + } + + req, err := client.GetInstanceProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceProcessDumpSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceProcessDumpSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessDumpSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceProcessDumpSlotPreparer prepares the GetInstanceProcessDumpSlot request. +func (client AppsClient) GetInstanceProcessDumpSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/dump", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceProcessDumpSlotSender sends the GetInstanceProcessDumpSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceProcessDumpSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceProcessDumpSlotResponder handles the response to the GetInstanceProcessDumpSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceProcessDumpSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceProcessModule description for Get process information by its ID for a specific scaled-out instance in a +// web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// baseAddress - module base address. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (result ProcessModuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessModule") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceProcessModule", err.Error()) + } + + req, err := client.GetInstanceProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceProcessModuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceProcessModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModule", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceProcessModulePreparer prepares the GetInstanceProcessModule request. +func (client AppsClient) GetInstanceProcessModulePreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceProcessModuleSender sends the GetInstanceProcessModule request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceProcessModuleSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceProcessModuleResponder handles the response to the GetInstanceProcessModule request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceProcessModuleResponder(resp *http.Response) (result ProcessModuleInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceProcessModuleSlot description for Get process information by its ID for a specific scaled-out instance in +// a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// baseAddress - module base address. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (result ProcessModuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessModuleSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceProcessModuleSlot", err.Error()) + } + + req, err := client.GetInstanceProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceProcessModuleSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceProcessModuleSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessModuleSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceProcessModuleSlotPreparer prepares the GetInstanceProcessModuleSlot request. +func (client AppsClient) GetInstanceProcessModuleSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceProcessModuleSlotSender sends the GetInstanceProcessModuleSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceProcessModuleSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceProcessModuleSlotResponder handles the response to the GetInstanceProcessModuleSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceProcessModuleSlotResponder(resp *http.Response) (result ProcessModuleInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInstanceProcessSlot description for Get process information by its ID for a specific scaled-out instance in a web +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetInstanceProcessSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetInstanceProcessSlot", err.Error()) + } + + req, err := client.GetInstanceProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetInstanceProcessSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", resp, "Failure sending request") + return + } + + result, err = client.GetInstanceProcessSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetInstanceProcessSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetInstanceProcessSlotPreparer prepares the GetInstanceProcessSlot request. +func (client AppsClient) GetInstanceProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInstanceProcessSlotSender sends the GetInstanceProcessSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetInstanceProcessSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInstanceProcessSlotResponder handles the response to the GetInstanceProcessSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetInstanceProcessSlotResponder(resp *http.Response) (result ProcessInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMigrateMySQLStatus description for Returns the status of MySql in app migration, if one is active, and whether or +// not MySql in app is enabled +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result MigrateMySQLStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatus", err.Error()) + } + + req, err := client.GetMigrateMySQLStatusPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetMigrateMySQLStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure sending request") + return + } + + result, err = client.GetMigrateMySQLStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetMigrateMySQLStatusPreparer prepares the GetMigrateMySQLStatus request. +func (client AppsClient) GetMigrateMySQLStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql/status", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMigrateMySQLStatusSender sends the GetMigrateMySQLStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetMigrateMySQLStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMigrateMySQLStatusResponder handles the response to the GetMigrateMySQLStatus request. The method always +// closes the http.Response Body. +func (client AppsClient) GetMigrateMySQLStatusResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMigrateMySQLStatusSlot description for Returns the status of MySql in app migration, if one is active, and +// whether or not MySql in app is enabled +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of the deployment slot. +func (client AppsClient) GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MigrateMySQLStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMigrateMySQLStatusSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetMigrateMySQLStatusSlot", err.Error()) + } + + req, err := client.GetMigrateMySQLStatusSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetMigrateMySQLStatusSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure sending request") + return + } + + result, err = client.GetMigrateMySQLStatusSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMigrateMySQLStatusSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetMigrateMySQLStatusSlotPreparer prepares the GetMigrateMySQLStatusSlot request. +func (client AppsClient) GetMigrateMySQLStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/migratemysql/status", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMigrateMySQLStatusSlotSender sends the GetMigrateMySQLStatusSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetMigrateMySQLStatusSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMigrateMySQLStatusSlotResponder handles the response to the GetMigrateMySQLStatusSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetMigrateMySQLStatusSlotResponder(resp *http.Response) (result MigrateMySQLStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMSDeployLog description for Get the MSDeploy Log for the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result MSDeployLog, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLog") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetMSDeployLog", err.Error()) + } + + req, err := client.GetMSDeployLogPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", nil, "Failure preparing request") + return + } + + resp, err := client.GetMSDeployLogSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure sending request") + return + } + + result, err = client.GetMSDeployLogResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLog", resp, "Failure responding to request") + return + } + + return +} + +// GetMSDeployLogPreparer prepares the GetMSDeployLog request. +func (client AppsClient) GetMSDeployLogPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMSDeployLogSender sends the GetMSDeployLog request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetMSDeployLogSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMSDeployLogResponder handles the response to the GetMSDeployLog request. The method always +// closes the http.Response Body. +func (client AppsClient) GetMSDeployLogResponder(resp *http.Response) (result MSDeployLog, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMSDeployLogSlot description for Get the MSDeploy Log for the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployLog, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployLogSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetMSDeployLogSlot", err.Error()) + } + + req, err := client.GetMSDeployLogSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetMSDeployLogSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", resp, "Failure sending request") + return + } + + result, err = client.GetMSDeployLogSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployLogSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetMSDeployLogSlotPreparer prepares the GetMSDeployLogSlot request. +func (client AppsClient) GetMSDeployLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMSDeployLogSlotSender sends the GetMSDeployLogSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetMSDeployLogSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMSDeployLogSlotResponder handles the response to the GetMSDeployLogSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetMSDeployLogSlotResponder(resp *http.Response) (result MSDeployLog, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMSDeployStatus description for Get the status of the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetMSDeployStatus(ctx context.Context, resourceGroupName string, name string) (result MSDeployStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetMSDeployStatus", err.Error()) + } + + req, err := client.GetMSDeployStatusPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetMSDeployStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", resp, "Failure sending request") + return + } + + result, err = client.GetMSDeployStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetMSDeployStatusPreparer prepares the GetMSDeployStatus request. +func (client AppsClient) GetMSDeployStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/extensions/MSDeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMSDeployStatusSender sends the GetMSDeployStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetMSDeployStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMSDeployStatusResponder handles the response to the GetMSDeployStatus request. The method always +// closes the http.Response Body. +func (client AppsClient) GetMSDeployStatusResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetMSDeployStatusSlot description for Get the status of the last MSDeploy operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetMSDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result MSDeployStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetMSDeployStatusSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetMSDeployStatusSlot", err.Error()) + } + + req, err := client.GetMSDeployStatusSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetMSDeployStatusSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", resp, "Failure sending request") + return + } + + result, err = client.GetMSDeployStatusSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetMSDeployStatusSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetMSDeployStatusSlotPreparer prepares the GetMSDeployStatusSlot request. +func (client AppsClient) GetMSDeployStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/extensions/MSDeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMSDeployStatusSlotSender sends the GetMSDeployStatusSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetMSDeployStatusSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMSDeployStatusSlotResponder handles the response to the GetMSDeployStatusSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetMSDeployStatusSlotResponder(resp *http.Response) (result MSDeployStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTraceOperation description for Gets a named operation for a network trace capturing (or deployment slot, +// if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperation", err.Error()) + } + + req, err := client.GetNetworkTraceOperationPreparer(ctx, resourceGroupName, name, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTraceOperationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTraceOperationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperation", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTraceOperationPreparer prepares the GetNetworkTraceOperation request. +func (client AppsClient) GetNetworkTraceOperationPreparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/operationresults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTraceOperationSender sends the GetNetworkTraceOperation request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTraceOperationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTraceOperationResponder handles the response to the GetNetworkTraceOperation request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTraceOperationResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTraceOperationSlot description for Gets a named operation for a network trace capturing (or deployment +// slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// production slot. +func (client AppsClient) GetNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationSlot", err.Error()) + } + + req, err := client.GetNetworkTraceOperationSlotPreparer(ctx, resourceGroupName, name, operationID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTraceOperationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTraceOperationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTraceOperationSlotPreparer prepares the GetNetworkTraceOperationSlot request. +func (client AppsClient) GetNetworkTraceOperationSlotPreparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/operationresults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTraceOperationSlotSender sends the GetNetworkTraceOperationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTraceOperationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTraceOperationSlotResponder handles the response to the GetNetworkTraceOperationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTraceOperationSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTraceOperationSlotV2 description for Gets a named operation for a network trace capturing (or deployment +// slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// production slot. +func (client AppsClient) GetNetworkTraceOperationSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationSlotV2") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationSlotV2", err.Error()) + } + + req, err := client.GetNetworkTraceOperationSlotV2Preparer(ctx, resourceGroupName, name, operationID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTraceOperationSlotV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTraceOperationSlotV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationSlotV2", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTraceOperationSlotV2Preparer prepares the GetNetworkTraceOperationSlotV2 request. +func (client AppsClient) GetNetworkTraceOperationSlotV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/current/operationresults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTraceOperationSlotV2Sender sends the GetNetworkTraceOperationSlotV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTraceOperationSlotV2Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTraceOperationSlotV2Responder handles the response to the GetNetworkTraceOperationSlotV2 request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTraceOperationSlotV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTraceOperationV2 description for Gets a named operation for a network trace capturing (or deployment slot, +// if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTraceOperationV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraceOperationV2") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTraceOperationV2", err.Error()) + } + + req, err := client.GetNetworkTraceOperationV2Preparer(ctx, resourceGroupName, name, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTraceOperationV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTraceOperationV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraceOperationV2", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTraceOperationV2Preparer prepares the GetNetworkTraceOperationV2 request. +func (client AppsClient) GetNetworkTraceOperationV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/current/operationresults/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTraceOperationV2Sender sends the GetNetworkTraceOperationV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTraceOperationV2Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTraceOperationV2Responder handles the response to the GetNetworkTraceOperationV2 request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTraceOperationV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTraces description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTraces(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTraces") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTraces", err.Error()) + } + + req, err := client.GetNetworkTracesPreparer(ctx, resourceGroupName, name, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTracesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTracesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTraces", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTracesPreparer prepares the GetNetworkTraces request. +func (client AppsClient) GetNetworkTracesPreparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTracesSender sends the GetNetworkTraces request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTracesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTracesResponder handles the response to the GetNetworkTraces request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTracesResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTracesSlot description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// production slot. +func (client AppsClient) GetNetworkTracesSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTracesSlot", err.Error()) + } + + req, err := client.GetNetworkTracesSlotPreparer(ctx, resourceGroupName, name, operationID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTracesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTracesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTracesSlotPreparer prepares the GetNetworkTracesSlot request. +func (client AppsClient) GetNetworkTracesSlotPreparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTracesSlotSender sends the GetNetworkTracesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTracesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTracesSlotResponder handles the response to the GetNetworkTracesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTracesSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTracesSlotV2 description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +// slot - name of the deployment slot. If a slot is not specified, the API will get an operation for the +// production slot. +func (client AppsClient) GetNetworkTracesSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesSlotV2") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTracesSlotV2", err.Error()) + } + + req, err := client.GetNetworkTracesSlotV2Preparer(ctx, resourceGroupName, name, operationID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTracesSlotV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTracesSlotV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesSlotV2", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTracesSlotV2Preparer prepares the GetNetworkTracesSlotV2 request. +func (client AppsClient) GetNetworkTracesSlotV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTraces/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTracesSlotV2Sender sends the GetNetworkTracesSlotV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTracesSlotV2Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTracesSlotV2Responder handles the response to the GetNetworkTracesSlotV2 request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTracesSlotV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetNetworkTracesV2 description for Gets a named operation for a network trace capturing (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// operationID - GUID of the operation. +func (client AppsClient) GetNetworkTracesV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result ListNetworkTrace, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetNetworkTracesV2") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetNetworkTracesV2", err.Error()) + } + + req, err := client.GetNetworkTracesV2Preparer(ctx, resourceGroupName, name, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", nil, "Failure preparing request") + return + } + + resp, err := client.GetNetworkTracesV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", resp, "Failure sending request") + return + } + + result, err = client.GetNetworkTracesV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetNetworkTracesV2", resp, "Failure responding to request") + return + } + + return +} + +// GetNetworkTracesV2Preparer prepares the GetNetworkTracesV2 request. +func (client AppsClient) GetNetworkTracesV2Preparer(ctx context.Context, resourceGroupName string, name string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "operationId": autorest.Encode("path", operationID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTraces/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetNetworkTracesV2Sender sends the GetNetworkTracesV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetNetworkTracesV2Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetNetworkTracesV2Responder handles the response to the GetNetworkTracesV2 request. The method always +// closes the http.Response Body. +func (client AppsClient) GetNetworkTracesV2Responder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPremierAddOn description for Gets a named add-on of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +func (client AppsClient) GetPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPremierAddOn") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPremierAddOn", err.Error()) + } + + req, err := client.GetPremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", nil, "Failure preparing request") + return + } + + resp, err := client.GetPremierAddOnSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", resp, "Failure sending request") + return + } + + result, err = client.GetPremierAddOnResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOn", resp, "Failure responding to request") + return + } + + return +} + +// GetPremierAddOnPreparer prepares the GetPremierAddOn request. +func (client AppsClient) GetPremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPremierAddOnSender sends the GetPremierAddOn request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPremierAddOnSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPremierAddOnResponder handles the response to the GetPremierAddOn request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPremierAddOnResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPremierAddOnSlot description for Gets a named add-on of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +// slot - name of the deployment slot. If a slot is not specified, the API will get the named add-on for the +// production slot. +func (client AppsClient) GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPremierAddOnSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPremierAddOnSlot", err.Error()) + } + + req, err := client.GetPremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetPremierAddOnSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", resp, "Failure sending request") + return + } + + result, err = client.GetPremierAddOnSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPremierAddOnSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetPremierAddOnSlotPreparer prepares the GetPremierAddOnSlot request. +func (client AppsClient) GetPremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPremierAddOnSlotSender sends the GetPremierAddOnSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPremierAddOnSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPremierAddOnSlotResponder handles the response to the GetPremierAddOnSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPremierAddOnSlotResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateAccess description for Gets data around private site access enablement and authorized Virtual Networks +// that can access the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +func (client AppsClient) GetPrivateAccess(ctx context.Context, resourceGroupName string, name string) (result PrivateAccess, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateAccess") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateAccess", err.Error()) + } + + req, err := client.GetPrivateAccessPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateAccessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateAccessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccess", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateAccessPreparer prepares the GetPrivateAccess request. +func (client AppsClient) GetPrivateAccessPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateAccessSender sends the GetPrivateAccess request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateAccessSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateAccessResponder handles the response to the GetPrivateAccess request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateAccessResponder(resp *http.Response) (result PrivateAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateAccessSlot description for Gets data around private site access enablement and authorized Virtual Networks +// that can access the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for the web app. +func (client AppsClient) GetPrivateAccessSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PrivateAccess, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateAccessSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateAccessSlot", err.Error()) + } + + req, err := client.GetPrivateAccessSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateAccessSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateAccessSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateAccessSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateAccessSlotPreparer prepares the GetPrivateAccessSlot request. +func (client AppsClient) GetPrivateAccessSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateAccessSlotSender sends the GetPrivateAccessSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateAccessSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateAccessSlotResponder handles the response to the GetPrivateAccessSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateAccessSlotResponder(resp *http.Response) (result PrivateAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateEndpointConnection description for Gets a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +// privateEndpointConnectionName - name of the private endpoint connection. +func (client AppsClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result RemotePrivateEndpointConnectionARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateEndpointConnection", err.Error()) + } + + req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. +func (client AppsClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateEndpointConnectionResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateEndpointConnectionList description for Gets the list of private endpoint connections associated with a +// site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) GetPrivateEndpointConnectionList(ctx context.Context, resourceGroupName string, name string) (result PrivateEndpointConnectionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnectionList") + defer func() { + sc := -1 + if result.pecc.Response.Response != nil { + sc = result.pecc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateEndpointConnectionList", err.Error()) + } + + result.fn = client.getPrivateEndpointConnectionListNextResults + req, err := client.GetPrivateEndpointConnectionListPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionList", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionListSender(req) + if err != nil { + result.pecc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionList", resp, "Failure sending request") + return + } + + result.pecc, err = client.GetPrivateEndpointConnectionListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionList", resp, "Failure responding to request") + return + } + if result.pecc.hasNextLink() && result.pecc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetPrivateEndpointConnectionListPreparer prepares the GetPrivateEndpointConnectionList request. +func (client AppsClient) GetPrivateEndpointConnectionListPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionListSender sends the GetPrivateEndpointConnectionList request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateEndpointConnectionListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionListResponder handles the response to the GetPrivateEndpointConnectionList request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateEndpointConnectionListResponder(resp *http.Response) (result PrivateEndpointConnectionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getPrivateEndpointConnectionListNextResults retrieves the next set of results, if any. +func (client AppsClient) getPrivateEndpointConnectionListNextResults(ctx context.Context, lastResults PrivateEndpointConnectionCollection) (result PrivateEndpointConnectionCollection, err error) { + req, err := lastResults.privateEndpointConnectionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getPrivateEndpointConnectionListNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetPrivateEndpointConnectionListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getPrivateEndpointConnectionListNextResults", resp, "Failure sending next results request") + } + result, err = client.GetPrivateEndpointConnectionListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "getPrivateEndpointConnectionListNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetPrivateEndpointConnectionListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) GetPrivateEndpointConnectionListComplete(ctx context.Context, resourceGroupName string, name string) (result PrivateEndpointConnectionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnectionList") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetPrivateEndpointConnectionList(ctx, resourceGroupName, name) + return +} + +// GetPrivateEndpointConnectionListSlot description for Gets the list of private endpoint connections associated with a +// site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +// slot - name of the site deployment slot. +func (client AppsClient) GetPrivateEndpointConnectionListSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PrivateEndpointConnectionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnectionListSlot") + defer func() { + sc := -1 + if result.pecc.Response.Response != nil { + sc = result.pecc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateEndpointConnectionListSlot", err.Error()) + } + + result.fn = client.getPrivateEndpointConnectionListSlotNextResults + req, err := client.GetPrivateEndpointConnectionListSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionListSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionListSlotSender(req) + if err != nil { + result.pecc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionListSlot", resp, "Failure sending request") + return + } + + result.pecc, err = client.GetPrivateEndpointConnectionListSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionListSlot", resp, "Failure responding to request") + return + } + if result.pecc.hasNextLink() && result.pecc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetPrivateEndpointConnectionListSlotPreparer prepares the GetPrivateEndpointConnectionListSlot request. +func (client AppsClient) GetPrivateEndpointConnectionListSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionListSlotSender sends the GetPrivateEndpointConnectionListSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateEndpointConnectionListSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionListSlotResponder handles the response to the GetPrivateEndpointConnectionListSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateEndpointConnectionListSlotResponder(resp *http.Response) (result PrivateEndpointConnectionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getPrivateEndpointConnectionListSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) getPrivateEndpointConnectionListSlotNextResults(ctx context.Context, lastResults PrivateEndpointConnectionCollection) (result PrivateEndpointConnectionCollection, err error) { + req, err := lastResults.privateEndpointConnectionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getPrivateEndpointConnectionListSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetPrivateEndpointConnectionListSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getPrivateEndpointConnectionListSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.GetPrivateEndpointConnectionListSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "getPrivateEndpointConnectionListSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetPrivateEndpointConnectionListSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) GetPrivateEndpointConnectionListSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result PrivateEndpointConnectionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnectionListSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetPrivateEndpointConnectionListSlot(ctx, resourceGroupName, name, slot) + return +} + +// GetPrivateEndpointConnectionSlot description for Gets a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +// privateEndpointConnectionName - name of the private endpoint connection. +// slot - name of the site deployment slot. +func (client AppsClient) GetPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string) (result RemotePrivateEndpointConnectionARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateEndpointConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateEndpointConnectionSlot", err.Error()) + } + + req, err := client.GetPrivateEndpointConnectionSlotPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateEndpointConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateEndpointConnectionSlotPreparer prepares the GetPrivateEndpointConnectionSlot request. +func (client AppsClient) GetPrivateEndpointConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionSlotSender sends the GetPrivateEndpointConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateEndpointConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionSlotResponder handles the response to the GetPrivateEndpointConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateEndpointConnectionSlotResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateLinkResources description for Gets the private link resources +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result PrivateLinkResourcesWrapper, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateLinkResources") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateLinkResources", err.Error()) + } + + req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResources", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResources", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. +func (client AppsClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourcesWrapper, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateLinkResourcesSlot description for Gets the private link resources +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client AppsClient) GetPrivateLinkResourcesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PrivateLinkResourcesWrapper, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPrivateLinkResourcesSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPrivateLinkResourcesSlot", err.Error()) + } + + req, err := client.GetPrivateLinkResourcesSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResourcesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResourcesSlot", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPrivateLinkResourcesSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcesSlotPreparer prepares the GetPrivateLinkResourcesSlot request. +func (client AppsClient) GetPrivateLinkResourcesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSlotSender sends the GetPrivateLinkResourcesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPrivateLinkResourcesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesSlotResponder handles the response to the GetPrivateLinkResourcesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPrivateLinkResourcesSlotResponder(resp *http.Response) (result PrivateLinkResourcesWrapper, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProcess description for Get process information by its ID for a specific scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +func (client AppsClient) GetProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcess") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetProcess", err.Error()) + } + + req, err := client.GetProcessPreparer(ctx, resourceGroupName, name, processID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", nil, "Failure preparing request") + return + } + + resp, err := client.GetProcessSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", resp, "Failure sending request") + return + } + + result, err = client.GetProcessResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcess", resp, "Failure responding to request") + return + } + + return +} + +// GetProcessPreparer prepares the GetProcess request. +func (client AppsClient) GetProcessPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProcessSender sends the GetProcess request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetProcessSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetProcessResponder handles the response to the GetProcess request. The method always +// closes the http.Response Body. +func (client AppsClient) GetProcessResponder(resp *http.Response) (result ProcessInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProcessDump description for Get a memory dump of a process by its ID for a specific scaled-out instance in a web +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +func (client AppsClient) GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessDump") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetProcessDump", err.Error()) + } + + req, err := client.GetProcessDumpPreparer(ctx, resourceGroupName, name, processID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", nil, "Failure preparing request") + return + } + + resp, err := client.GetProcessDumpSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", resp, "Failure sending request") + return + } + + result, err = client.GetProcessDumpResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDump", resp, "Failure responding to request") + return + } + + return +} + +// GetProcessDumpPreparer prepares the GetProcessDump request. +func (client AppsClient) GetProcessDumpPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/dump", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProcessDumpSender sends the GetProcessDump request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetProcessDumpSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetProcessDumpResponder handles the response to the GetProcessDump request. The method always +// closes the http.Response Body. +func (client AppsClient) GetProcessDumpResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProcessDumpSlot description for Get a memory dump of a process by its ID for a specific scaled-out instance in a +// web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessDumpSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetProcessDumpSlot", err.Error()) + } + + req, err := client.GetProcessDumpSlotPreparer(ctx, resourceGroupName, name, processID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetProcessDumpSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", resp, "Failure sending request") + return + } + + result, err = client.GetProcessDumpSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessDumpSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetProcessDumpSlotPreparer prepares the GetProcessDumpSlot request. +func (client AppsClient) GetProcessDumpSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/dump", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProcessDumpSlotSender sends the GetProcessDumpSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetProcessDumpSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetProcessDumpSlotResponder handles the response to the GetProcessDumpSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetProcessDumpSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProcessModule description for Get process information by its ID for a specific scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// baseAddress - module base address. +func (client AppsClient) GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (result ProcessModuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessModule") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetProcessModule", err.Error()) + } + + req, err := client.GetProcessModulePreparer(ctx, resourceGroupName, name, processID, baseAddress) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", nil, "Failure preparing request") + return + } + + resp, err := client.GetProcessModuleSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", resp, "Failure sending request") + return + } + + result, err = client.GetProcessModuleResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModule", resp, "Failure responding to request") + return + } + + return +} + +// GetProcessModulePreparer prepares the GetProcessModule request. +func (client AppsClient) GetProcessModulePreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProcessModuleSender sends the GetProcessModule request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetProcessModuleSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetProcessModuleResponder handles the response to the GetProcessModule request. The method always +// closes the http.Response Body. +func (client AppsClient) GetProcessModuleResponder(resp *http.Response) (result ProcessModuleInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProcessModuleSlot description for Get process information by its ID for a specific scaled-out instance in a web +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// baseAddress - module base address. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (result ProcessModuleInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessModuleSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetProcessModuleSlot", err.Error()) + } + + req, err := client.GetProcessModuleSlotPreparer(ctx, resourceGroupName, name, processID, baseAddress, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetProcessModuleSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", resp, "Failure sending request") + return + } + + result, err = client.GetProcessModuleSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessModuleSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetProcessModuleSlotPreparer prepares the GetProcessModuleSlot request. +func (client AppsClient) GetProcessModuleSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "baseAddress": autorest.Encode("path", baseAddress), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules/{baseAddress}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProcessModuleSlotSender sends the GetProcessModuleSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetProcessModuleSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetProcessModuleSlotResponder handles the response to the GetProcessModuleSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetProcessModuleSlotResponder(resp *http.Response) (result ProcessModuleInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetProcessSlot description for Get process information by its ID for a specific scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetProcessSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetProcessSlot", err.Error()) + } + + req, err := client.GetProcessSlotPreparer(ctx, resourceGroupName, name, processID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetProcessSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", resp, "Failure sending request") + return + } + + result, err = client.GetProcessSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetProcessSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetProcessSlotPreparer prepares the GetProcessSlot request. +func (client AppsClient) GetProcessSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetProcessSlotSender sends the GetProcessSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetProcessSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetProcessSlotResponder handles the response to the GetProcessSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetProcessSlotResponder(resp *http.Response) (result ProcessInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPublicCertificate description for Get the named public certificate for an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// publicCertificateName - public certificate name. +func (client AppsClient) GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result PublicCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPublicCertificate", err.Error()) + } + + req, err := client.GetPublicCertificatePreparer(ctx, resourceGroupName, name, publicCertificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.GetPublicCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure sending request") + return + } + + result, err = client.GetPublicCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificate", resp, "Failure responding to request") + return + } + + return +} + +// GetPublicCertificatePreparer prepares the GetPublicCertificate request. +func (client AppsClient) GetPublicCertificatePreparer(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPublicCertificateSender sends the GetPublicCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPublicCertificateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPublicCertificateResponder handles the response to the GetPublicCertificate request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPublicCertificateResponder(resp *http.Response) (result PublicCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPublicCertificateSlot description for Get the named public certificate for an app (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API the named binding for the production +// slot. +// publicCertificateName - public certificate name. +func (client AppsClient) GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result PublicCertificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetPublicCertificateSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetPublicCertificateSlot", err.Error()) + } + + req, err := client.GetPublicCertificateSlotPreparer(ctx, resourceGroupName, name, slot, publicCertificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetPublicCertificateSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure sending request") + return + } + + result, err = client.GetPublicCertificateSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetPublicCertificateSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetPublicCertificateSlotPreparer prepares the GetPublicCertificateSlot request. +func (client AppsClient) GetPublicCertificateSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "publicCertificateName": autorest.Encode("path", publicCertificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates/{publicCertificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPublicCertificateSlotSender sends the GetPublicCertificateSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetPublicCertificateSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPublicCertificateSlotResponder handles the response to the GetPublicCertificateSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetPublicCertificateSlotResponder(resp *http.Response) (result PublicCertificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRelayServiceConnection description for Gets a hybrid connection configuration by its name. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection. +func (client AppsClient) GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnection", err.Error()) + } + + req, err := client.GetRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetRelayServiceConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", resp, "Failure sending request") + return + } + + result, err = client.GetRelayServiceConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetRelayServiceConnectionPreparer prepares the GetRelayServiceConnection request. +func (client AppsClient) GetRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRelayServiceConnectionSender sends the GetRelayServiceConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRelayServiceConnectionResponder handles the response to the GetRelayServiceConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) GetRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRelayServiceConnectionSlot description for Gets a hybrid connection configuration by its name. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection. +// slot - name of the deployment slot. If a slot is not specified, the API will get a hybrid connection for the +// production slot. +func (client AppsClient) GetRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetRelayServiceConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetRelayServiceConnectionSlot", err.Error()) + } + + req, err := client.GetRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetRelayServiceConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetRelayServiceConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetRelayServiceConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetRelayServiceConnectionSlotPreparer prepares the GetRelayServiceConnectionSlot request. +func (client AppsClient) GetRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRelayServiceConnectionSlotSender sends the GetRelayServiceConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRelayServiceConnectionSlotResponder handles the response to the GetRelayServiceConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetScmAllowed description for Returns whether Scm basic auth is allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetScmAllowed(ctx context.Context, resourceGroupName string, name string) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetScmAllowed") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetScmAllowed", err.Error()) + } + + req, err := client.GetScmAllowedPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetScmAllowed", nil, "Failure preparing request") + return + } + + resp, err := client.GetScmAllowedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetScmAllowed", resp, "Failure sending request") + return + } + + result, err = client.GetScmAllowedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetScmAllowed", resp, "Failure responding to request") + return + } + + return +} + +// GetScmAllowedPreparer prepares the GetScmAllowed request. +func (client AppsClient) GetScmAllowedPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetScmAllowedSender sends the GetScmAllowed request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetScmAllowedSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetScmAllowedResponder handles the response to the GetScmAllowed request. The method always +// closes the http.Response Body. +func (client AppsClient) GetScmAllowedResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetScmAllowedSlot description for Returns whether Scm basic auth is allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetScmAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetScmAllowedSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetScmAllowedSlot", err.Error()) + } + + req, err := client.GetScmAllowedSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetScmAllowedSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetScmAllowedSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetScmAllowedSlot", resp, "Failure sending request") + return + } + + result, err = client.GetScmAllowedSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetScmAllowedSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetScmAllowedSlotPreparer prepares the GetScmAllowedSlot request. +func (client AppsClient) GetScmAllowedSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetScmAllowedSlotSender sends the GetScmAllowedSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetScmAllowedSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetScmAllowedSlotResponder handles the response to the GetScmAllowedSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetScmAllowedSlotResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteConnectionStringKeyVaultReference description for Gets the config reference and status of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetSiteConnectionStringKeyVaultReference(ctx context.Context, resourceGroupName string, name string, connectionStringKey string) (result APIKVReference, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteConnectionStringKeyVaultReference") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSiteConnectionStringKeyVaultReference", err.Error()) + } + + req, err := client.GetSiteConnectionStringKeyVaultReferencePreparer(ctx, resourceGroupName, name, connectionStringKey) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReference", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteConnectionStringKeyVaultReferenceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReference", resp, "Failure sending request") + return + } + + result, err = client.GetSiteConnectionStringKeyVaultReferenceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReference", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteConnectionStringKeyVaultReferencePreparer prepares the GetSiteConnectionStringKeyVaultReference request. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencePreparer(ctx context.Context, resourceGroupName string, name string, connectionStringKey string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionStringKey": autorest.Encode("path", connectionStringKey), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings/{connectionStringKey}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteConnectionStringKeyVaultReferenceSender sends the GetSiteConnectionStringKeyVaultReference request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferenceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteConnectionStringKeyVaultReferenceResponder handles the response to the GetSiteConnectionStringKeyVaultReference request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferenceResponder(resp *http.Response) (result APIKVReference, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteConnectionStringKeyVaultReferences description for Gets the config reference app settings and status of an +// app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferences(ctx context.Context, resourceGroupName string, name string) (result APIKVReferenceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteConnectionStringKeyVaultReferences") + defer func() { + sc := -1 + if result.arc.Response.Response != nil { + sc = result.arc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSiteConnectionStringKeyVaultReferences", err.Error()) + } + + result.fn = client.getSiteConnectionStringKeyVaultReferencesNextResults + req, err := client.GetSiteConnectionStringKeyVaultReferencesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferences", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteConnectionStringKeyVaultReferencesSender(req) + if err != nil { + result.arc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferences", resp, "Failure sending request") + return + } + + result.arc, err = client.GetSiteConnectionStringKeyVaultReferencesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferences", resp, "Failure responding to request") + return + } + if result.arc.hasNextLink() && result.arc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetSiteConnectionStringKeyVaultReferencesPreparer prepares the GetSiteConnectionStringKeyVaultReferences request. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/configreferences/connectionstrings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteConnectionStringKeyVaultReferencesSender sends the GetSiteConnectionStringKeyVaultReferences request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteConnectionStringKeyVaultReferencesResponder handles the response to the GetSiteConnectionStringKeyVaultReferences request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesResponder(resp *http.Response) (result APIKVReferenceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getSiteConnectionStringKeyVaultReferencesNextResults retrieves the next set of results, if any. +func (client AppsClient) getSiteConnectionStringKeyVaultReferencesNextResults(ctx context.Context, lastResults APIKVReferenceCollection) (result APIKVReferenceCollection, err error) { + req, err := lastResults.aPIKVReferenceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getSiteConnectionStringKeyVaultReferencesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSiteConnectionStringKeyVaultReferencesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getSiteConnectionStringKeyVaultReferencesNextResults", resp, "Failure sending next results request") + } + result, err = client.GetSiteConnectionStringKeyVaultReferencesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "getSiteConnectionStringKeyVaultReferencesNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetSiteConnectionStringKeyVaultReferencesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesComplete(ctx context.Context, resourceGroupName string, name string) (result APIKVReferenceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteConnectionStringKeyVaultReferences") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetSiteConnectionStringKeyVaultReferences(ctx, resourceGroupName, name) + return +} + +// GetSiteConnectionStringKeyVaultReferenceSlot description for Gets the config reference and status of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferenceSlot(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, slot string) (result APIKVReference, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteConnectionStringKeyVaultReferenceSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSiteConnectionStringKeyVaultReferenceSlot", err.Error()) + } + + req, err := client.GetSiteConnectionStringKeyVaultReferenceSlotPreparer(ctx, resourceGroupName, name, connectionStringKey, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferenceSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteConnectionStringKeyVaultReferenceSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferenceSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSiteConnectionStringKeyVaultReferenceSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferenceSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteConnectionStringKeyVaultReferenceSlotPreparer prepares the GetSiteConnectionStringKeyVaultReferenceSlot request. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferenceSlotPreparer(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "connectionStringKey": autorest.Encode("path", connectionStringKey), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings/{connectionStringKey}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteConnectionStringKeyVaultReferenceSlotSender sends the GetSiteConnectionStringKeyVaultReferenceSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferenceSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteConnectionStringKeyVaultReferenceSlotResponder handles the response to the GetSiteConnectionStringKeyVaultReferenceSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferenceSlotResponder(resp *http.Response) (result APIKVReference, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteConnectionStringKeyVaultReferencesSlot description for Gets the config reference app settings and status of +// an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result APIKVReferenceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteConnectionStringKeyVaultReferencesSlot") + defer func() { + sc := -1 + if result.arc.Response.Response != nil { + sc = result.arc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSiteConnectionStringKeyVaultReferencesSlot", err.Error()) + } + + result.fn = client.getSiteConnectionStringKeyVaultReferencesSlotNextResults + req, err := client.GetSiteConnectionStringKeyVaultReferencesSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferencesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteConnectionStringKeyVaultReferencesSlotSender(req) + if err != nil { + result.arc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferencesSlot", resp, "Failure sending request") + return + } + + result.arc, err = client.GetSiteConnectionStringKeyVaultReferencesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteConnectionStringKeyVaultReferencesSlot", resp, "Failure responding to request") + return + } + if result.arc.hasNextLink() && result.arc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetSiteConnectionStringKeyVaultReferencesSlotPreparer prepares the GetSiteConnectionStringKeyVaultReferencesSlot request. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/configreferences/connectionstrings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteConnectionStringKeyVaultReferencesSlotSender sends the GetSiteConnectionStringKeyVaultReferencesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteConnectionStringKeyVaultReferencesSlotResponder handles the response to the GetSiteConnectionStringKeyVaultReferencesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesSlotResponder(resp *http.Response) (result APIKVReferenceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getSiteConnectionStringKeyVaultReferencesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) getSiteConnectionStringKeyVaultReferencesSlotNextResults(ctx context.Context, lastResults APIKVReferenceCollection) (result APIKVReferenceCollection, err error) { + req, err := lastResults.aPIKVReferenceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getSiteConnectionStringKeyVaultReferencesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetSiteConnectionStringKeyVaultReferencesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "getSiteConnectionStringKeyVaultReferencesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.GetSiteConnectionStringKeyVaultReferencesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "getSiteConnectionStringKeyVaultReferencesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetSiteConnectionStringKeyVaultReferencesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) GetSiteConnectionStringKeyVaultReferencesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result APIKVReferenceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteConnectionStringKeyVaultReferencesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetSiteConnectionStringKeyVaultReferencesSlot(ctx, resourceGroupName, name, slot) + return +} + +// GetSiteExtension description for Get site extension information by its ID for a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +func (client AppsClient) GetSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result SiteExtensionInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtension") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSiteExtension", err.Error()) + } + + req, err := client.GetSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteExtensionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", resp, "Failure sending request") + return + } + + result, err = client.GetSiteExtensionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtension", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteExtensionPreparer prepares the GetSiteExtension request. +func (client AppsClient) GetSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteExtensionSender sends the GetSiteExtension request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSiteExtensionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteExtensionResponder handles the response to the GetSiteExtension request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSiteExtensionResponder(resp *http.Response) (result SiteExtensionInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteExtensionSlot description for Get site extension information by its ID for a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result SiteExtensionInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSiteExtensionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSiteExtensionSlot", err.Error()) + } + + req, err := client.GetSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteExtensionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSiteExtensionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSiteExtensionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteExtensionSlotPreparer prepares the GetSiteExtensionSlot request. +func (client AppsClient) GetSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteExtensionSlotSender sends the GetSiteExtensionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSiteExtensionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteExtensionSlotResponder handles the response to the GetSiteExtensionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSiteExtensionSlotResponder(resp *http.Response) (result SiteExtensionInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSitePhpErrorLogFlag description for Gets web app's event logs. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetSitePhpErrorLogFlag(ctx context.Context, resourceGroupName string, name string) (result SitePhpErrorLogFlag, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSitePhpErrorLogFlag") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlag", err.Error()) + } + + req, err := client.GetSitePhpErrorLogFlagPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", nil, "Failure preparing request") + return + } + + resp, err := client.GetSitePhpErrorLogFlagSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", resp, "Failure sending request") + return + } + + result, err = client.GetSitePhpErrorLogFlagResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlag", resp, "Failure responding to request") + return + } + + return +} + +// GetSitePhpErrorLogFlagPreparer prepares the GetSitePhpErrorLogFlag request. +func (client AppsClient) GetSitePhpErrorLogFlagPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/phplogging", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSitePhpErrorLogFlagSender sends the GetSitePhpErrorLogFlag request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSitePhpErrorLogFlagSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSitePhpErrorLogFlagResponder handles the response to the GetSitePhpErrorLogFlag request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSitePhpErrorLogFlagResponder(resp *http.Response) (result SitePhpErrorLogFlag, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSitePhpErrorLogFlagSlot description for Gets web app's event logs. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetSitePhpErrorLogFlagSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SitePhpErrorLogFlag, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSitePhpErrorLogFlagSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSitePhpErrorLogFlagSlot", err.Error()) + } + + req, err := client.GetSitePhpErrorLogFlagSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSitePhpErrorLogFlagSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSitePhpErrorLogFlagSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSitePhpErrorLogFlagSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSitePhpErrorLogFlagSlotPreparer prepares the GetSitePhpErrorLogFlagSlot request. +func (client AppsClient) GetSitePhpErrorLogFlagSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/phplogging", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSitePhpErrorLogFlagSlotSender sends the GetSitePhpErrorLogFlagSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSitePhpErrorLogFlagSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSitePhpErrorLogFlagSlotResponder handles the response to the GetSitePhpErrorLogFlagSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSitePhpErrorLogFlagSlotResponder(resp *http.Response) (result SitePhpErrorLogFlag, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSlot description for Gets the details of a web, mobile, or API app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. By default, this API returns the production slot. +func (client AppsClient) GetSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result Site, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSlot", err.Error()) + } + + req, err := client.GetSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSlotPreparer prepares the GetSlot request. +func (client AppsClient) GetSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSlotSender sends the GetSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSlotResponder handles the response to the GetSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSlotResponder(resp *http.Response) (result Site, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSourceControl description for Gets the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetSourceControl(ctx context.Context, resourceGroupName string, name string) (result SiteSourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSourceControl") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSourceControl", err.Error()) + } + + req, err := client.GetSourceControlPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", nil, "Failure preparing request") + return + } + + resp, err := client.GetSourceControlSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", resp, "Failure sending request") + return + } + + result, err = client.GetSourceControlResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControl", resp, "Failure responding to request") + return + } + + return +} + +// GetSourceControlPreparer prepares the GetSourceControl request. +func (client AppsClient) GetSourceControlPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSourceControlSender sends the GetSourceControl request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSourceControlSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSourceControlResponder handles the response to the GetSourceControl request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSourceControlSlot description for Gets the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the source control +// configuration for the production slot. +func (client AppsClient) GetSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteSourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSourceControlSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSourceControlSlot", err.Error()) + } + + req, err := client.GetSourceControlSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSourceControlSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSourceControlSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSourceControlSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSourceControlSlotPreparer prepares the GetSourceControlSlot request. +func (client AppsClient) GetSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSourceControlSlotSender sends the GetSourceControlSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSourceControlSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSourceControlSlotResponder handles the response to the GetSourceControlSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSwiftVirtualNetworkConnection description for Gets a Swift Virtual Network connection. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) GetSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string) (result SwiftVirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSwiftVirtualNetworkConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSwiftVirtualNetworkConnection", err.Error()) + } + + req, err := client.GetSwiftVirtualNetworkConnectionPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetSwiftVirtualNetworkConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", resp, "Failure sending request") + return + } + + result, err = client.GetSwiftVirtualNetworkConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetSwiftVirtualNetworkConnectionPreparer prepares the GetSwiftVirtualNetworkConnection request. +func (client AppsClient) GetSwiftVirtualNetworkConnectionPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSwiftVirtualNetworkConnectionSender sends the GetSwiftVirtualNetworkConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSwiftVirtualNetworkConnectionResponder handles the response to the GetSwiftVirtualNetworkConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSwiftVirtualNetworkConnectionResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSwiftVirtualNetworkConnectionSlot description for Gets a Swift Virtual Network connection. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get a gateway for the +// production slot's Virtual Network. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SwiftVirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetSwiftVirtualNetworkConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", err.Error()) + } + + req, err := client.GetSwiftVirtualNetworkConnectionSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSwiftVirtualNetworkConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSwiftVirtualNetworkConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetSwiftVirtualNetworkConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSwiftVirtualNetworkConnectionSlotPreparer prepares the GetSwiftVirtualNetworkConnectionSlot request. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSwiftVirtualNetworkConnectionSlotSender sends the GetSwiftVirtualNetworkConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSwiftVirtualNetworkConnectionSlotResponder handles the response to the GetSwiftVirtualNetworkConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetSwiftVirtualNetworkConnectionSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTriggeredWebJob description for Gets a triggered web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) GetTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredWebJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJob") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJob", err.Error()) + } + + req, err := client.GetTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.GetTriggeredWebJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", resp, "Failure sending request") + return + } + + result, err = client.GetTriggeredWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJob", resp, "Failure responding to request") + return + } + + return +} + +// GetTriggeredWebJobPreparer prepares the GetTriggeredWebJob request. +func (client AppsClient) GetTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTriggeredWebJobSender sends the GetTriggeredWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetTriggeredWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTriggeredWebJobResponder handles the response to the GetTriggeredWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) GetTriggeredWebJobResponder(resp *http.Response) (result TriggeredWebJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTriggeredWebJobHistory description for Gets a triggered web job's history by its ID for an app, , or a deployment +// slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// ID - history ID. +func (client AppsClient) GetTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (result TriggeredJobHistory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistory") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistory", err.Error()) + } + + req, err := client.GetTriggeredWebJobHistoryPreparer(ctx, resourceGroupName, name, webJobName, ID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", nil, "Failure preparing request") + return + } + + resp, err := client.GetTriggeredWebJobHistorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", resp, "Failure sending request") + return + } + + result, err = client.GetTriggeredWebJobHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistory", resp, "Failure responding to request") + return + } + + return +} + +// GetTriggeredWebJobHistoryPreparer prepares the GetTriggeredWebJobHistory request. +func (client AppsClient) GetTriggeredWebJobHistoryPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history/{id}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTriggeredWebJobHistorySender sends the GetTriggeredWebJobHistory request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetTriggeredWebJobHistorySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTriggeredWebJobHistoryResponder handles the response to the GetTriggeredWebJobHistory request. The method always +// closes the http.Response Body. +func (client AppsClient) GetTriggeredWebJobHistoryResponder(resp *http.Response) (result TriggeredJobHistory, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTriggeredWebJobHistorySlot description for Gets a triggered web job's history by its ID for an app, , or a +// deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// ID - history ID. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (result TriggeredJobHistory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobHistorySlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobHistorySlot", err.Error()) + } + + req, err := client.GetTriggeredWebJobHistorySlotPreparer(ctx, resourceGroupName, name, webJobName, ID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetTriggeredWebJobHistorySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", resp, "Failure sending request") + return + } + + result, err = client.GetTriggeredWebJobHistorySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobHistorySlot", resp, "Failure responding to request") + return + } + + return +} + +// GetTriggeredWebJobHistorySlotPreparer prepares the GetTriggeredWebJobHistorySlot request. +func (client AppsClient) GetTriggeredWebJobHistorySlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history/{id}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTriggeredWebJobHistorySlotSender sends the GetTriggeredWebJobHistorySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetTriggeredWebJobHistorySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTriggeredWebJobHistorySlotResponder handles the response to the GetTriggeredWebJobHistorySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetTriggeredWebJobHistorySlotResponder(resp *http.Response) (result TriggeredJobHistory, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetTriggeredWebJobSlot description for Gets a triggered web job by its ID for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredWebJob, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetTriggeredWebJobSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetTriggeredWebJobSlot", err.Error()) + } + + req, err := client.GetTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetTriggeredWebJobSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.GetTriggeredWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetTriggeredWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetTriggeredWebJobSlotPreparer prepares the GetTriggeredWebJobSlot request. +func (client AppsClient) GetTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetTriggeredWebJobSlotSender sends the GetTriggeredWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetTriggeredWebJobSlotResponder handles the response to the GetTriggeredWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetTriggeredWebJobSlotResponder(resp *http.Response) (result TriggeredWebJob, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVnetConnection description for Gets a virtual network the app (or deployment slot) is connected to by name. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the virtual network. +func (client AppsClient) GetVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetVnetConnection", err.Error()) + } + + req, err := client.GetVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetVnetConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", resp, "Failure sending request") + return + } + + result, err = client.GetVnetConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetVnetConnectionPreparer prepares the GetVnetConnection request. +func (client AppsClient) GetVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVnetConnectionSender sends the GetVnetConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetVnetConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVnetConnectionResponder handles the response to the GetVnetConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) GetVnetConnectionResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVnetConnectionGateway description for Gets an app's Virtual Network gateway. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +func (client AppsClient) GetVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionGateway") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetVnetConnectionGateway", err.Error()) + } + + req, err := client.GetVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", nil, "Failure preparing request") + return + } + + resp, err := client.GetVnetConnectionGatewaySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", resp, "Failure sending request") + return + } + + result, err = client.GetVnetConnectionGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGateway", resp, "Failure responding to request") + return + } + + return +} + +// GetVnetConnectionGatewayPreparer prepares the GetVnetConnectionGateway request. +func (client AppsClient) GetVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVnetConnectionGatewaySender sends the GetVnetConnectionGateway request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVnetConnectionGatewayResponder handles the response to the GetVnetConnectionGateway request. The method always +// closes the http.Response Body. +func (client AppsClient) GetVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVnetConnectionGatewaySlot description for Gets an app's Virtual Network gateway. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// slot - name of the deployment slot. If a slot is not specified, the API will get a gateway for the +// production slot's Virtual Network. +func (client AppsClient) GetVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionGatewaySlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetVnetConnectionGatewaySlot", err.Error()) + } + + req, err := client.GetVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetVnetConnectionGatewaySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", resp, "Failure sending request") + return + } + + result, err = client.GetVnetConnectionGatewaySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionGatewaySlot", resp, "Failure responding to request") + return + } + + return +} + +// GetVnetConnectionGatewaySlotPreparer prepares the GetVnetConnectionGatewaySlot request. +func (client AppsClient) GetVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVnetConnectionGatewaySlotSender sends the GetVnetConnectionGatewaySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVnetConnectionGatewaySlotResponder handles the response to the GetVnetConnectionGatewaySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVnetConnectionSlot description for Gets a virtual network the app (or deployment slot) is connected to by name. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the virtual network. +// slot - name of the deployment slot. If a slot is not specified, the API will get the named virtual network +// for the production slot. +func (client AppsClient) GetVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetVnetConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetVnetConnectionSlot", err.Error()) + } + + req, err := client.GetVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetVnetConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.GetVnetConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetVnetConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetVnetConnectionSlotPreparer prepares the GetVnetConnectionSlot request. +func (client AppsClient) GetVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVnetConnectionSlotSender sends the GetVnetConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVnetConnectionSlotResponder handles the response to the GetVnetConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetVnetConnectionSlotResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetWebJob description for Get webjob information for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of the web job. +func (client AppsClient) GetWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebJob") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetWebJob", err.Error()) + } + + req, err := client.GetWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.GetWebJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", resp, "Failure sending request") + return + } + + result, err = client.GetWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJob", resp, "Failure responding to request") + return + } + + return +} + +// GetWebJobPreparer prepares the GetWebJob request. +func (client AppsClient) GetWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWebJobSender sends the GetWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetWebJobResponder handles the response to the GetWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) GetWebJobResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetWebJobSlot description for Get webjob information for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of the web job. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) GetWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result Job, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebJobSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetWebJobSlot", err.Error()) + } + + req, err := client.GetWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetWebJobSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.GetWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetWebJobSlotPreparer prepares the GetWebJobSlot request. +func (client AppsClient) GetWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs/{webJobName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWebJobSlotSender sends the GetWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetWebJobSlotResponder handles the response to the GetWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetWebJobSlotResponder(resp *http.Response) (result Job, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetWebSiteContainerLogs description for Gets the last lines of docker logs for the given site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) GetWebSiteContainerLogs(ctx context.Context, resourceGroupName string, name string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebSiteContainerLogs") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogs", err.Error()) + } + + req, err := client.GetWebSiteContainerLogsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", nil, "Failure preparing request") + return + } + + resp, err := client.GetWebSiteContainerLogsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", resp, "Failure sending request") + return + } + + result, err = client.GetWebSiteContainerLogsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogs", resp, "Failure responding to request") + return + } + + return +} + +// GetWebSiteContainerLogsPreparer prepares the GetWebSiteContainerLogs request. +func (client AppsClient) GetWebSiteContainerLogsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/containerlogs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWebSiteContainerLogsSender sends the GetWebSiteContainerLogs request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetWebSiteContainerLogsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetWebSiteContainerLogsResponder handles the response to the GetWebSiteContainerLogs request. The method always +// closes the http.Response Body. +func (client AppsClient) GetWebSiteContainerLogsResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + result.Response = autorest.Response{Response: resp} + return +} + +// GetWebSiteContainerLogsSlot description for Gets the last lines of docker logs for the given site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) GetWebSiteContainerLogsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.GetWebSiteContainerLogsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "GetWebSiteContainerLogsSlot", err.Error()) + } + + req, err := client.GetWebSiteContainerLogsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetWebSiteContainerLogsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", resp, "Failure sending request") + return + } + + result, err = client.GetWebSiteContainerLogsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "GetWebSiteContainerLogsSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetWebSiteContainerLogsSlotPreparer prepares the GetWebSiteContainerLogsSlot request. +func (client AppsClient) GetWebSiteContainerLogsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/containerlogs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWebSiteContainerLogsSlotSender sends the GetWebSiteContainerLogsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) GetWebSiteContainerLogsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetWebSiteContainerLogsSlotResponder handles the response to the GetWebSiteContainerLogsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) GetWebSiteContainerLogsSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent)) + result.Response = autorest.Response{Response: resp} + return +} + +// InstallSiteExtension description for Install site extension on a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +func (client AppsClient) InstallSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result AppsInstallSiteExtensionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtension") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "InstallSiteExtension", err.Error()) + } + + req, err := client.InstallSiteExtensionPreparer(ctx, resourceGroupName, name, siteExtensionID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtension", nil, "Failure preparing request") + return + } + + result, err = client.InstallSiteExtensionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtension", result.Response(), "Failure sending request") + return + } + + return +} + +// InstallSiteExtensionPreparer prepares the InstallSiteExtension request. +func (client AppsClient) InstallSiteExtensionPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallSiteExtensionSender sends the InstallSiteExtension request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) InstallSiteExtensionSender(req *http.Request) (future AppsInstallSiteExtensionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// InstallSiteExtensionResponder handles the response to the InstallSiteExtension request. The method always +// closes the http.Response Body. +func (client AppsClient) InstallSiteExtensionResponder(resp *http.Response) (result SiteExtensionInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// InstallSiteExtensionSlot description for Install site extension on a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// siteExtensionID - site extension name. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) InstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result AppsInstallSiteExtensionSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.InstallSiteExtensionSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "InstallSiteExtensionSlot", err.Error()) + } + + req, err := client.InstallSiteExtensionSlotPreparer(ctx, resourceGroupName, name, siteExtensionID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtensionSlot", nil, "Failure preparing request") + return + } + + result, err = client.InstallSiteExtensionSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "InstallSiteExtensionSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// InstallSiteExtensionSlotPreparer prepares the InstallSiteExtensionSlot request. +func (client AppsClient) InstallSiteExtensionSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteExtensionId": autorest.Encode("path", siteExtensionID), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions/{siteExtensionId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InstallSiteExtensionSlotSender sends the InstallSiteExtensionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) InstallSiteExtensionSlotSender(req *http.Request) (future AppsInstallSiteExtensionSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// InstallSiteExtensionSlotResponder handles the response to the InstallSiteExtensionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) InstallSiteExtensionSlotResponder(resp *http.Response) (result SiteExtensionInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// IsCloneable description for Shows whether an app can be cloned to another resource group or subscription. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) IsCloneable(ctx context.Context, resourceGroupName string, name string) (result SiteCloneability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.IsCloneable") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "IsCloneable", err.Error()) + } + + req, err := client.IsCloneablePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", nil, "Failure preparing request") + return + } + + resp, err := client.IsCloneableSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", resp, "Failure sending request") + return + } + + result, err = client.IsCloneableResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneable", resp, "Failure responding to request") + return + } + + return +} + +// IsCloneablePreparer prepares the IsCloneable request. +func (client AppsClient) IsCloneablePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/iscloneable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// IsCloneableSender sends the IsCloneable request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) IsCloneableSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// IsCloneableResponder handles the response to the IsCloneable request. The method always +// closes the http.Response Body. +func (client AppsClient) IsCloneableResponder(resp *http.Response) (result SiteCloneability, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// IsCloneableSlot description for Shows whether an app can be cloned to another resource group or subscription. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. By default, this API returns information on the production slot. +func (client AppsClient) IsCloneableSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteCloneability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.IsCloneableSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "IsCloneableSlot", err.Error()) + } + + req, err := client.IsCloneableSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", nil, "Failure preparing request") + return + } + + resp, err := client.IsCloneableSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", resp, "Failure sending request") + return + } + + result, err = client.IsCloneableSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "IsCloneableSlot", resp, "Failure responding to request") + return + } + + return +} + +// IsCloneableSlotPreparer prepares the IsCloneableSlot request. +func (client AppsClient) IsCloneableSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/iscloneable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// IsCloneableSlotSender sends the IsCloneableSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) IsCloneableSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// IsCloneableSlotResponder handles the response to the IsCloneableSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) IsCloneableSlotResponder(resp *http.Response) (result SiteCloneability, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all apps for a subscription. +func (client AppsClient) List(ctx context.Context) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "List", resp, "Failure sending request") + return + } + + result.ac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "List", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AppsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/sites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AppsClient) ListResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AppsClient) listNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListComplete(ctx context.Context) (result AppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListApplicationSettings description for Gets the application settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListApplicationSettings(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListApplicationSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListApplicationSettings", err.Error()) + } + + req, err := client.ListApplicationSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListApplicationSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", resp, "Failure sending request") + return + } + + result, err = client.ListApplicationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettings", resp, "Failure responding to request") + return + } + + return +} + +// ListApplicationSettingsPreparer prepares the ListApplicationSettings request. +func (client AppsClient) ListApplicationSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListApplicationSettingsSender sends the ListApplicationSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListApplicationSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListApplicationSettingsResponder handles the response to the ListApplicationSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) ListApplicationSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListApplicationSettingsSlot description for Gets the application settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the application settings +// for the production slot. +func (client AppsClient) ListApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListApplicationSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListApplicationSettingsSlot", err.Error()) + } + + req, err := client.ListApplicationSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListApplicationSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListApplicationSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListApplicationSettingsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListApplicationSettingsSlotPreparer prepares the ListApplicationSettingsSlot request. +func (client AppsClient) ListApplicationSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListApplicationSettingsSlotSender sends the ListApplicationSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListApplicationSettingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListApplicationSettingsSlotResponder handles the response to the ListApplicationSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListApplicationSettingsSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAzureStorageAccounts description for Gets the Azure storage account configurations of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string) (result AzureStoragePropertyDictionaryResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAzureStorageAccounts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListAzureStorageAccounts", err.Error()) + } + + req, err := client.ListAzureStorageAccountsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", nil, "Failure preparing request") + return + } + + resp, err := client.ListAzureStorageAccountsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", resp, "Failure sending request") + return + } + + result, err = client.ListAzureStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccounts", resp, "Failure responding to request") + return + } + + return +} + +// ListAzureStorageAccountsPreparer prepares the ListAzureStorageAccounts request. +func (client AppsClient) ListAzureStorageAccountsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAzureStorageAccountsSender sends the ListAzureStorageAccounts request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListAzureStorageAccountsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAzureStorageAccountsResponder handles the response to the ListAzureStorageAccounts request. The method always +// closes the http.Response Body. +func (client AppsClient) ListAzureStorageAccountsResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAzureStorageAccountsSlot description for Gets the Azure storage account configurations of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will update the Azure storage +// account configurations for the production slot. +func (client AppsClient) ListAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AzureStoragePropertyDictionaryResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListAzureStorageAccountsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListAzureStorageAccountsSlot", err.Error()) + } + + req, err := client.ListAzureStorageAccountsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListAzureStorageAccountsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListAzureStorageAccountsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListAzureStorageAccountsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListAzureStorageAccountsSlotPreparer prepares the ListAzureStorageAccountsSlot request. +func (client AppsClient) ListAzureStorageAccountsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAzureStorageAccountsSlotSender sends the ListAzureStorageAccountsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListAzureStorageAccountsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAzureStorageAccountsSlotResponder handles the response to the ListAzureStorageAccountsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListAzureStorageAccountsSlotResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBackups description for Gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListBackups(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackups") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackups", err.Error()) + } + + result.fn = client.listBackupsNextResults + req, err := client.ListBackupsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupsSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", resp, "Failure sending request") + return + } + + result.bic, err = client.ListBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackups", resp, "Failure responding to request") + return + } + if result.bic.hasNextLink() && result.bic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBackupsPreparer prepares the ListBackups request. +func (client AppsClient) ListBackupsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupsSender sends the ListBackups request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBackupsResponder handles the response to the ListBackups request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBackupsNextResults retrieves the next set of results, if any. +func (client AppsClient) listBackupsNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBackupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBackupsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackups") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBackups(ctx, resourceGroupName, name) + return +} + +// ListBackupsSlot description for Gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get backups of the production +// slot. +func (client AppsClient) ListBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupsSlot") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackupsSlot", err.Error()) + } + + result.fn = client.listBackupsSlotNextResults + req, err := client.ListBackupsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupsSlotSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", resp, "Failure sending request") + return + } + + result.bic, err = client.ListBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupsSlot", resp, "Failure responding to request") + return + } + if result.bic.hasNextLink() && result.bic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBackupsSlotPreparer prepares the ListBackupsSlot request. +func (client AppsClient) ListBackupsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupsSlotSender sends the ListBackupsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBackupsSlotResponder handles the response to the ListBackupsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupsSlotResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBackupsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listBackupsSlotNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBackupsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listBackupsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBackupsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBackupsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListBackupStatusSecrets description for Gets status of a web app backup that may be in progress, including secrets +// associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for the backup +// if a new URL is passed in the request body. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// backupID - ID of backup. +// request - information on backup request. +func (client AppsClient) ListBackupStatusSecrets(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupStatusSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackupStatusSecrets", err.Error()) + } + + req, err := client.ListBackupStatusSecretsPreparer(ctx, resourceGroupName, name, backupID, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupStatusSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListBackupStatusSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecrets", resp, "Failure responding to request") + return + } + + return +} + +// ListBackupStatusSecretsPreparer prepares the ListBackupStatusSecrets request. +func (client AppsClient) ListBackupStatusSecretsPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/list", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupStatusSecretsSender sends the ListBackupStatusSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupStatusSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBackupStatusSecretsResponder handles the response to the ListBackupStatusSecrets request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupStatusSecretsResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBackupStatusSecretsSlot description for Gets status of a web app backup that may be in progress, including +// secrets associated with the backup, such as the Azure Storage SAS URL. Also can be used to update the SAS URL for +// the backup if a new URL is passed in the request body. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// backupID - ID of backup. +// request - information on backup request. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) ListBackupStatusSecretsSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (result BackupItem, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBackupStatusSecretsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBackupStatusSecretsSlot", err.Error()) + } + + req, err := client.ListBackupStatusSecretsSlotPreparer(ctx, resourceGroupName, name, backupID, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListBackupStatusSecretsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListBackupStatusSecretsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBackupStatusSecretsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListBackupStatusSecretsSlotPreparer prepares the ListBackupStatusSecretsSlot request. +func (client AppsClient) ListBackupStatusSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request BackupRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/list", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBackupStatusSecretsSlotSender sends the ListBackupStatusSecretsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBackupStatusSecretsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBackupStatusSecretsSlotResponder handles the response to the ListBackupStatusSecretsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBackupStatusSecretsSlotResponder(resp *http.Response) (result BackupItem, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBasicPublishingCredentialsPolicies description for Returns whether Scm basic auth is allowed and whether Ftp is +// allowed for a given site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListBasicPublishingCredentialsPolicies(ctx context.Context, resourceGroupName string, name string) (result PublishingCredentialsPoliciesCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBasicPublishingCredentialsPolicies") + defer func() { + sc := -1 + if result.pcpc.Response.Response != nil { + sc = result.pcpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBasicPublishingCredentialsPolicies", err.Error()) + } + + result.fn = client.listBasicPublishingCredentialsPoliciesNextResults + req, err := client.ListBasicPublishingCredentialsPoliciesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBasicPublishingCredentialsPolicies", nil, "Failure preparing request") + return + } + + resp, err := client.ListBasicPublishingCredentialsPoliciesSender(req) + if err != nil { + result.pcpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBasicPublishingCredentialsPolicies", resp, "Failure sending request") + return + } + + result.pcpc, err = client.ListBasicPublishingCredentialsPoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBasicPublishingCredentialsPolicies", resp, "Failure responding to request") + return + } + if result.pcpc.hasNextLink() && result.pcpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBasicPublishingCredentialsPoliciesPreparer prepares the ListBasicPublishingCredentialsPolicies request. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBasicPublishingCredentialsPoliciesSender sends the ListBasicPublishingCredentialsPolicies request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBasicPublishingCredentialsPoliciesResponder handles the response to the ListBasicPublishingCredentialsPolicies request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesResponder(resp *http.Response) (result PublishingCredentialsPoliciesCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBasicPublishingCredentialsPoliciesNextResults retrieves the next set of results, if any. +func (client AppsClient) listBasicPublishingCredentialsPoliciesNextResults(ctx context.Context, lastResults PublishingCredentialsPoliciesCollection) (result PublishingCredentialsPoliciesCollection, err error) { + req, err := lastResults.publishingCredentialsPoliciesCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBasicPublishingCredentialsPoliciesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBasicPublishingCredentialsPoliciesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBasicPublishingCredentialsPoliciesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBasicPublishingCredentialsPoliciesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listBasicPublishingCredentialsPoliciesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBasicPublishingCredentialsPoliciesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesComplete(ctx context.Context, resourceGroupName string, name string) (result PublishingCredentialsPoliciesCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBasicPublishingCredentialsPolicies") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBasicPublishingCredentialsPolicies(ctx, resourceGroupName, name) + return +} + +// ListBasicPublishingCredentialsPoliciesSlot description for Returns whether Scm basic auth is allowed and whether Ftp +// is allowed for a given site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PublishingCredentialsPoliciesCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBasicPublishingCredentialsPoliciesSlot") + defer func() { + sc := -1 + if result.pcpc.Response.Response != nil { + sc = result.pcpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListBasicPublishingCredentialsPoliciesSlot", err.Error()) + } + + result.fn = client.listBasicPublishingCredentialsPoliciesSlotNextResults + req, err := client.ListBasicPublishingCredentialsPoliciesSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBasicPublishingCredentialsPoliciesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListBasicPublishingCredentialsPoliciesSlotSender(req) + if err != nil { + result.pcpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBasicPublishingCredentialsPoliciesSlot", resp, "Failure sending request") + return + } + + result.pcpc, err = client.ListBasicPublishingCredentialsPoliciesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListBasicPublishingCredentialsPoliciesSlot", resp, "Failure responding to request") + return + } + if result.pcpc.hasNextLink() && result.pcpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBasicPublishingCredentialsPoliciesSlotPreparer prepares the ListBasicPublishingCredentialsPoliciesSlot request. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBasicPublishingCredentialsPoliciesSlotSender sends the ListBasicPublishingCredentialsPoliciesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBasicPublishingCredentialsPoliciesSlotResponder handles the response to the ListBasicPublishingCredentialsPoliciesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesSlotResponder(resp *http.Response) (result PublishingCredentialsPoliciesCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBasicPublishingCredentialsPoliciesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listBasicPublishingCredentialsPoliciesSlotNextResults(ctx context.Context, lastResults PublishingCredentialsPoliciesCollection) (result PublishingCredentialsPoliciesCollection, err error) { + req, err := lastResults.publishingCredentialsPoliciesCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBasicPublishingCredentialsPoliciesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBasicPublishingCredentialsPoliciesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listBasicPublishingCredentialsPoliciesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBasicPublishingCredentialsPoliciesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listBasicPublishingCredentialsPoliciesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBasicPublishingCredentialsPoliciesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListBasicPublishingCredentialsPoliciesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result PublishingCredentialsPoliciesCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListBasicPublishingCredentialsPoliciesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBasicPublishingCredentialsPoliciesSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListByResourceGroup description for Gets all web, mobile, and API apps in the specified resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// includeSlots - specify true to include deployment slots in results. The default is false, +// which only gives you the production slot of all apps. +func (client AppsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string, includeSlots *bool) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName, includeSlots) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ac, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AppsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string, includeSlots *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if includeSlots != nil { + queryParameters["includeSlots"] = autorest.Encode("query", *includeSlots) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AppsClient) ListByResourceGroupResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AppsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, includeSlots *bool) (result AppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName, includeSlots) + return +} + +// ListConfigurations description for List the configurations of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListConfigurations(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResourceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurations") + defer func() { + sc := -1 + if result.scrc.Response.Response != nil { + sc = result.scrc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConfigurations", err.Error()) + } + + result.fn = client.listConfigurationsNextResults + req, err := client.ListConfigurationsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", nil, "Failure preparing request") + return + } + + resp, err := client.ListConfigurationsSender(req) + if err != nil { + result.scrc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", resp, "Failure sending request") + return + } + + result.scrc, err = client.ListConfigurationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurations", resp, "Failure responding to request") + return + } + if result.scrc.hasNextLink() && result.scrc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListConfigurationsPreparer prepares the ListConfigurations request. +func (client AppsClient) ListConfigurationsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConfigurationsSender sends the ListConfigurations request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListConfigurationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConfigurationsResponder handles the response to the ListConfigurations request. The method always +// closes the http.Response Body. +func (client AppsClient) ListConfigurationsResponder(resp *http.Response) (result SiteConfigResourceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listConfigurationsNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationsNextResults(ctx context.Context, lastResults SiteConfigResourceCollection) (result SiteConfigResourceCollection, err error) { + req, err := lastResults.siteConfigResourceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListConfigurationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListConfigurationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListConfigurationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationsComplete(ctx context.Context, resourceGroupName string, name string) (result SiteConfigResourceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListConfigurations(ctx, resourceGroupName, name) + return +} + +// ListConfigurationSnapshotInfo description for Gets a list of web app configuration snapshots identifiers. Each +// element of the list contains a timestamp and the ID of the snapshot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListConfigurationSnapshotInfo(ctx context.Context, resourceGroupName string, name string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfo") + defer func() { + sc := -1 + if result.scsic.Response.Response != nil { + sc = result.scsic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfo", err.Error()) + } + + result.fn = client.listConfigurationSnapshotInfoNextResults + req, err := client.ListConfigurationSnapshotInfoPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", nil, "Failure preparing request") + return + } + + resp, err := client.ListConfigurationSnapshotInfoSender(req) + if err != nil { + result.scsic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", resp, "Failure sending request") + return + } + + result.scsic, err = client.ListConfigurationSnapshotInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfo", resp, "Failure responding to request") + return + } + if result.scsic.hasNextLink() && result.scsic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListConfigurationSnapshotInfoPreparer prepares the ListConfigurationSnapshotInfo request. +func (client AppsClient) ListConfigurationSnapshotInfoPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConfigurationSnapshotInfoSender sends the ListConfigurationSnapshotInfo request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListConfigurationSnapshotInfoSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConfigurationSnapshotInfoResponder handles the response to the ListConfigurationSnapshotInfo request. The method always +// closes the http.Response Body. +func (client AppsClient) ListConfigurationSnapshotInfoResponder(resp *http.Response) (result SiteConfigurationSnapshotInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listConfigurationSnapshotInfoNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationSnapshotInfoNextResults(ctx context.Context, lastResults SiteConfigurationSnapshotInfoCollection) (result SiteConfigurationSnapshotInfoCollection, err error) { + req, err := lastResults.siteConfigurationSnapshotInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListConfigurationSnapshotInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", resp, "Failure sending next results request") + } + result, err = client.ListConfigurationSnapshotInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListConfigurationSnapshotInfoComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationSnapshotInfoComplete(ctx context.Context, resourceGroupName string, name string) (result SiteConfigurationSnapshotInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfo") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListConfigurationSnapshotInfo(ctx, resourceGroupName, name) + return +} + +// ListConfigurationSnapshotInfoSlot description for Gets a list of web app configuration snapshots identifiers. Each +// element of the list contains a timestamp and the ID of the snapshot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) ListConfigurationSnapshotInfoSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfoSlot") + defer func() { + sc := -1 + if result.scsic.Response.Response != nil { + sc = result.scsic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConfigurationSnapshotInfoSlot", err.Error()) + } + + result.fn = client.listConfigurationSnapshotInfoSlotNextResults + req, err := client.ListConfigurationSnapshotInfoSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListConfigurationSnapshotInfoSlotSender(req) + if err != nil { + result.scsic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", resp, "Failure sending request") + return + } + + result.scsic, err = client.ListConfigurationSnapshotInfoSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationSnapshotInfoSlot", resp, "Failure responding to request") + return + } + if result.scsic.hasNextLink() && result.scsic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListConfigurationSnapshotInfoSlotPreparer prepares the ListConfigurationSnapshotInfoSlot request. +func (client AppsClient) ListConfigurationSnapshotInfoSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConfigurationSnapshotInfoSlotSender sends the ListConfigurationSnapshotInfoSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListConfigurationSnapshotInfoSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConfigurationSnapshotInfoSlotResponder handles the response to the ListConfigurationSnapshotInfoSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListConfigurationSnapshotInfoSlotResponder(resp *http.Response) (result SiteConfigurationSnapshotInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listConfigurationSnapshotInfoSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationSnapshotInfoSlotNextResults(ctx context.Context, lastResults SiteConfigurationSnapshotInfoCollection) (result SiteConfigurationSnapshotInfoCollection, err error) { + req, err := lastResults.siteConfigurationSnapshotInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListConfigurationSnapshotInfoSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListConfigurationSnapshotInfoSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationSnapshotInfoSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListConfigurationSnapshotInfoSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationSnapshotInfoSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigurationSnapshotInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationSnapshotInfoSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListConfigurationSnapshotInfoSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListConfigurationsSlot description for List the configurations of an app +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) ListConfigurationsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationsSlot") + defer func() { + sc := -1 + if result.scrc.Response.Response != nil { + sc = result.scrc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConfigurationsSlot", err.Error()) + } + + result.fn = client.listConfigurationsSlotNextResults + req, err := client.ListConfigurationsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListConfigurationsSlotSender(req) + if err != nil { + result.scrc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", resp, "Failure sending request") + return + } + + result.scrc, err = client.ListConfigurationsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConfigurationsSlot", resp, "Failure responding to request") + return + } + if result.scrc.hasNextLink() && result.scrc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListConfigurationsSlotPreparer prepares the ListConfigurationsSlot request. +func (client AppsClient) ListConfigurationsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConfigurationsSlotSender sends the ListConfigurationsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListConfigurationsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConfigurationsSlotResponder handles the response to the ListConfigurationsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListConfigurationsSlotResponder(resp *http.Response) (result SiteConfigResourceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listConfigurationsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listConfigurationsSlotNextResults(ctx context.Context, lastResults SiteConfigResourceCollection) (result SiteConfigResourceCollection, err error) { + req, err := lastResults.siteConfigResourceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListConfigurationsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListConfigurationsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listConfigurationsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListConfigurationsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListConfigurationsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteConfigResourceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConfigurationsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListConfigurationsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListConnectionStrings description for Gets the connection strings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListConnectionStrings(ctx context.Context, resourceGroupName string, name string) (result ConnectionStringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConnectionStrings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConnectionStrings", err.Error()) + } + + req, err := client.ListConnectionStringsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionStringsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionStringsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStrings", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionStringsPreparer prepares the ListConnectionStrings request. +func (client AppsClient) ListConnectionStringsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionStringsSender sends the ListConnectionStrings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListConnectionStringsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionStringsResponder handles the response to the ListConnectionStrings request. The method always +// closes the http.Response Body. +func (client AppsClient) ListConnectionStringsResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListConnectionStringsSlot description for Gets the connection strings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the connection settings for +// the production slot. +func (client AppsClient) ListConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ConnectionStringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListConnectionStringsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListConnectionStringsSlot", err.Error()) + } + + req, err := client.ListConnectionStringsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListConnectionStringsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListConnectionStringsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListConnectionStringsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListConnectionStringsSlotPreparer prepares the ListConnectionStringsSlot request. +func (client AppsClient) ListConnectionStringsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListConnectionStringsSlotSender sends the ListConnectionStringsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListConnectionStringsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListConnectionStringsSlotResponder handles the response to the ListConnectionStringsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListConnectionStringsSlotResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListContinuousWebJobs description for List continuous web jobs for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListContinuousWebJobs(ctx context.Context, resourceGroupName string, name string) (result ContinuousWebJobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobs") + defer func() { + sc := -1 + if result.cwjc.Response.Response != nil { + sc = result.cwjc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListContinuousWebJobs", err.Error()) + } + + result.fn = client.listContinuousWebJobsNextResults + req, err := client.ListContinuousWebJobsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", nil, "Failure preparing request") + return + } + + resp, err := client.ListContinuousWebJobsSender(req) + if err != nil { + result.cwjc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", resp, "Failure sending request") + return + } + + result.cwjc, err = client.ListContinuousWebJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobs", resp, "Failure responding to request") + return + } + if result.cwjc.hasNextLink() && result.cwjc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListContinuousWebJobsPreparer prepares the ListContinuousWebJobs request. +func (client AppsClient) ListContinuousWebJobsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContinuousWebJobsSender sends the ListContinuousWebJobs request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListContinuousWebJobsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListContinuousWebJobsResponder handles the response to the ListContinuousWebJobs request. The method always +// closes the http.Response Body. +func (client AppsClient) ListContinuousWebJobsResponder(resp *http.Response) (result ContinuousWebJobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listContinuousWebJobsNextResults retrieves the next set of results, if any. +func (client AppsClient) listContinuousWebJobsNextResults(ctx context.Context, lastResults ContinuousWebJobCollection) (result ContinuousWebJobCollection, err error) { + req, err := lastResults.continuousWebJobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListContinuousWebJobsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListContinuousWebJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListContinuousWebJobsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListContinuousWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result ContinuousWebJobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobs") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListContinuousWebJobs(ctx, resourceGroupName, name) + return +} + +// ListContinuousWebJobsSlot description for List continuous web jobs for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) ListContinuousWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobsSlot") + defer func() { + sc := -1 + if result.cwjc.Response.Response != nil { + sc = result.cwjc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListContinuousWebJobsSlot", err.Error()) + } + + result.fn = client.listContinuousWebJobsSlotNextResults + req, err := client.ListContinuousWebJobsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListContinuousWebJobsSlotSender(req) + if err != nil { + result.cwjc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", resp, "Failure sending request") + return + } + + result.cwjc, err = client.ListContinuousWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListContinuousWebJobsSlot", resp, "Failure responding to request") + return + } + if result.cwjc.hasNextLink() && result.cwjc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListContinuousWebJobsSlotPreparer prepares the ListContinuousWebJobsSlot request. +func (client AppsClient) ListContinuousWebJobsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListContinuousWebJobsSlotSender sends the ListContinuousWebJobsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListContinuousWebJobsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListContinuousWebJobsSlotResponder handles the response to the ListContinuousWebJobsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListContinuousWebJobsSlotResponder(resp *http.Response) (result ContinuousWebJobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listContinuousWebJobsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listContinuousWebJobsSlotNextResults(ctx context.Context, lastResults ContinuousWebJobCollection) (result ContinuousWebJobCollection, err error) { + req, err := lastResults.continuousWebJobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListContinuousWebJobsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListContinuousWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listContinuousWebJobsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListContinuousWebJobsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListContinuousWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result ContinuousWebJobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListContinuousWebJobsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListContinuousWebJobsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListDeploymentLog description for List deployment log for specific deployment for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - the ID of a specific deployment. This is the value of the name property in the JSON response from "GET +// /api/sites/{siteName}/deployments". +func (client AppsClient) ListDeploymentLog(ctx context.Context, resourceGroupName string, name string, ID string) (result Deployment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentLog") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListDeploymentLog", err.Error()) + } + + req, err := client.ListDeploymentLogPreparer(ctx, resourceGroupName, name, ID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentLogSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", resp, "Failure sending request") + return + } + + result, err = client.ListDeploymentLogResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLog", resp, "Failure responding to request") + return + } + + return +} + +// ListDeploymentLogPreparer prepares the ListDeploymentLog request. +func (client AppsClient) ListDeploymentLogPreparer(ctx context.Context, resourceGroupName string, name string, ID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments/{id}/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentLogSender sends the ListDeploymentLog request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListDeploymentLogSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDeploymentLogResponder handles the response to the ListDeploymentLog request. The method always +// closes the http.Response Body. +func (client AppsClient) ListDeploymentLogResponder(resp *http.Response) (result Deployment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListDeploymentLogSlot description for List deployment log for specific deployment for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// ID - the ID of a specific deployment. This is the value of the name property in the JSON response from "GET +// /api/sites/{siteName}/deployments". +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListDeploymentLogSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result Deployment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentLogSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListDeploymentLogSlot", err.Error()) + } + + req, err := client.ListDeploymentLogSlotPreparer(ctx, resourceGroupName, name, ID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentLogSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", resp, "Failure sending request") + return + } + + result, err = client.ListDeploymentLogSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentLogSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListDeploymentLogSlotPreparer prepares the ListDeploymentLogSlot request. +func (client AppsClient) ListDeploymentLogSlotPreparer(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "id": autorest.Encode("path", ID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments/{id}/log", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentLogSlotSender sends the ListDeploymentLogSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListDeploymentLogSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDeploymentLogSlotResponder handles the response to the ListDeploymentLogSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListDeploymentLogSlotResponder(resp *http.Response) (result Deployment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListDeployments description for List deployments for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListDeployments(ctx context.Context, resourceGroupName string, name string) (result DeploymentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeployments") + defer func() { + sc := -1 + if result.dc.Response.Response != nil { + sc = result.dc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListDeployments", err.Error()) + } + + result.fn = client.listDeploymentsNextResults + req, err := client.ListDeploymentsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentsSender(req) + if err != nil { + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", resp, "Failure sending request") + return + } + + result.dc, err = client.ListDeploymentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeployments", resp, "Failure responding to request") + return + } + if result.dc.hasNextLink() && result.dc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListDeploymentsPreparer prepares the ListDeployments request. +func (client AppsClient) ListDeploymentsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/deployments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentsSender sends the ListDeployments request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListDeploymentsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDeploymentsResponder handles the response to the ListDeployments request. The method always +// closes the http.Response Body. +func (client AppsClient) ListDeploymentsResponder(resp *http.Response) (result DeploymentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeploymentsNextResults retrieves the next set of results, if any. +func (client AppsClient) listDeploymentsNextResults(ctx context.Context, lastResults DeploymentCollection) (result DeploymentCollection, err error) { + req, err := lastResults.deploymentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDeploymentsComplete(ctx context.Context, resourceGroupName string, name string) (result DeploymentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeployments") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeployments(ctx, resourceGroupName, name) + return +} + +// ListDeploymentsSlot description for List deployments for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListDeploymentsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentsSlot") + defer func() { + sc := -1 + if result.dc.Response.Response != nil { + sc = result.dc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListDeploymentsSlot", err.Error()) + } + + result.fn = client.listDeploymentsSlotNextResults + req, err := client.ListDeploymentsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListDeploymentsSlotSender(req) + if err != nil { + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", resp, "Failure sending request") + return + } + + result.dc, err = client.ListDeploymentsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDeploymentsSlot", resp, "Failure responding to request") + return + } + if result.dc.hasNextLink() && result.dc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListDeploymentsSlotPreparer prepares the ListDeploymentsSlot request. +func (client AppsClient) ListDeploymentsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/deployments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDeploymentsSlotSender sends the ListDeploymentsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListDeploymentsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDeploymentsSlotResponder handles the response to the ListDeploymentsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListDeploymentsSlotResponder(resp *http.Response) (result DeploymentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDeploymentsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listDeploymentsSlotNextResults(ctx context.Context, lastResults DeploymentCollection) (result DeploymentCollection, err error) { + req, err := lastResults.deploymentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDeploymentsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDeploymentsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDeploymentsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDeploymentsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDeploymentsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result DeploymentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDeploymentsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDeploymentsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListDomainOwnershipIdentifiers description for Lists ownership identifiers for domain associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListDomainOwnershipIdentifiers(ctx context.Context, resourceGroupName string, name string) (result IdentifierCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiers") + defer func() { + sc := -1 + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiers", err.Error()) + } + + result.fn = client.listDomainOwnershipIdentifiersNextResults + req, err := client.ListDomainOwnershipIdentifiersPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", nil, "Failure preparing request") + return + } + + resp, err := client.ListDomainOwnershipIdentifiersSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", resp, "Failure sending request") + return + } + + result.ic, err = client.ListDomainOwnershipIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiers", resp, "Failure responding to request") + return + } + if result.ic.hasNextLink() && result.ic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListDomainOwnershipIdentifiersPreparer prepares the ListDomainOwnershipIdentifiers request. +func (client AppsClient) ListDomainOwnershipIdentifiersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDomainOwnershipIdentifiersSender sends the ListDomainOwnershipIdentifiers request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListDomainOwnershipIdentifiersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDomainOwnershipIdentifiersResponder handles the response to the ListDomainOwnershipIdentifiers request. The method always +// closes the http.Response Body. +func (client AppsClient) ListDomainOwnershipIdentifiersResponder(resp *http.Response) (result IdentifierCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDomainOwnershipIdentifiersNextResults retrieves the next set of results, if any. +func (client AppsClient) listDomainOwnershipIdentifiersNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { + req, err := lastResults.identifierCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDomainOwnershipIdentifiersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDomainOwnershipIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDomainOwnershipIdentifiersComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDomainOwnershipIdentifiersComplete(ctx context.Context, resourceGroupName string, name string) (result IdentifierCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDomainOwnershipIdentifiers(ctx, resourceGroupName, name) + return +} + +// ListDomainOwnershipIdentifiersSlot description for Lists ownership identifiers for domain associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) ListDomainOwnershipIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiersSlot") + defer func() { + sc := -1 + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListDomainOwnershipIdentifiersSlot", err.Error()) + } + + result.fn = client.listDomainOwnershipIdentifiersSlotNextResults + req, err := client.ListDomainOwnershipIdentifiersSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListDomainOwnershipIdentifiersSlotSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", resp, "Failure sending request") + return + } + + result.ic, err = client.ListDomainOwnershipIdentifiersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListDomainOwnershipIdentifiersSlot", resp, "Failure responding to request") + return + } + if result.ic.hasNextLink() && result.ic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListDomainOwnershipIdentifiersSlotPreparer prepares the ListDomainOwnershipIdentifiersSlot request. +func (client AppsClient) ListDomainOwnershipIdentifiersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDomainOwnershipIdentifiersSlotSender sends the ListDomainOwnershipIdentifiersSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListDomainOwnershipIdentifiersSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDomainOwnershipIdentifiersSlotResponder handles the response to the ListDomainOwnershipIdentifiersSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListDomainOwnershipIdentifiersSlotResponder(resp *http.Response) (result IdentifierCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listDomainOwnershipIdentifiersSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listDomainOwnershipIdentifiersSlotNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { + req, err := lastResults.identifierCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListDomainOwnershipIdentifiersSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListDomainOwnershipIdentifiersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listDomainOwnershipIdentifiersSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListDomainOwnershipIdentifiersSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListDomainOwnershipIdentifiersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result IdentifierCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListDomainOwnershipIdentifiersSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListDomainOwnershipIdentifiersSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListFunctionKeys description for Get function keys for a function in a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +func (client AppsClient) ListFunctionKeys(ctx context.Context, resourceGroupName string, name string, functionName string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListFunctionKeys", err.Error()) + } + + req, err := client.ListFunctionKeysPreparer(ctx, resourceGroupName, name, functionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListFunctionKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeys", resp, "Failure sending request") + return + } + + result, err = client.ListFunctionKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListFunctionKeysPreparer prepares the ListFunctionKeys request. +func (client AppsClient) ListFunctionKeysPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFunctionKeysSender sends the ListFunctionKeys request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListFunctionKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFunctionKeysResponder handles the response to the ListFunctionKeys request. The method always +// closes the http.Response Body. +func (client AppsClient) ListFunctionKeysResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFunctionKeysSlot description for Get function keys for a function in a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) ListFunctionKeysSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionKeysSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListFunctionKeysSlot", err.Error()) + } + + req, err := client.ListFunctionKeysSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeysSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListFunctionKeysSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeysSlot", resp, "Failure sending request") + return + } + + result, err = client.ListFunctionKeysSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionKeysSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListFunctionKeysSlotPreparer prepares the ListFunctionKeysSlot request. +func (client AppsClient) ListFunctionKeysSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFunctionKeysSlotSender sends the ListFunctionKeysSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListFunctionKeysSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFunctionKeysSlotResponder handles the response to the ListFunctionKeysSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListFunctionKeysSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFunctions description for List the functions for a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListFunctions(ctx context.Context, resourceGroupName string, name string) (result FunctionEnvelopeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctions") + defer func() { + sc := -1 + if result.fec.Response.Response != nil { + sc = result.fec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListFunctions", err.Error()) + } + + result.fn = client.listFunctionsNextResults + req, err := client.ListFunctionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListFunctionsSender(req) + if err != nil { + result.fec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", resp, "Failure sending request") + return + } + + result.fec, err = client.ListFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctions", resp, "Failure responding to request") + return + } + if result.fec.hasNextLink() && result.fec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListFunctionsPreparer prepares the ListFunctions request. +func (client AppsClient) ListFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFunctionsSender sends the ListFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFunctionsResponder handles the response to the ListFunctions request. The method always +// closes the http.Response Body. +func (client AppsClient) ListFunctionsResponder(resp *http.Response) (result FunctionEnvelopeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listFunctionsNextResults retrieves the next set of results, if any. +func (client AppsClient) listFunctionsNextResults(ctx context.Context, lastResults FunctionEnvelopeCollection) (result FunctionEnvelopeCollection, err error) { + req, err := lastResults.functionEnvelopeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listFunctionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListFunctionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result FunctionEnvelopeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListFunctions(ctx, resourceGroupName, name) + return +} + +// ListFunctionSecrets description for Get function secrets for a function in a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +func (client AppsClient) ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string) (result FunctionSecrets, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListFunctionSecrets", err.Error()) + } + + req, err := client.ListFunctionSecretsPreparer(ctx, resourceGroupName, name, functionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListFunctionSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListFunctionSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecrets", resp, "Failure responding to request") + return + } + + return +} + +// ListFunctionSecretsPreparer prepares the ListFunctionSecrets request. +func (client AppsClient) ListFunctionSecretsPreparer(ctx context.Context, resourceGroupName string, name string, functionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/functions/{functionName}/listsecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFunctionSecretsSender sends the ListFunctionSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListFunctionSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFunctionSecretsResponder handles the response to the ListFunctionSecrets request. The method always +// closes the http.Response Body. +func (client AppsClient) ListFunctionSecretsResponder(resp *http.Response) (result FunctionSecrets, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListFunctionSecretsSlot description for Get function secrets for a function in a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// functionName - function name. +// slot - name of the deployment slot. +func (client AppsClient) ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result FunctionSecrets, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListFunctionSecretsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListFunctionSecretsSlot", err.Error()) + } + + req, err := client.ListFunctionSecretsSlotPreparer(ctx, resourceGroupName, name, functionName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListFunctionSecretsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListFunctionSecretsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListFunctionSecretsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListFunctionSecretsSlotPreparer prepares the ListFunctionSecretsSlot request. +func (client AppsClient) ListFunctionSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionName": autorest.Encode("path", functionName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions/{functionName}/listsecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListFunctionSecretsSlotSender sends the ListFunctionSecretsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListFunctionSecretsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListFunctionSecretsSlotResponder handles the response to the ListFunctionSecretsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListFunctionSecretsSlotResponder(resp *http.Response) (result FunctionSecrets, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHostKeys description for Get host secrets for a function app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListHostKeys(ctx context.Context, resourceGroupName string, name string) (result HostKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListHostKeys", err.Error()) + } + + req, err := client.ListHostKeysPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListHostKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeys", resp, "Failure sending request") + return + } + + result, err = client.ListHostKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListHostKeysPreparer prepares the ListHostKeys request. +func (client AppsClient) ListHostKeysPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHostKeysSender sends the ListHostKeys request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListHostKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHostKeysResponder handles the response to the ListHostKeys request. The method always +// closes the http.Response Body. +func (client AppsClient) ListHostKeysResponder(resp *http.Response) (result HostKeys, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHostKeysSlot description for Get host secrets for a function app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. +func (client AppsClient) ListHostKeysSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HostKeys, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostKeysSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListHostKeysSlot", err.Error()) + } + + req, err := client.ListHostKeysSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeysSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListHostKeysSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeysSlot", resp, "Failure sending request") + return + } + + result, err = client.ListHostKeysSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostKeysSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListHostKeysSlotPreparer prepares the ListHostKeysSlot request. +func (client AppsClient) ListHostKeysSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHostKeysSlotSender sends the ListHostKeysSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListHostKeysSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHostKeysSlotResponder handles the response to the ListHostKeysSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListHostKeysSlotResponder(resp *http.Response) (result HostKeys, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHostNameBindings description for Get hostname bindings for an app or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListHostNameBindings(ctx context.Context, resourceGroupName string, name string) (result HostNameBindingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostNameBindings") + defer func() { + sc := -1 + if result.hnbc.Response.Response != nil { + sc = result.hnbc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListHostNameBindings", err.Error()) + } + + result.fn = client.listHostNameBindingsNextResults + req, err := client.ListHostNameBindingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostNameBindings", nil, "Failure preparing request") + return + } + + resp, err := client.ListHostNameBindingsSender(req) + if err != nil { + result.hnbc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostNameBindings", resp, "Failure sending request") + return + } + + result.hnbc, err = client.ListHostNameBindingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostNameBindings", resp, "Failure responding to request") + return + } + if result.hnbc.hasNextLink() && result.hnbc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListHostNameBindingsPreparer prepares the ListHostNameBindings request. +func (client AppsClient) ListHostNameBindingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hostNameBindings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHostNameBindingsSender sends the ListHostNameBindings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListHostNameBindingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHostNameBindingsResponder handles the response to the ListHostNameBindings request. The method always +// closes the http.Response Body. +func (client AppsClient) ListHostNameBindingsResponder(resp *http.Response) (result HostNameBindingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHostNameBindingsNextResults retrieves the next set of results, if any. +func (client AppsClient) listHostNameBindingsNextResults(ctx context.Context, lastResults HostNameBindingCollection) (result HostNameBindingCollection, err error) { + req, err := lastResults.hostNameBindingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listHostNameBindingsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHostNameBindingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listHostNameBindingsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHostNameBindingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listHostNameBindingsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHostNameBindingsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListHostNameBindingsComplete(ctx context.Context, resourceGroupName string, name string) (result HostNameBindingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostNameBindings") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListHostNameBindings(ctx, resourceGroupName, name) + return +} + +// ListHostNameBindingsSlot description for Get hostname bindings for an app or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the +// production slot. +func (client AppsClient) ListHostNameBindingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HostNameBindingCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostNameBindingsSlot") + defer func() { + sc := -1 + if result.hnbc.Response.Response != nil { + sc = result.hnbc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListHostNameBindingsSlot", err.Error()) + } + + result.fn = client.listHostNameBindingsSlotNextResults + req, err := client.ListHostNameBindingsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostNameBindingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListHostNameBindingsSlotSender(req) + if err != nil { + result.hnbc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostNameBindingsSlot", resp, "Failure sending request") + return + } + + result.hnbc, err = client.ListHostNameBindingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHostNameBindingsSlot", resp, "Failure responding to request") + return + } + if result.hnbc.hasNextLink() && result.hnbc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListHostNameBindingsSlotPreparer prepares the ListHostNameBindingsSlot request. +func (client AppsClient) ListHostNameBindingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hostNameBindings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHostNameBindingsSlotSender sends the ListHostNameBindingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListHostNameBindingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHostNameBindingsSlotResponder handles the response to the ListHostNameBindingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListHostNameBindingsSlotResponder(resp *http.Response) (result HostNameBindingCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHostNameBindingsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listHostNameBindingsSlotNextResults(ctx context.Context, lastResults HostNameBindingCollection) (result HostNameBindingCollection, err error) { + req, err := lastResults.hostNameBindingCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listHostNameBindingsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHostNameBindingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listHostNameBindingsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHostNameBindingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listHostNameBindingsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHostNameBindingsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListHostNameBindingsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result HostNameBindingCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHostNameBindingsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListHostNameBindingsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListHybridConnections description for Retrieves all Service Bus Hybrid Connections used by this Web App. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +func (client AppsClient) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnections") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListHybridConnections", err.Error()) + } + + req, err := client.ListHybridConnectionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", nil, "Failure preparing request") + return + } + + resp, err := client.ListHybridConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", resp, "Failure sending request") + return + } + + result, err = client.ListHybridConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnections", resp, "Failure responding to request") + return + } + + return +} + +// ListHybridConnectionsPreparer prepares the ListHybridConnections request. +func (client AppsClient) ListHybridConnectionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionRelays", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHybridConnectionsSender sends the ListHybridConnections request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListHybridConnectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHybridConnectionsResponder handles the response to the ListHybridConnections request. The method always +// closes the http.Response Body. +func (client AppsClient) ListHybridConnectionsResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHybridConnectionsSlot description for Retrieves all Service Bus Hybrid Connections used by this Web App. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for the web app. +func (client AppsClient) ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListHybridConnectionsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListHybridConnectionsSlot", err.Error()) + } + + req, err := client.ListHybridConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListHybridConnectionsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListHybridConnectionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListHybridConnectionsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListHybridConnectionsSlotPreparer prepares the ListHybridConnectionsSlot request. +func (client AppsClient) ListHybridConnectionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionRelays", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHybridConnectionsSlotSender sends the ListHybridConnectionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListHybridConnectionsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHybridConnectionsSlotResponder handles the response to the ListHybridConnectionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListHybridConnectionsSlotResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListInstanceFunctionsSlot description for List the functions for a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. +func (client AppsClient) ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionEnvelopeCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceFunctionsSlot") + defer func() { + sc := -1 + if result.fec.Response.Response != nil { + sc = result.fec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceFunctionsSlot", err.Error()) + } + + result.fn = client.listInstanceFunctionsSlotNextResults + req, err := client.ListInstanceFunctionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceFunctionsSlotSender(req) + if err != nil { + result.fec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", resp, "Failure sending request") + return + } + + result.fec, err = client.ListInstanceFunctionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceFunctionsSlot", resp, "Failure responding to request") + return + } + if result.fec.hasNextLink() && result.fec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceFunctionsSlotPreparer prepares the ListInstanceFunctionsSlot request. +func (client AppsClient) ListInstanceFunctionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/functions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceFunctionsSlotSender sends the ListInstanceFunctionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceFunctionsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceFunctionsSlotResponder handles the response to the ListInstanceFunctionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceFunctionsSlotResponder(resp *http.Response) (result FunctionEnvelopeCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceFunctionsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceFunctionsSlotNextResults(ctx context.Context, lastResults FunctionEnvelopeCollection) (result FunctionEnvelopeCollection, err error) { + req, err := lastResults.functionEnvelopeCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceFunctionsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceFunctionsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceFunctionsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceFunctionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceFunctionsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceFunctionsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceFunctionsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionEnvelopeCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceFunctionsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceFunctionsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListInstanceIdentifiers description for Gets all scale-out instances of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListInstanceIdentifiers(ctx context.Context, resourceGroupName string, name string) (result AppInstanceStatusCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceIdentifiers") + defer func() { + sc := -1 + if result.aisc.Response.Response != nil { + sc = result.aisc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceIdentifiers", err.Error()) + } + + result.fn = client.listInstanceIdentifiersNextResults + req, err := client.ListInstanceIdentifiersPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceIdentifiers", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceIdentifiersSender(req) + if err != nil { + result.aisc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceIdentifiers", resp, "Failure sending request") + return + } + + result.aisc, err = client.ListInstanceIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceIdentifiers", resp, "Failure responding to request") + return + } + if result.aisc.hasNextLink() && result.aisc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceIdentifiersPreparer prepares the ListInstanceIdentifiers request. +func (client AppsClient) ListInstanceIdentifiersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceIdentifiersSender sends the ListInstanceIdentifiers request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceIdentifiersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceIdentifiersResponder handles the response to the ListInstanceIdentifiers request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceIdentifiersResponder(resp *http.Response) (result AppInstanceStatusCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceIdentifiersNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceIdentifiersNextResults(ctx context.Context, lastResults AppInstanceStatusCollection) (result AppInstanceStatusCollection, err error) { + req, err := lastResults.appInstanceStatusCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceIdentifiersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceIdentifiersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceIdentifiersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceIdentifiersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceIdentifiersComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceIdentifiersComplete(ctx context.Context, resourceGroupName string, name string) (result AppInstanceStatusCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceIdentifiers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceIdentifiers(ctx, resourceGroupName, name) + return +} + +// ListInstanceIdentifiersSlot description for Gets all scale-out instances of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API gets the production slot instances. +func (client AppsClient) ListInstanceIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AppInstanceStatusCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceIdentifiersSlot") + defer func() { + sc := -1 + if result.aisc.Response.Response != nil { + sc = result.aisc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceIdentifiersSlot", err.Error()) + } + + result.fn = client.listInstanceIdentifiersSlotNextResults + req, err := client.ListInstanceIdentifiersSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceIdentifiersSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceIdentifiersSlotSender(req) + if err != nil { + result.aisc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceIdentifiersSlot", resp, "Failure sending request") + return + } + + result.aisc, err = client.ListInstanceIdentifiersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceIdentifiersSlot", resp, "Failure responding to request") + return + } + if result.aisc.hasNextLink() && result.aisc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceIdentifiersSlotPreparer prepares the ListInstanceIdentifiersSlot request. +func (client AppsClient) ListInstanceIdentifiersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceIdentifiersSlotSender sends the ListInstanceIdentifiersSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceIdentifiersSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceIdentifiersSlotResponder handles the response to the ListInstanceIdentifiersSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceIdentifiersSlotResponder(resp *http.Response) (result AppInstanceStatusCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceIdentifiersSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceIdentifiersSlotNextResults(ctx context.Context, lastResults AppInstanceStatusCollection) (result AppInstanceStatusCollection, err error) { + req, err := lastResults.appInstanceStatusCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceIdentifiersSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceIdentifiersSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceIdentifiersSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceIdentifiersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceIdentifiersSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceIdentifiersSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceIdentifiersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result AppInstanceStatusCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceIdentifiersSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceIdentifiersSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListInstanceProcesses description for Get list of processes for a web site, or a deployment slot, or for a specific +// scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) ListInstanceProcesses(ctx context.Context, resourceGroupName string, name string, instanceID string) (result ProcessInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcesses") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceProcesses", err.Error()) + } + + result.fn = client.listInstanceProcessesNextResults + req, err := client.ListInstanceProcessesPreparer(ctx, resourceGroupName, name, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcesses", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceProcessesSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcesses", resp, "Failure sending request") + return + } + + result.pic, err = client.ListInstanceProcessesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcesses", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceProcessesPreparer prepares the ListInstanceProcesses request. +func (client AppsClient) ListInstanceProcessesPreparer(ctx context.Context, resourceGroupName string, name string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceProcessesSender sends the ListInstanceProcesses request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceProcessesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceProcessesResponder handles the response to the ListInstanceProcesses request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceProcessesResponder(resp *http.Response) (result ProcessInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceProcessesNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceProcessesNextResults(ctx context.Context, lastResults ProcessInfoCollection) (result ProcessInfoCollection, err error) { + req, err := lastResults.processInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceProcessesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceProcessesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceProcessesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceProcessesComplete(ctx context.Context, resourceGroupName string, name string, instanceID string) (result ProcessInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcesses") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceProcesses(ctx, resourceGroupName, name, instanceID) + return +} + +// ListInstanceProcessesSlot description for Get list of processes for a web site, or a deployment slot, or for a +// specific scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) ListInstanceProcessesSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result ProcessInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessesSlot") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceProcessesSlot", err.Error()) + } + + result.fn = client.listInstanceProcessesSlotNextResults + req, err := client.ListInstanceProcessesSlotPreparer(ctx, resourceGroupName, name, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceProcessesSlotSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessesSlot", resp, "Failure sending request") + return + } + + result.pic, err = client.ListInstanceProcessesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessesSlot", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceProcessesSlotPreparer prepares the ListInstanceProcessesSlot request. +func (client AppsClient) ListInstanceProcessesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceProcessesSlotSender sends the ListInstanceProcessesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceProcessesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceProcessesSlotResponder handles the response to the ListInstanceProcessesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceProcessesSlotResponder(resp *http.Response) (result ProcessInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceProcessesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceProcessesSlotNextResults(ctx context.Context, lastResults ProcessInfoCollection) (result ProcessInfoCollection, err error) { + req, err := lastResults.processInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceProcessesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceProcessesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceProcessesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceProcessesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result ProcessInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceProcessesSlot(ctx, resourceGroupName, name, slot, instanceID) + return +} + +// ListInstanceProcessModules description for List module information for a process by its ID for a specific scaled-out +// instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) ListInstanceProcessModules(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessModuleInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessModules") + defer func() { + sc := -1 + if result.pmic.Response.Response != nil { + sc = result.pmic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceProcessModules", err.Error()) + } + + result.fn = client.listInstanceProcessModulesNextResults + req, err := client.ListInstanceProcessModulesPreparer(ctx, resourceGroupName, name, processID, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessModules", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceProcessModulesSender(req) + if err != nil { + result.pmic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessModules", resp, "Failure sending request") + return + } + + result.pmic, err = client.ListInstanceProcessModulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessModules", resp, "Failure responding to request") + return + } + if result.pmic.hasNextLink() && result.pmic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceProcessModulesPreparer prepares the ListInstanceProcessModules request. +func (client AppsClient) ListInstanceProcessModulesPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceProcessModulesSender sends the ListInstanceProcessModules request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceProcessModulesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceProcessModulesResponder handles the response to the ListInstanceProcessModules request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceProcessModulesResponder(resp *http.Response) (result ProcessModuleInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceProcessModulesNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceProcessModulesNextResults(ctx context.Context, lastResults ProcessModuleInfoCollection) (result ProcessModuleInfoCollection, err error) { + req, err := lastResults.processModuleInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessModulesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceProcessModulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessModulesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceProcessModulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessModulesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceProcessModulesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceProcessModulesComplete(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessModuleInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessModules") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceProcessModules(ctx, resourceGroupName, name, processID, instanceID) + return +} + +// ListInstanceProcessModulesSlot description for List module information for a process by its ID for a specific +// scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) ListInstanceProcessModulesSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessModuleInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessModulesSlot") + defer func() { + sc := -1 + if result.pmic.Response.Response != nil { + sc = result.pmic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceProcessModulesSlot", err.Error()) + } + + result.fn = client.listInstanceProcessModulesSlotNextResults + req, err := client.ListInstanceProcessModulesSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessModulesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceProcessModulesSlotSender(req) + if err != nil { + result.pmic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessModulesSlot", resp, "Failure sending request") + return + } + + result.pmic, err = client.ListInstanceProcessModulesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessModulesSlot", resp, "Failure responding to request") + return + } + if result.pmic.hasNextLink() && result.pmic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceProcessModulesSlotPreparer prepares the ListInstanceProcessModulesSlot request. +func (client AppsClient) ListInstanceProcessModulesSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceProcessModulesSlotSender sends the ListInstanceProcessModulesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceProcessModulesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceProcessModulesSlotResponder handles the response to the ListInstanceProcessModulesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceProcessModulesSlotResponder(resp *http.Response) (result ProcessModuleInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceProcessModulesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceProcessModulesSlotNextResults(ctx context.Context, lastResults ProcessModuleInfoCollection) (result ProcessModuleInfoCollection, err error) { + req, err := lastResults.processModuleInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessModulesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceProcessModulesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessModulesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceProcessModulesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessModulesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceProcessModulesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceProcessModulesSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessModuleInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessModulesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceProcessModulesSlot(ctx, resourceGroupName, name, processID, slot, instanceID) + return +} + +// ListInstanceProcessThreads description for List the threads in a process by its ID for a specific scaled-out +// instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) ListInstanceProcessThreads(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessThreadInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessThreads") + defer func() { + sc := -1 + if result.ptic.Response.Response != nil { + sc = result.ptic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceProcessThreads", err.Error()) + } + + result.fn = client.listInstanceProcessThreadsNextResults + req, err := client.ListInstanceProcessThreadsPreparer(ctx, resourceGroupName, name, processID, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessThreads", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceProcessThreadsSender(req) + if err != nil { + result.ptic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessThreads", resp, "Failure sending request") + return + } + + result.ptic, err = client.ListInstanceProcessThreadsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessThreads", resp, "Failure responding to request") + return + } + if result.ptic.hasNextLink() && result.ptic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceProcessThreadsPreparer prepares the ListInstanceProcessThreads request. +func (client AppsClient) ListInstanceProcessThreadsPreparer(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/instances/{instanceId}/processes/{processId}/threads", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceProcessThreadsSender sends the ListInstanceProcessThreads request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceProcessThreadsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceProcessThreadsResponder handles the response to the ListInstanceProcessThreads request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceProcessThreadsResponder(resp *http.Response) (result ProcessThreadInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceProcessThreadsNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceProcessThreadsNextResults(ctx context.Context, lastResults ProcessThreadInfoCollection) (result ProcessThreadInfoCollection, err error) { + req, err := lastResults.processThreadInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessThreadsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceProcessThreadsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessThreadsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceProcessThreadsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessThreadsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceProcessThreadsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceProcessThreadsComplete(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result ProcessThreadInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessThreads") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceProcessThreads(ctx, resourceGroupName, name, processID, instanceID) + return +} + +// ListInstanceProcessThreadsSlot description for List the threads in a process by its ID for a specific scaled-out +// instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +// instanceID - ID of a specific scaled-out instance. This is the value of the name property in the JSON +// response from "GET api/sites/{siteName}/instances". +func (client AppsClient) ListInstanceProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessThreadInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessThreadsSlot") + defer func() { + sc := -1 + if result.ptic.Response.Response != nil { + sc = result.ptic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListInstanceProcessThreadsSlot", err.Error()) + } + + result.fn = client.listInstanceProcessThreadsSlotNextResults + req, err := client.ListInstanceProcessThreadsSlotPreparer(ctx, resourceGroupName, name, processID, slot, instanceID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessThreadsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListInstanceProcessThreadsSlotSender(req) + if err != nil { + result.ptic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessThreadsSlot", resp, "Failure sending request") + return + } + + result.ptic, err = client.ListInstanceProcessThreadsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListInstanceProcessThreadsSlot", resp, "Failure responding to request") + return + } + if result.ptic.hasNextLink() && result.ptic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListInstanceProcessThreadsSlotPreparer prepares the ListInstanceProcessThreadsSlot request. +func (client AppsClient) ListInstanceProcessThreadsSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instanceId": autorest.Encode("path", instanceID), + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/instances/{instanceId}/processes/{processId}/threads", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListInstanceProcessThreadsSlotSender sends the ListInstanceProcessThreadsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListInstanceProcessThreadsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListInstanceProcessThreadsSlotResponder handles the response to the ListInstanceProcessThreadsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListInstanceProcessThreadsSlotResponder(resp *http.Response) (result ProcessThreadInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listInstanceProcessThreadsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listInstanceProcessThreadsSlotNextResults(ctx context.Context, lastResults ProcessThreadInfoCollection) (result ProcessThreadInfoCollection, err error) { + req, err := lastResults.processThreadInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessThreadsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListInstanceProcessThreadsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessThreadsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListInstanceProcessThreadsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listInstanceProcessThreadsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListInstanceProcessThreadsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListInstanceProcessThreadsSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result ProcessThreadInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListInstanceProcessThreadsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListInstanceProcessThreadsSlot(ctx, resourceGroupName, name, processID, slot, instanceID) + return +} + +// ListMetadata description for Gets the metadata of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListMetadata(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetadata") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListMetadata", err.Error()) + } + + req, err := client.ListMetadataPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetadata", resp, "Failure sending request") + return + } + + result, err = client.ListMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetadata", resp, "Failure responding to request") + return + } + + return +} + +// ListMetadataPreparer prepares the ListMetadata request. +func (client AppsClient) ListMetadataPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetadataSender sends the ListMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListMetadataSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetadataResponder handles the response to the ListMetadata request. The method always +// closes the http.Response Body. +func (client AppsClient) ListMetadataResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMetadataSlot description for Gets the metadata of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the metadata for the +// production slot. +func (client AppsClient) ListMetadataSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListMetadataSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListMetadataSlot", err.Error()) + } + + req, err := client.ListMetadataSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetadataSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListMetadataSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetadataSlot", resp, "Failure sending request") + return + } + + result, err = client.ListMetadataSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListMetadataSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListMetadataSlotPreparer prepares the ListMetadataSlot request. +func (client AppsClient) ListMetadataSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMetadataSlotSender sends the ListMetadataSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListMetadataSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMetadataSlotResponder handles the response to the ListMetadataSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListMetadataSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNetworkFeatures description for Gets all network features used by the app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// view - the type of view. Only "summary" is supported at this time. +func (client AppsClient) ListNetworkFeatures(ctx context.Context, resourceGroupName string, name string, view string) (result NetworkFeatures, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListNetworkFeatures") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListNetworkFeatures", err.Error()) + } + + req, err := client.ListNetworkFeaturesPreparer(ctx, resourceGroupName, name, view) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListNetworkFeatures", nil, "Failure preparing request") + return + } + + resp, err := client.ListNetworkFeaturesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListNetworkFeatures", resp, "Failure sending request") + return + } + + result, err = client.ListNetworkFeaturesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListNetworkFeatures", resp, "Failure responding to request") + return + } + + return +} + +// ListNetworkFeaturesPreparer prepares the ListNetworkFeatures request. +func (client AppsClient) ListNetworkFeaturesPreparer(ctx context.Context, resourceGroupName string, name string, view string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "view": autorest.Encode("path", view), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkFeatures/{view}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNetworkFeaturesSender sends the ListNetworkFeatures request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListNetworkFeaturesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListNetworkFeaturesResponder handles the response to the ListNetworkFeatures request. The method always +// closes the http.Response Body. +func (client AppsClient) ListNetworkFeaturesResponder(resp *http.Response) (result NetworkFeatures, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListNetworkFeaturesSlot description for Gets all network features used by the app (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// view - the type of view. Only "summary" is supported at this time. +// slot - name of the deployment slot. If a slot is not specified, the API will get network features for the +// production slot. +func (client AppsClient) ListNetworkFeaturesSlot(ctx context.Context, resourceGroupName string, name string, view string, slot string) (result NetworkFeatures, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListNetworkFeaturesSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListNetworkFeaturesSlot", err.Error()) + } + + req, err := client.ListNetworkFeaturesSlotPreparer(ctx, resourceGroupName, name, view, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListNetworkFeaturesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListNetworkFeaturesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListNetworkFeaturesSlot", resp, "Failure sending request") + return + } + + result, err = client.ListNetworkFeaturesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListNetworkFeaturesSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListNetworkFeaturesSlotPreparer prepares the ListNetworkFeaturesSlot request. +func (client AppsClient) ListNetworkFeaturesSlotPreparer(ctx context.Context, resourceGroupName string, name string, view string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "view": autorest.Encode("path", view), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkFeatures/{view}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListNetworkFeaturesSlotSender sends the ListNetworkFeaturesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListNetworkFeaturesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListNetworkFeaturesSlotResponder handles the response to the ListNetworkFeaturesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListNetworkFeaturesSlotResponder(resp *http.Response) (result NetworkFeatures, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPerfMonCounters description for Gets perfmon counters for web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq +// duration'[Hour|Minute|Day]'. +func (client AppsClient) ListPerfMonCounters(ctx context.Context, resourceGroupName string, name string, filter string) (result PerfMonCounterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPerfMonCounters") + defer func() { + sc := -1 + if result.pmcc.Response.Response != nil { + sc = result.pmcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPerfMonCounters", err.Error()) + } + + result.fn = client.listPerfMonCountersNextResults + req, err := client.ListPerfMonCountersPreparer(ctx, resourceGroupName, name, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPerfMonCounters", nil, "Failure preparing request") + return + } + + resp, err := client.ListPerfMonCountersSender(req) + if err != nil { + result.pmcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPerfMonCounters", resp, "Failure sending request") + return + } + + result.pmcc, err = client.ListPerfMonCountersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPerfMonCounters", resp, "Failure responding to request") + return + } + if result.pmcc.hasNextLink() && result.pmcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPerfMonCountersPreparer prepares the ListPerfMonCounters request. +func (client AppsClient) ListPerfMonCountersPreparer(ctx context.Context, resourceGroupName string, name string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/perfcounters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPerfMonCountersSender sends the ListPerfMonCounters request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPerfMonCountersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPerfMonCountersResponder handles the response to the ListPerfMonCounters request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPerfMonCountersResponder(resp *http.Response) (result PerfMonCounterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPerfMonCountersNextResults retrieves the next set of results, if any. +func (client AppsClient) listPerfMonCountersNextResults(ctx context.Context, lastResults PerfMonCounterCollection) (result PerfMonCounterCollection, err error) { + req, err := lastResults.perfMonCounterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPerfMonCountersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPerfMonCountersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPerfMonCountersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPerfMonCountersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listPerfMonCountersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPerfMonCountersComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListPerfMonCountersComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result PerfMonCounterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPerfMonCounters") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPerfMonCounters(ctx, resourceGroupName, name, filter) + return +} + +// ListPerfMonCountersSlot description for Gets perfmon counters for web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq +// duration'[Hour|Minute|Day]'. +func (client AppsClient) ListPerfMonCountersSlot(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result PerfMonCounterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPerfMonCountersSlot") + defer func() { + sc := -1 + if result.pmcc.Response.Response != nil { + sc = result.pmcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPerfMonCountersSlot", err.Error()) + } + + result.fn = client.listPerfMonCountersSlotNextResults + req, err := client.ListPerfMonCountersSlotPreparer(ctx, resourceGroupName, name, slot, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPerfMonCountersSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListPerfMonCountersSlotSender(req) + if err != nil { + result.pmcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPerfMonCountersSlot", resp, "Failure sending request") + return + } + + result.pmcc, err = client.ListPerfMonCountersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPerfMonCountersSlot", resp, "Failure responding to request") + return + } + if result.pmcc.hasNextLink() && result.pmcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPerfMonCountersSlotPreparer prepares the ListPerfMonCountersSlot request. +func (client AppsClient) ListPerfMonCountersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/perfcounters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPerfMonCountersSlotSender sends the ListPerfMonCountersSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPerfMonCountersSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPerfMonCountersSlotResponder handles the response to the ListPerfMonCountersSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPerfMonCountersSlotResponder(resp *http.Response) (result PerfMonCounterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPerfMonCountersSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listPerfMonCountersSlotNextResults(ctx context.Context, lastResults PerfMonCounterCollection) (result PerfMonCounterCollection, err error) { + req, err := lastResults.perfMonCounterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPerfMonCountersSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPerfMonCountersSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPerfMonCountersSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPerfMonCountersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listPerfMonCountersSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPerfMonCountersSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListPerfMonCountersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result PerfMonCounterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPerfMonCountersSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPerfMonCountersSlot(ctx, resourceGroupName, name, slot, filter) + return +} + +// ListPremierAddOns description for Gets the premier add-ons of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListPremierAddOns(ctx context.Context, resourceGroupName string, name string) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPremierAddOns") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPremierAddOns", err.Error()) + } + + req, err := client.ListPremierAddOnsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPremierAddOns", nil, "Failure preparing request") + return + } + + resp, err := client.ListPremierAddOnsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPremierAddOns", resp, "Failure sending request") + return + } + + result, err = client.ListPremierAddOnsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPremierAddOns", resp, "Failure responding to request") + return + } + + return +} + +// ListPremierAddOnsPreparer prepares the ListPremierAddOns request. +func (client AppsClient) ListPremierAddOnsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPremierAddOnsSender sends the ListPremierAddOns request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPremierAddOnsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPremierAddOnsResponder handles the response to the ListPremierAddOns request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPremierAddOnsResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPremierAddOnsSlot description for Gets the premier add-ons of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the premier add-ons for the +// production slot. +func (client AppsClient) ListPremierAddOnsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPremierAddOnsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPremierAddOnsSlot", err.Error()) + } + + req, err := client.ListPremierAddOnsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPremierAddOnsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListPremierAddOnsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPremierAddOnsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListPremierAddOnsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPremierAddOnsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListPremierAddOnsSlotPreparer prepares the ListPremierAddOnsSlot request. +func (client AppsClient) ListPremierAddOnsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPremierAddOnsSlotSender sends the ListPremierAddOnsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPremierAddOnsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPremierAddOnsSlotResponder handles the response to the ListPremierAddOnsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPremierAddOnsSlotResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListProcesses description for Get list of processes for a web site, or a deployment slot, or for a specific +// scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListProcesses(ctx context.Context, resourceGroupName string, name string) (result ProcessInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcesses") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListProcesses", err.Error()) + } + + result.fn = client.listProcessesNextResults + req, err := client.ListProcessesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcesses", nil, "Failure preparing request") + return + } + + resp, err := client.ListProcessesSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcesses", resp, "Failure sending request") + return + } + + result.pic, err = client.ListProcessesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcesses", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListProcessesPreparer prepares the ListProcesses request. +func (client AppsClient) ListProcessesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProcessesSender sends the ListProcesses request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListProcessesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProcessesResponder handles the response to the ListProcesses request. The method always +// closes the http.Response Body. +func (client AppsClient) ListProcessesResponder(resp *http.Response) (result ProcessInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listProcessesNextResults retrieves the next set of results, if any. +func (client AppsClient) listProcessesNextResults(ctx context.Context, lastResults ProcessInfoCollection) (result ProcessInfoCollection, err error) { + req, err := lastResults.processInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListProcessesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListProcessesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listProcessesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListProcessesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListProcessesComplete(ctx context.Context, resourceGroupName string, name string) (result ProcessInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcesses") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListProcesses(ctx, resourceGroupName, name) + return +} + +// ListProcessesSlot description for Get list of processes for a web site, or a deployment slot, or for a specific +// scaled-out instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListProcessesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ProcessInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessesSlot") + defer func() { + sc := -1 + if result.pic.Response.Response != nil { + sc = result.pic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListProcessesSlot", err.Error()) + } + + result.fn = client.listProcessesSlotNextResults + req, err := client.ListProcessesSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListProcessesSlotSender(req) + if err != nil { + result.pic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessesSlot", resp, "Failure sending request") + return + } + + result.pic, err = client.ListProcessesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessesSlot", resp, "Failure responding to request") + return + } + if result.pic.hasNextLink() && result.pic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListProcessesSlotPreparer prepares the ListProcessesSlot request. +func (client AppsClient) ListProcessesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProcessesSlotSender sends the ListProcessesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListProcessesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProcessesSlotResponder handles the response to the ListProcessesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListProcessesSlotResponder(resp *http.Response) (result ProcessInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listProcessesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listProcessesSlotNextResults(ctx context.Context, lastResults ProcessInfoCollection) (result ProcessInfoCollection, err error) { + req, err := lastResults.processInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListProcessesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListProcessesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listProcessesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListProcessesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListProcessesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result ProcessInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListProcessesSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListProcessModules description for List module information for a process by its ID for a specific scaled-out +// instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +func (client AppsClient) ListProcessModules(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessModuleInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessModules") + defer func() { + sc := -1 + if result.pmic.Response.Response != nil { + sc = result.pmic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListProcessModules", err.Error()) + } + + result.fn = client.listProcessModulesNextResults + req, err := client.ListProcessModulesPreparer(ctx, resourceGroupName, name, processID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessModules", nil, "Failure preparing request") + return + } + + resp, err := client.ListProcessModulesSender(req) + if err != nil { + result.pmic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessModules", resp, "Failure sending request") + return + } + + result.pmic, err = client.ListProcessModulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessModules", resp, "Failure responding to request") + return + } + if result.pmic.hasNextLink() && result.pmic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListProcessModulesPreparer prepares the ListProcessModules request. +func (client AppsClient) ListProcessModulesPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProcessModulesSender sends the ListProcessModules request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListProcessModulesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProcessModulesResponder handles the response to the ListProcessModules request. The method always +// closes the http.Response Body. +func (client AppsClient) ListProcessModulesResponder(resp *http.Response) (result ProcessModuleInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listProcessModulesNextResults retrieves the next set of results, if any. +func (client AppsClient) listProcessModulesNextResults(ctx context.Context, lastResults ProcessModuleInfoCollection) (result ProcessModuleInfoCollection, err error) { + req, err := lastResults.processModuleInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessModulesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListProcessModulesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessModulesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListProcessModulesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listProcessModulesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListProcessModulesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListProcessModulesComplete(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessModuleInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessModules") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListProcessModules(ctx, resourceGroupName, name, processID) + return +} + +// ListProcessModulesSlot description for List module information for a process by its ID for a specific scaled-out +// instance in a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListProcessModulesSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessModuleInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessModulesSlot") + defer func() { + sc := -1 + if result.pmic.Response.Response != nil { + sc = result.pmic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListProcessModulesSlot", err.Error()) + } + + result.fn = client.listProcessModulesSlotNextResults + req, err := client.ListProcessModulesSlotPreparer(ctx, resourceGroupName, name, processID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessModulesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListProcessModulesSlotSender(req) + if err != nil { + result.pmic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessModulesSlot", resp, "Failure sending request") + return + } + + result.pmic, err = client.ListProcessModulesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessModulesSlot", resp, "Failure responding to request") + return + } + if result.pmic.hasNextLink() && result.pmic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListProcessModulesSlotPreparer prepares the ListProcessModulesSlot request. +func (client AppsClient) ListProcessModulesSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/modules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProcessModulesSlotSender sends the ListProcessModulesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListProcessModulesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProcessModulesSlotResponder handles the response to the ListProcessModulesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListProcessModulesSlotResponder(resp *http.Response) (result ProcessModuleInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listProcessModulesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listProcessModulesSlotNextResults(ctx context.Context, lastResults ProcessModuleInfoCollection) (result ProcessModuleInfoCollection, err error) { + req, err := lastResults.processModuleInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessModulesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListProcessModulesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessModulesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListProcessModulesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listProcessModulesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListProcessModulesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListProcessModulesSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessModuleInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessModulesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListProcessModulesSlot(ctx, resourceGroupName, name, processID, slot) + return +} + +// ListProcessThreads description for List the threads in a process by its ID for a specific scaled-out instance in a +// web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +func (client AppsClient) ListProcessThreads(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessThreadInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessThreads") + defer func() { + sc := -1 + if result.ptic.Response.Response != nil { + sc = result.ptic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListProcessThreads", err.Error()) + } + + result.fn = client.listProcessThreadsNextResults + req, err := client.ListProcessThreadsPreparer(ctx, resourceGroupName, name, processID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessThreads", nil, "Failure preparing request") + return + } + + resp, err := client.ListProcessThreadsSender(req) + if err != nil { + result.ptic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessThreads", resp, "Failure sending request") + return + } + + result.ptic, err = client.ListProcessThreadsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessThreads", resp, "Failure responding to request") + return + } + if result.ptic.hasNextLink() && result.ptic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListProcessThreadsPreparer prepares the ListProcessThreads request. +func (client AppsClient) ListProcessThreadsPreparer(ctx context.Context, resourceGroupName string, name string, processID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/processes/{processId}/threads", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProcessThreadsSender sends the ListProcessThreads request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListProcessThreadsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProcessThreadsResponder handles the response to the ListProcessThreads request. The method always +// closes the http.Response Body. +func (client AppsClient) ListProcessThreadsResponder(resp *http.Response) (result ProcessThreadInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listProcessThreadsNextResults retrieves the next set of results, if any. +func (client AppsClient) listProcessThreadsNextResults(ctx context.Context, lastResults ProcessThreadInfoCollection) (result ProcessThreadInfoCollection, err error) { + req, err := lastResults.processThreadInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessThreadsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListProcessThreadsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessThreadsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListProcessThreadsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listProcessThreadsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListProcessThreadsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListProcessThreadsComplete(ctx context.Context, resourceGroupName string, name string, processID string) (result ProcessThreadInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessThreads") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListProcessThreads(ctx, resourceGroupName, name, processID) + return +} + +// ListProcessThreadsSlot description for List the threads in a process by its ID for a specific scaled-out instance in +// a web site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// processID - pID. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessThreadInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessThreadsSlot") + defer func() { + sc := -1 + if result.ptic.Response.Response != nil { + sc = result.ptic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListProcessThreadsSlot", err.Error()) + } + + result.fn = client.listProcessThreadsSlotNextResults + req, err := client.ListProcessThreadsSlotPreparer(ctx, resourceGroupName, name, processID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessThreadsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListProcessThreadsSlotSender(req) + if err != nil { + result.ptic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessThreadsSlot", resp, "Failure sending request") + return + } + + result.ptic, err = client.ListProcessThreadsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListProcessThreadsSlot", resp, "Failure responding to request") + return + } + if result.ptic.hasNextLink() && result.ptic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListProcessThreadsSlotPreparer prepares the ListProcessThreadsSlot request. +func (client AppsClient) ListProcessThreadsSlotPreparer(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "processId": autorest.Encode("path", processID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/processes/{processId}/threads", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListProcessThreadsSlotSender sends the ListProcessThreadsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListProcessThreadsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListProcessThreadsSlotResponder handles the response to the ListProcessThreadsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListProcessThreadsSlotResponder(resp *http.Response) (result ProcessThreadInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listProcessThreadsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listProcessThreadsSlotNextResults(ctx context.Context, lastResults ProcessThreadInfoCollection) (result ProcessThreadInfoCollection, err error) { + req, err := lastResults.processThreadInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessThreadsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListProcessThreadsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listProcessThreadsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListProcessThreadsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listProcessThreadsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListProcessThreadsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListProcessThreadsSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result ProcessThreadInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListProcessThreadsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListProcessThreadsSlot(ctx, resourceGroupName, name, processID, slot) + return +} + +// ListPublicCertificates description for Get public certificates for an app or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListPublicCertificates(ctx context.Context, resourceGroupName string, name string) (result PublicCertificateCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublicCertificates") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPublicCertificates", err.Error()) + } + + result.fn = client.listPublicCertificatesNextResults + req, err := client.ListPublicCertificatesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublicCertificates", nil, "Failure preparing request") + return + } + + resp, err := client.ListPublicCertificatesSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublicCertificates", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListPublicCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublicCertificates", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPublicCertificatesPreparer prepares the ListPublicCertificates request. +func (client AppsClient) ListPublicCertificatesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publicCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublicCertificatesSender sends the ListPublicCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPublicCertificatesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPublicCertificatesResponder handles the response to the ListPublicCertificates request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPublicCertificatesResponder(resp *http.Response) (result PublicCertificateCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPublicCertificatesNextResults retrieves the next set of results, if any. +func (client AppsClient) listPublicCertificatesNextResults(ctx context.Context, lastResults PublicCertificateCollection) (result PublicCertificateCollection, err error) { + req, err := lastResults.publicCertificateCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPublicCertificatesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPublicCertificatesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPublicCertificatesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPublicCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listPublicCertificatesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPublicCertificatesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListPublicCertificatesComplete(ctx context.Context, resourceGroupName string, name string) (result PublicCertificateCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublicCertificates") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPublicCertificates(ctx, resourceGroupName, name) + return +} + +// ListPublicCertificatesSlot description for Get public certificates for an app or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API gets hostname bindings for the +// production slot. +func (client AppsClient) ListPublicCertificatesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PublicCertificateCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublicCertificatesSlot") + defer func() { + sc := -1 + if result.pcc.Response.Response != nil { + sc = result.pcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPublicCertificatesSlot", err.Error()) + } + + result.fn = client.listPublicCertificatesSlotNextResults + req, err := client.ListPublicCertificatesSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublicCertificatesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListPublicCertificatesSlotSender(req) + if err != nil { + result.pcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublicCertificatesSlot", resp, "Failure sending request") + return + } + + result.pcc, err = client.ListPublicCertificatesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublicCertificatesSlot", resp, "Failure responding to request") + return + } + if result.pcc.hasNextLink() && result.pcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPublicCertificatesSlotPreparer prepares the ListPublicCertificatesSlot request. +func (client AppsClient) ListPublicCertificatesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publicCertificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublicCertificatesSlotSender sends the ListPublicCertificatesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPublicCertificatesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPublicCertificatesSlotResponder handles the response to the ListPublicCertificatesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPublicCertificatesSlotResponder(resp *http.Response) (result PublicCertificateCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPublicCertificatesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listPublicCertificatesSlotNextResults(ctx context.Context, lastResults PublicCertificateCollection) (result PublicCertificateCollection, err error) { + req, err := lastResults.publicCertificateCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPublicCertificatesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPublicCertificatesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listPublicCertificatesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPublicCertificatesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listPublicCertificatesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPublicCertificatesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListPublicCertificatesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result PublicCertificateCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublicCertificatesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPublicCertificatesSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListPublishingCredentials description for Gets the Git/FTP publishing credentials of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListPublishingCredentials(ctx context.Context, resourceGroupName string, name string) (result AppsListPublishingCredentialsFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublishingCredentials") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPublishingCredentials", err.Error()) + } + + req, err := client.ListPublishingCredentialsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingCredentials", nil, "Failure preparing request") + return + } + + result, err = client.ListPublishingCredentialsSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingCredentials", result.Response(), "Failure sending request") + return + } + + return +} + +// ListPublishingCredentialsPreparer prepares the ListPublishingCredentials request. +func (client AppsClient) ListPublishingCredentialsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/publishingcredentials/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublishingCredentialsSender sends the ListPublishingCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPublishingCredentialsSender(req *http.Request) (future AppsListPublishingCredentialsFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ListPublishingCredentialsResponder handles the response to the ListPublishingCredentials request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPublishingCredentialsResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPublishingCredentialsSlot description for Gets the Git/FTP publishing credentials of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get the publishing credentials +// for the production slot. +func (client AppsClient) ListPublishingCredentialsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result AppsListPublishingCredentialsSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublishingCredentialsSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPublishingCredentialsSlot", err.Error()) + } + + req, err := client.ListPublishingCredentialsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingCredentialsSlot", nil, "Failure preparing request") + return + } + + result, err = client.ListPublishingCredentialsSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingCredentialsSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// ListPublishingCredentialsSlotPreparer prepares the ListPublishingCredentialsSlot request. +func (client AppsClient) ListPublishingCredentialsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/publishingcredentials/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublishingCredentialsSlotSender sends the ListPublishingCredentialsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPublishingCredentialsSlotSender(req *http.Request) (future AppsListPublishingCredentialsSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ListPublishingCredentialsSlotResponder handles the response to the ListPublishingCredentialsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPublishingCredentialsSlotResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPublishingProfileXMLWithSecrets description for Gets the publishing profile for an app (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// publishingProfileOptions - specifies publishingProfileOptions for publishing profile. For example, use +// {"format": "FileZilla3"} to get a FileZilla publishing profile. +func (client AppsClient) ListPublishingProfileXMLWithSecrets(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublishingProfileXMLWithSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPublishingProfileXMLWithSecrets", err.Error()) + } + + req, err := client.ListPublishingProfileXMLWithSecretsPreparer(ctx, resourceGroupName, name, publishingProfileOptions) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListPublishingProfileXMLWithSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListPublishingProfileXMLWithSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecrets", resp, "Failure responding to request") + return + } + + return +} + +// ListPublishingProfileXMLWithSecretsPreparer prepares the ListPublishingProfileXMLWithSecrets request. +func (client AppsClient) ListPublishingProfileXMLWithSecretsPreparer(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/publishxml", pathParameters), + autorest.WithJSON(publishingProfileOptions), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublishingProfileXMLWithSecretsSender sends the ListPublishingProfileXMLWithSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPublishingProfileXMLWithSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPublishingProfileXMLWithSecretsResponder handles the response to the ListPublishingProfileXMLWithSecrets request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPublishingProfileXMLWithSecretsResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPublishingProfileXMLWithSecretsSlot description for Gets the publishing profile for an app (or deployment slot, +// if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// publishingProfileOptions - specifies publishingProfileOptions for publishing profile. For example, use +// {"format": "FileZilla3"} to get a FileZilla publishing profile. +// slot - name of the deployment slot. If a slot is not specified, the API will get the publishing profile for +// the production slot. +func (client AppsClient) ListPublishingProfileXMLWithSecretsSlot(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions, slot string) (result ReadCloser, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListPublishingProfileXMLWithSecretsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListPublishingProfileXMLWithSecretsSlot", err.Error()) + } + + req, err := client.ListPublishingProfileXMLWithSecretsSlotPreparer(ctx, resourceGroupName, name, publishingProfileOptions, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecretsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListPublishingProfileXMLWithSecretsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecretsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListPublishingProfileXMLWithSecretsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListPublishingProfileXMLWithSecretsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListPublishingProfileXMLWithSecretsSlotPreparer prepares the ListPublishingProfileXMLWithSecretsSlot request. +func (client AppsClient) ListPublishingProfileXMLWithSecretsSlotPreparer(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions CsmPublishingProfileOptions, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/publishxml", pathParameters), + autorest.WithJSON(publishingProfileOptions), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPublishingProfileXMLWithSecretsSlotSender sends the ListPublishingProfileXMLWithSecretsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListPublishingProfileXMLWithSecretsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPublishingProfileXMLWithSecretsSlotResponder handles the response to the ListPublishingProfileXMLWithSecretsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListPublishingProfileXMLWithSecretsSlotResponder(resp *http.Response) (result ReadCloser, err error) { + result.Value = &resp.Body + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK)) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRelayServiceConnections description for Gets hybrid connections configured for an app (or deployment slot, if +// specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListRelayServiceConnections(ctx context.Context, resourceGroupName string, name string) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListRelayServiceConnections") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListRelayServiceConnections", err.Error()) + } + + req, err := client.ListRelayServiceConnectionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListRelayServiceConnections", nil, "Failure preparing request") + return + } + + resp, err := client.ListRelayServiceConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListRelayServiceConnections", resp, "Failure sending request") + return + } + + result, err = client.ListRelayServiceConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListRelayServiceConnections", resp, "Failure responding to request") + return + } + + return +} + +// ListRelayServiceConnectionsPreparer prepares the ListRelayServiceConnections request. +func (client AppsClient) ListRelayServiceConnectionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRelayServiceConnectionsSender sends the ListRelayServiceConnections request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListRelayServiceConnectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRelayServiceConnectionsResponder handles the response to the ListRelayServiceConnections request. The method always +// closes the http.Response Body. +func (client AppsClient) ListRelayServiceConnectionsResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRelayServiceConnectionsSlot description for Gets hybrid connections configured for an app (or deployment slot, +// if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get hybrid connections for the +// production slot. +func (client AppsClient) ListRelayServiceConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListRelayServiceConnectionsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListRelayServiceConnectionsSlot", err.Error()) + } + + req, err := client.ListRelayServiceConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListRelayServiceConnectionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListRelayServiceConnectionsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListRelayServiceConnectionsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListRelayServiceConnectionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListRelayServiceConnectionsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListRelayServiceConnectionsSlotPreparer prepares the ListRelayServiceConnectionsSlot request. +func (client AppsClient) ListRelayServiceConnectionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRelayServiceConnectionsSlotSender sends the ListRelayServiceConnectionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListRelayServiceConnectionsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRelayServiceConnectionsSlotResponder handles the response to the ListRelayServiceConnectionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListRelayServiceConnectionsSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSiteBackups description for Gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSiteBackups(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackups") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSiteBackups", err.Error()) + } + + result.fn = client.listSiteBackupsNextResults + req, err := client.ListSiteBackupsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackups", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteBackupsSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackups", resp, "Failure sending request") + return + } + + result.bic, err = client.ListSiteBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackups", resp, "Failure responding to request") + return + } + if result.bic.hasNextLink() && result.bic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteBackupsPreparer prepares the ListSiteBackups request. +func (client AppsClient) ListSiteBackupsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listbackups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteBackupsSender sends the ListSiteBackups request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSiteBackupsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteBackupsResponder handles the response to the ListSiteBackups request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSiteBackupsResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteBackupsNextResults retrieves the next set of results, if any. +func (client AppsClient) listSiteBackupsNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteBackupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteBackupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteBackupsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSiteBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackups") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteBackups(ctx, resourceGroupName, name) + return +} + +// ListSiteBackupsSlot description for Gets existing backups of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get backups of the production +// slot. +func (client AppsClient) ListSiteBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackupsSlot") + defer func() { + sc := -1 + if result.bic.Response.Response != nil { + sc = result.bic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSiteBackupsSlot", err.Error()) + } + + result.fn = client.listSiteBackupsSlotNextResults + req, err := client.ListSiteBackupsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackupsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteBackupsSlotSender(req) + if err != nil { + result.bic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackupsSlot", resp, "Failure sending request") + return + } + + result.bic, err = client.ListSiteBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteBackupsSlot", resp, "Failure responding to request") + return + } + if result.bic.hasNextLink() && result.bic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteBackupsSlotPreparer prepares the ListSiteBackupsSlot request. +func (client AppsClient) ListSiteBackupsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listbackups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteBackupsSlotSender sends the ListSiteBackupsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSiteBackupsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteBackupsSlotResponder handles the response to the ListSiteBackupsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSiteBackupsSlotResponder(resp *http.Response) (result BackupItemCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteBackupsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSiteBackupsSlotNextResults(ctx context.Context, lastResults BackupItemCollection) (result BackupItemCollection, err error) { + req, err := lastResults.backupItemCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteBackupsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteBackupsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSiteBackupsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteBackupsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSiteBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result BackupItemCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteBackupsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteBackupsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListSiteExtensions description for Get list of siteextensions for a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListSiteExtensions(ctx context.Context, resourceGroupName string, name string) (result SiteExtensionInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteExtensions") + defer func() { + sc := -1 + if result.seic.Response.Response != nil { + sc = result.seic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSiteExtensions", err.Error()) + } + + result.fn = client.listSiteExtensionsNextResults + req, err := client.ListSiteExtensionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteExtensions", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteExtensionsSender(req) + if err != nil { + result.seic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteExtensions", resp, "Failure sending request") + return + } + + result.seic, err = client.ListSiteExtensionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteExtensions", resp, "Failure responding to request") + return + } + if result.seic.hasNextLink() && result.seic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteExtensionsPreparer prepares the ListSiteExtensions request. +func (client AppsClient) ListSiteExtensionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/siteextensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteExtensionsSender sends the ListSiteExtensions request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSiteExtensionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteExtensionsResponder handles the response to the ListSiteExtensions request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSiteExtensionsResponder(resp *http.Response) (result SiteExtensionInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteExtensionsNextResults retrieves the next set of results, if any. +func (client AppsClient) listSiteExtensionsNextResults(ctx context.Context, lastResults SiteExtensionInfoCollection) (result SiteExtensionInfoCollection, err error) { + req, err := lastResults.siteExtensionInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteExtensionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteExtensionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteExtensionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteExtensionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSiteExtensionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteExtensionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSiteExtensionsComplete(ctx context.Context, resourceGroupName string, name string) (result SiteExtensionInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteExtensions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteExtensions(ctx, resourceGroupName, name) + return +} + +// ListSiteExtensionsSlot description for Get list of siteextensions for a web site, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) ListSiteExtensionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteExtensionInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteExtensionsSlot") + defer func() { + sc := -1 + if result.seic.Response.Response != nil { + sc = result.seic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSiteExtensionsSlot", err.Error()) + } + + result.fn = client.listSiteExtensionsSlotNextResults + req, err := client.ListSiteExtensionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteExtensionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteExtensionsSlotSender(req) + if err != nil { + result.seic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteExtensionsSlot", resp, "Failure sending request") + return + } + + result.seic, err = client.ListSiteExtensionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSiteExtensionsSlot", resp, "Failure responding to request") + return + } + if result.seic.hasNextLink() && result.seic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteExtensionsSlotPreparer prepares the ListSiteExtensionsSlot request. +func (client AppsClient) ListSiteExtensionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/siteextensions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteExtensionsSlotSender sends the ListSiteExtensionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSiteExtensionsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteExtensionsSlotResponder handles the response to the ListSiteExtensionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSiteExtensionsSlotResponder(resp *http.Response) (result SiteExtensionInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteExtensionsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSiteExtensionsSlotNextResults(ctx context.Context, lastResults SiteExtensionInfoCollection) (result SiteExtensionInfoCollection, err error) { + req, err := lastResults.siteExtensionInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteExtensionsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteExtensionsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSiteExtensionsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteExtensionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSiteExtensionsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteExtensionsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSiteExtensionsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SiteExtensionInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSiteExtensionsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteExtensionsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListSitePushSettings description for Gets the Push settings associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) ListSitePushSettings(ctx context.Context, resourceGroupName string, name string) (result PushSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSitePushSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSitePushSettings", err.Error()) + } + + req, err := client.ListSitePushSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSitePushSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListSitePushSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSitePushSettings", resp, "Failure sending request") + return + } + + result, err = client.ListSitePushSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSitePushSettings", resp, "Failure responding to request") + return + } + + return +} + +// ListSitePushSettingsPreparer prepares the ListSitePushSettings request. +func (client AppsClient) ListSitePushSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSitePushSettingsSender sends the ListSitePushSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSitePushSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSitePushSettingsResponder handles the response to the ListSitePushSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSitePushSettingsResponder(resp *http.Response) (result PushSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSitePushSettingsSlot description for Gets the Push settings associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) ListSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result PushSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSitePushSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSitePushSettingsSlot", err.Error()) + } + + req, err := client.ListSitePushSettingsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSitePushSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSitePushSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSitePushSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListSitePushSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSitePushSettingsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListSitePushSettingsSlotPreparer prepares the ListSitePushSettingsSlot request. +func (client AppsClient) ListSitePushSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings/list", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSitePushSettingsSlotSender sends the ListSitePushSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSitePushSettingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSitePushSettingsSlotResponder handles the response to the ListSitePushSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSitePushSettingsSlotResponder(resp *http.Response) (result PushSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSlotConfigurationNames description for Gets the names of app settings and connection strings that stick to the +// slot (not swapped). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSlotConfigurationNames(ctx context.Context, resourceGroupName string, name string) (result SlotConfigNamesResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlotConfigurationNames") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSlotConfigurationNames", err.Error()) + } + + req, err := client.ListSlotConfigurationNamesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotConfigurationNames", nil, "Failure preparing request") + return + } + + resp, err := client.ListSlotConfigurationNamesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotConfigurationNames", resp, "Failure sending request") + return + } + + result, err = client.ListSlotConfigurationNamesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotConfigurationNames", resp, "Failure responding to request") + return + } + + return +} + +// ListSlotConfigurationNamesPreparer prepares the ListSlotConfigurationNames request. +func (client AppsClient) ListSlotConfigurationNamesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSlotConfigurationNamesSender sends the ListSlotConfigurationNames request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSlotConfigurationNamesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSlotConfigurationNamesResponder handles the response to the ListSlotConfigurationNames request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSlotConfigurationNamesResponder(resp *http.Response) (result SlotConfigNamesResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSlotDifferencesFromProduction description for Get the difference in configuration settings between two web app +// slots. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotSwapEntity - JSON object that contains the target slot name. See example. +func (client AppsClient) ListSlotDifferencesFromProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result SlotDifferenceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlotDifferencesFromProduction") + defer func() { + sc := -1 + if result.sdc.Response.Response != nil { + sc = result.sdc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: slotSwapEntity, + Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSlotDifferencesFromProduction", err.Error()) + } + + result.fn = client.listSlotDifferencesFromProductionNextResults + req, err := client.ListSlotDifferencesFromProductionPreparer(ctx, resourceGroupName, name, slotSwapEntity) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotDifferencesFromProduction", nil, "Failure preparing request") + return + } + + resp, err := client.ListSlotDifferencesFromProductionSender(req) + if err != nil { + result.sdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotDifferencesFromProduction", resp, "Failure sending request") + return + } + + result.sdc, err = client.ListSlotDifferencesFromProductionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotDifferencesFromProduction", resp, "Failure responding to request") + return + } + if result.sdc.hasNextLink() && result.sdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSlotDifferencesFromProductionPreparer prepares the ListSlotDifferencesFromProduction request. +func (client AppsClient) ListSlotDifferencesFromProductionPreparer(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsdiffs", pathParameters), + autorest.WithJSON(slotSwapEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSlotDifferencesFromProductionSender sends the ListSlotDifferencesFromProduction request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSlotDifferencesFromProductionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSlotDifferencesFromProductionResponder handles the response to the ListSlotDifferencesFromProduction request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSlotDifferencesFromProductionResponder(resp *http.Response) (result SlotDifferenceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSlotDifferencesFromProductionNextResults retrieves the next set of results, if any. +func (client AppsClient) listSlotDifferencesFromProductionNextResults(ctx context.Context, lastResults SlotDifferenceCollection) (result SlotDifferenceCollection, err error) { + req, err := lastResults.slotDifferenceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSlotDifferencesFromProductionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSlotDifferencesFromProductionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSlotDifferencesFromProductionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSlotDifferencesFromProductionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSlotDifferencesFromProductionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSlotDifferencesFromProductionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSlotDifferencesFromProductionComplete(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result SlotDifferenceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlotDifferencesFromProduction") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSlotDifferencesFromProduction(ctx, resourceGroupName, name, slotSwapEntity) + return +} + +// ListSlotDifferencesSlot description for Get the difference in configuration settings between two web app slots. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotSwapEntity - JSON object that contains the target slot name. See example. +// slot - name of the source slot. If a slot is not specified, the production slot is used as the source slot. +func (client AppsClient) ListSlotDifferencesSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result SlotDifferenceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlotDifferencesSlot") + defer func() { + sc := -1 + if result.sdc.Response.Response != nil { + sc = result.sdc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: slotSwapEntity, + Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSlotDifferencesSlot", err.Error()) + } + + result.fn = client.listSlotDifferencesSlotNextResults + req, err := client.ListSlotDifferencesSlotPreparer(ctx, resourceGroupName, name, slotSwapEntity, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotDifferencesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSlotDifferencesSlotSender(req) + if err != nil { + result.sdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotDifferencesSlot", resp, "Failure sending request") + return + } + + result.sdc, err = client.ListSlotDifferencesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlotDifferencesSlot", resp, "Failure responding to request") + return + } + if result.sdc.hasNextLink() && result.sdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSlotDifferencesSlotPreparer prepares the ListSlotDifferencesSlot request. +func (client AppsClient) ListSlotDifferencesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsdiffs", pathParameters), + autorest.WithJSON(slotSwapEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSlotDifferencesSlotSender sends the ListSlotDifferencesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSlotDifferencesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSlotDifferencesSlotResponder handles the response to the ListSlotDifferencesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSlotDifferencesSlotResponder(resp *http.Response) (result SlotDifferenceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSlotDifferencesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSlotDifferencesSlotNextResults(ctx context.Context, lastResults SlotDifferenceCollection) (result SlotDifferenceCollection, err error) { + req, err := lastResults.slotDifferenceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSlotDifferencesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSlotDifferencesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSlotDifferencesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSlotDifferencesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSlotDifferencesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSlotDifferencesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSlotDifferencesSlotComplete(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result SlotDifferenceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlotDifferencesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSlotDifferencesSlot(ctx, resourceGroupName, name, slotSwapEntity, slot) + return +} + +// ListSlots description for Gets an app's deployment slots. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSlots(ctx context.Context, resourceGroupName string, name string) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlots") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSlots", err.Error()) + } + + result.fn = client.listSlotsNextResults + req, err := client.ListSlotsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlots", nil, "Failure preparing request") + return + } + + resp, err := client.ListSlotsSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlots", resp, "Failure sending request") + return + } + + result.ac, err = client.ListSlotsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSlots", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSlotsPreparer prepares the ListSlots request. +func (client AppsClient) ListSlotsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSlotsSender sends the ListSlots request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSlotsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSlotsResponder handles the response to the ListSlots request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSlotsResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSlotsNextResults retrieves the next set of results, if any. +func (client AppsClient) listSlotsNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSlotsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSlotsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSlotsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSlotsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSlotsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSlotsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSlotsComplete(ctx context.Context, resourceGroupName string, name string) (result AppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSlots") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSlots(ctx, resourceGroupName, name) + return +} + +// ListSnapshots description for Returns all Snapshots to the user. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - website Name. +func (client AppsClient) ListSnapshots(ctx context.Context, resourceGroupName string, name string) (result SnapshotCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshots") + defer func() { + sc := -1 + if result.sc.Response.Response != nil { + sc = result.sc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSnapshots", err.Error()) + } + + result.fn = client.listSnapshotsNextResults + req, err := client.ListSnapshotsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshots", nil, "Failure preparing request") + return + } + + resp, err := client.ListSnapshotsSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshots", resp, "Failure sending request") + return + } + + result.sc, err = client.ListSnapshotsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshots", resp, "Failure responding to request") + return + } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSnapshotsPreparer prepares the ListSnapshots request. +func (client AppsClient) ListSnapshotsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSnapshotsSender sends the ListSnapshots request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSnapshotsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSnapshotsResponder handles the response to the ListSnapshots request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSnapshotsResponder(resp *http.Response) (result SnapshotCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSnapshotsNextResults retrieves the next set of results, if any. +func (client AppsClient) listSnapshotsNextResults(ctx context.Context, lastResults SnapshotCollection) (result SnapshotCollection, err error) { + req, err := lastResults.snapshotCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSnapshotsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSnapshotsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSnapshotsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSnapshotsComplete(ctx context.Context, resourceGroupName string, name string) (result SnapshotCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshots") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSnapshots(ctx, resourceGroupName, name) + return +} + +// ListSnapshotsFromDRSecondary description for Returns all Snapshots to the user from DRSecondary endpoint. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - website Name. +func (client AppsClient) ListSnapshotsFromDRSecondary(ctx context.Context, resourceGroupName string, name string) (result SnapshotCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsFromDRSecondary") + defer func() { + sc := -1 + if result.sc.Response.Response != nil { + sc = result.sc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSnapshotsFromDRSecondary", err.Error()) + } + + result.fn = client.listSnapshotsFromDRSecondaryNextResults + req, err := client.ListSnapshotsFromDRSecondaryPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsFromDRSecondary", nil, "Failure preparing request") + return + } + + resp, err := client.ListSnapshotsFromDRSecondarySender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsFromDRSecondary", resp, "Failure sending request") + return + } + + result.sc, err = client.ListSnapshotsFromDRSecondaryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsFromDRSecondary", resp, "Failure responding to request") + return + } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSnapshotsFromDRSecondaryPreparer prepares the ListSnapshotsFromDRSecondary request. +func (client AppsClient) ListSnapshotsFromDRSecondaryPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/snapshotsdr", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSnapshotsFromDRSecondarySender sends the ListSnapshotsFromDRSecondary request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSnapshotsFromDRSecondarySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSnapshotsFromDRSecondaryResponder handles the response to the ListSnapshotsFromDRSecondary request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSnapshotsFromDRSecondaryResponder(resp *http.Response) (result SnapshotCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSnapshotsFromDRSecondaryNextResults retrieves the next set of results, if any. +func (client AppsClient) listSnapshotsFromDRSecondaryNextResults(ctx context.Context, lastResults SnapshotCollection) (result SnapshotCollection, err error) { + req, err := lastResults.snapshotCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsFromDRSecondaryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSnapshotsFromDRSecondarySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsFromDRSecondaryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSnapshotsFromDRSecondaryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsFromDRSecondaryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSnapshotsFromDRSecondaryComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSnapshotsFromDRSecondaryComplete(ctx context.Context, resourceGroupName string, name string) (result SnapshotCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsFromDRSecondary") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSnapshotsFromDRSecondary(ctx, resourceGroupName, name) + return +} + +// ListSnapshotsFromDRSecondarySlot description for Returns all Snapshots to the user from DRSecondary endpoint. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - website Name. +// slot - website Slot. +func (client AppsClient) ListSnapshotsFromDRSecondarySlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsFromDRSecondarySlot") + defer func() { + sc := -1 + if result.sc.Response.Response != nil { + sc = result.sc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSnapshotsFromDRSecondarySlot", err.Error()) + } + + result.fn = client.listSnapshotsFromDRSecondarySlotNextResults + req, err := client.ListSnapshotsFromDRSecondarySlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsFromDRSecondarySlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSnapshotsFromDRSecondarySlotSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsFromDRSecondarySlot", resp, "Failure sending request") + return + } + + result.sc, err = client.ListSnapshotsFromDRSecondarySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsFromDRSecondarySlot", resp, "Failure responding to request") + return + } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSnapshotsFromDRSecondarySlotPreparer prepares the ListSnapshotsFromDRSecondarySlot request. +func (client AppsClient) ListSnapshotsFromDRSecondarySlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshotsdr", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSnapshotsFromDRSecondarySlotSender sends the ListSnapshotsFromDRSecondarySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSnapshotsFromDRSecondarySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSnapshotsFromDRSecondarySlotResponder handles the response to the ListSnapshotsFromDRSecondarySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSnapshotsFromDRSecondarySlotResponder(resp *http.Response) (result SnapshotCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSnapshotsFromDRSecondarySlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSnapshotsFromDRSecondarySlotNextResults(ctx context.Context, lastResults SnapshotCollection) (result SnapshotCollection, err error) { + req, err := lastResults.snapshotCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsFromDRSecondarySlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSnapshotsFromDRSecondarySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsFromDRSecondarySlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSnapshotsFromDRSecondarySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsFromDRSecondarySlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSnapshotsFromDRSecondarySlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSnapshotsFromDRSecondarySlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsFromDRSecondarySlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSnapshotsFromDRSecondarySlot(ctx, resourceGroupName, name, slot) + return +} + +// ListSnapshotsSlot description for Returns all Snapshots to the user. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - website Name. +// slot - website Slot. +func (client AppsClient) ListSnapshotsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsSlot") + defer func() { + sc := -1 + if result.sc.Response.Response != nil { + sc = result.sc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSnapshotsSlot", err.Error()) + } + + result.fn = client.listSnapshotsSlotNextResults + req, err := client.ListSnapshotsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSnapshotsSlotSender(req) + if err != nil { + result.sc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsSlot", resp, "Failure sending request") + return + } + + result.sc, err = client.ListSnapshotsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSnapshotsSlot", resp, "Failure responding to request") + return + } + if result.sc.hasNextLink() && result.sc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSnapshotsSlotPreparer prepares the ListSnapshotsSlot request. +func (client AppsClient) ListSnapshotsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSnapshotsSlotSender sends the ListSnapshotsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSnapshotsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSnapshotsSlotResponder handles the response to the ListSnapshotsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSnapshotsSlotResponder(resp *http.Response) (result SnapshotCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSnapshotsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listSnapshotsSlotNextResults(ctx context.Context, lastResults SnapshotCollection) (result SnapshotCollection, err error) { + req, err := lastResults.snapshotCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSnapshotsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSnapshotsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listSnapshotsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSnapshotsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListSnapshotsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result SnapshotCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSnapshotsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSnapshotsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListSyncFunctionTriggers description for This is to allow calling via powershell and ARM template. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result FunctionSecrets, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggers") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggers", err.Error()) + } + + req, err := client.ListSyncFunctionTriggersPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", nil, "Failure preparing request") + return + } + + resp, err := client.ListSyncFunctionTriggersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", resp, "Failure sending request") + return + } + + result, err = client.ListSyncFunctionTriggersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggers", resp, "Failure responding to request") + return + } + + return +} + +// ListSyncFunctionTriggersPreparer prepares the ListSyncFunctionTriggers request. +func (client AppsClient) ListSyncFunctionTriggersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/listsyncfunctiontriggerstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSyncFunctionTriggersSender sends the ListSyncFunctionTriggers request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSyncFunctionTriggersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSyncFunctionTriggersResponder handles the response to the ListSyncFunctionTriggers request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSyncFunctionTriggersResponder(resp *http.Response) (result FunctionSecrets, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSyncFunctionTriggersSlot description for This is to allow calling via powershell and ARM template. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. +func (client AppsClient) ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result FunctionSecrets, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncFunctionTriggersSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSyncFunctionTriggersSlot", err.Error()) + } + + req, err := client.ListSyncFunctionTriggersSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSyncFunctionTriggersSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", resp, "Failure sending request") + return + } + + result, err = client.ListSyncFunctionTriggersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncFunctionTriggersSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListSyncFunctionTriggersSlotPreparer prepares the ListSyncFunctionTriggersSlot request. +func (client AppsClient) ListSyncFunctionTriggersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/listsyncfunctiontriggerstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSyncFunctionTriggersSlotSender sends the ListSyncFunctionTriggersSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSyncFunctionTriggersSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSyncFunctionTriggersSlotResponder handles the response to the ListSyncFunctionTriggersSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSyncFunctionTriggersSlotResponder(resp *http.Response) (result FunctionSecrets, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSyncStatus description for This is to allow calling via powershell and ARM template. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListSyncStatus(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncStatus") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSyncStatus", err.Error()) + } + + req, err := client.ListSyncStatusPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSyncStatusSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatus", resp, "Failure sending request") + return + } + + result, err = client.ListSyncStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatus", resp, "Failure responding to request") + return + } + + return +} + +// ListSyncStatusPreparer prepares the ListSyncStatus request. +func (client AppsClient) ListSyncStatusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/listsyncstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSyncStatusSender sends the ListSyncStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSyncStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSyncStatusResponder handles the response to the ListSyncStatus request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSyncStatusResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListSyncStatusSlot description for This is to allow calling via powershell and ARM template. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. +func (client AppsClient) ListSyncStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListSyncStatusSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListSyncStatusSlot", err.Error()) + } + + req, err := client.ListSyncStatusSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatusSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSyncStatusSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatusSlot", resp, "Failure sending request") + return + } + + result, err = client.ListSyncStatusSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListSyncStatusSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListSyncStatusSlotPreparer prepares the ListSyncStatusSlot request. +func (client AppsClient) ListSyncStatusSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/listsyncstatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSyncStatusSlotSender sends the ListSyncStatusSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListSyncStatusSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSyncStatusSlotResponder handles the response to the ListSyncStatusSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListSyncStatusSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListTriggeredWebJobHistory description for List a triggered web job's history for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) ListTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredJobHistoryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobHistory") + defer func() { + sc := -1 + if result.tjhc.Response.Response != nil { + sc = result.tjhc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobHistory", err.Error()) + } + + result.fn = client.listTriggeredWebJobHistoryNextResults + req, err := client.ListTriggeredWebJobHistoryPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobHistory", nil, "Failure preparing request") + return + } + + resp, err := client.ListTriggeredWebJobHistorySender(req) + if err != nil { + result.tjhc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobHistory", resp, "Failure sending request") + return + } + + result.tjhc, err = client.ListTriggeredWebJobHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobHistory", resp, "Failure responding to request") + return + } + if result.tjhc.hasNextLink() && result.tjhc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListTriggeredWebJobHistoryPreparer prepares the ListTriggeredWebJobHistory request. +func (client AppsClient) ListTriggeredWebJobHistoryPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/history", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTriggeredWebJobHistorySender sends the ListTriggeredWebJobHistory request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListTriggeredWebJobHistorySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTriggeredWebJobHistoryResponder handles the response to the ListTriggeredWebJobHistory request. The method always +// closes the http.Response Body. +func (client AppsClient) ListTriggeredWebJobHistoryResponder(resp *http.Response) (result TriggeredJobHistoryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listTriggeredWebJobHistoryNextResults retrieves the next set of results, if any. +func (client AppsClient) listTriggeredWebJobHistoryNextResults(ctx context.Context, lastResults TriggeredJobHistoryCollection) (result TriggeredJobHistoryCollection, err error) { + req, err := lastResults.triggeredJobHistoryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobHistoryNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListTriggeredWebJobHistorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobHistoryNextResults", resp, "Failure sending next results request") + } + result, err = client.ListTriggeredWebJobHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobHistoryNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListTriggeredWebJobHistoryComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListTriggeredWebJobHistoryComplete(ctx context.Context, resourceGroupName string, name string, webJobName string) (result TriggeredJobHistoryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobHistory") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListTriggeredWebJobHistory(ctx, resourceGroupName, name, webJobName) + return +} + +// ListTriggeredWebJobHistorySlot description for List a triggered web job's history for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) ListTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredJobHistoryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobHistorySlot") + defer func() { + sc := -1 + if result.tjhc.Response.Response != nil { + sc = result.tjhc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobHistorySlot", err.Error()) + } + + result.fn = client.listTriggeredWebJobHistorySlotNextResults + req, err := client.ListTriggeredWebJobHistorySlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobHistorySlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListTriggeredWebJobHistorySlotSender(req) + if err != nil { + result.tjhc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobHistorySlot", resp, "Failure sending request") + return + } + + result.tjhc, err = client.ListTriggeredWebJobHistorySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobHistorySlot", resp, "Failure responding to request") + return + } + if result.tjhc.hasNextLink() && result.tjhc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListTriggeredWebJobHistorySlotPreparer prepares the ListTriggeredWebJobHistorySlot request. +func (client AppsClient) ListTriggeredWebJobHistorySlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/history", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTriggeredWebJobHistorySlotSender sends the ListTriggeredWebJobHistorySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListTriggeredWebJobHistorySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTriggeredWebJobHistorySlotResponder handles the response to the ListTriggeredWebJobHistorySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListTriggeredWebJobHistorySlotResponder(resp *http.Response) (result TriggeredJobHistoryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listTriggeredWebJobHistorySlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listTriggeredWebJobHistorySlotNextResults(ctx context.Context, lastResults TriggeredJobHistoryCollection) (result TriggeredJobHistoryCollection, err error) { + req, err := lastResults.triggeredJobHistoryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobHistorySlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListTriggeredWebJobHistorySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobHistorySlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListTriggeredWebJobHistorySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobHistorySlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListTriggeredWebJobHistorySlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListTriggeredWebJobHistorySlotComplete(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result TriggeredJobHistoryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobHistorySlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListTriggeredWebJobHistorySlot(ctx, resourceGroupName, name, webJobName, slot) + return +} + +// ListTriggeredWebJobs description for List triggered web jobs for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListTriggeredWebJobs(ctx context.Context, resourceGroupName string, name string) (result TriggeredWebJobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobs") + defer func() { + sc := -1 + if result.twjc.Response.Response != nil { + sc = result.twjc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobs", err.Error()) + } + + result.fn = client.listTriggeredWebJobsNextResults + req, err := client.ListTriggeredWebJobsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobs", nil, "Failure preparing request") + return + } + + resp, err := client.ListTriggeredWebJobsSender(req) + if err != nil { + result.twjc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobs", resp, "Failure sending request") + return + } + + result.twjc, err = client.ListTriggeredWebJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobs", resp, "Failure responding to request") + return + } + if result.twjc.hasNextLink() && result.twjc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListTriggeredWebJobsPreparer prepares the ListTriggeredWebJobs request. +func (client AppsClient) ListTriggeredWebJobsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTriggeredWebJobsSender sends the ListTriggeredWebJobs request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListTriggeredWebJobsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTriggeredWebJobsResponder handles the response to the ListTriggeredWebJobs request. The method always +// closes the http.Response Body. +func (client AppsClient) ListTriggeredWebJobsResponder(resp *http.Response) (result TriggeredWebJobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listTriggeredWebJobsNextResults retrieves the next set of results, if any. +func (client AppsClient) listTriggeredWebJobsNextResults(ctx context.Context, lastResults TriggeredWebJobCollection) (result TriggeredWebJobCollection, err error) { + req, err := lastResults.triggeredWebJobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListTriggeredWebJobsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListTriggeredWebJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListTriggeredWebJobsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListTriggeredWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result TriggeredWebJobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobs") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListTriggeredWebJobs(ctx, resourceGroupName, name) + return +} + +// ListTriggeredWebJobsSlot description for List triggered web jobs for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) ListTriggeredWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result TriggeredWebJobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobsSlot") + defer func() { + sc := -1 + if result.twjc.Response.Response != nil { + sc = result.twjc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListTriggeredWebJobsSlot", err.Error()) + } + + result.fn = client.listTriggeredWebJobsSlotNextResults + req, err := client.ListTriggeredWebJobsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListTriggeredWebJobsSlotSender(req) + if err != nil { + result.twjc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobsSlot", resp, "Failure sending request") + return + } + + result.twjc, err = client.ListTriggeredWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListTriggeredWebJobsSlot", resp, "Failure responding to request") + return + } + if result.twjc.hasNextLink() && result.twjc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListTriggeredWebJobsSlotPreparer prepares the ListTriggeredWebJobsSlot request. +func (client AppsClient) ListTriggeredWebJobsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListTriggeredWebJobsSlotSender sends the ListTriggeredWebJobsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListTriggeredWebJobsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListTriggeredWebJobsSlotResponder handles the response to the ListTriggeredWebJobsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListTriggeredWebJobsSlotResponder(resp *http.Response) (result TriggeredWebJobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listTriggeredWebJobsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listTriggeredWebJobsSlotNextResults(ctx context.Context, lastResults TriggeredWebJobCollection) (result TriggeredWebJobCollection, err error) { + req, err := lastResults.triggeredWebJobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListTriggeredWebJobsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListTriggeredWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listTriggeredWebJobsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListTriggeredWebJobsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListTriggeredWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result TriggeredWebJobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListTriggeredWebJobsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListTriggeredWebJobsSlot(ctx, resourceGroupName, name, slot) + return +} + +// ListUsages description for Gets the quota usage information of an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// filter - return only information specified in the filter (using OData syntax). For example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and +// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. +func (client AppsClient) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListUsages") + defer func() { + sc := -1 + if result.cuqc.Response.Response != nil { + sc = result.cuqc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListUsages", err.Error()) + } + + result.fn = client.listUsagesNextResults + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, name, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.cuqc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListUsages", resp, "Failure sending request") + return + } + + result.cuqc, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListUsages", resp, "Failure responding to request") + return + } + if result.cuqc.hasNextLink() && result.cuqc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client AppsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, name string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client AppsClient) ListUsagesResponder(resp *http.Response) (result CsmUsageQuotaCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listUsagesNextResults retrieves the next set of results, if any. +func (client AppsClient) listUsagesNextResults(ctx context.Context, lastResults CsmUsageQuotaCollection) (result CsmUsageQuotaCollection, err error) { + req, err := lastResults.csmUsageQuotaCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listUsagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listUsagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listUsagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListUsagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListUsages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListUsages(ctx, resourceGroupName, name, filter) + return +} + +// ListUsagesSlot description for Gets the quota usage information of an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get quota information of the +// production slot. +// filter - return only information specified in the filter (using OData syntax). For example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and +// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. +func (client AppsClient) ListUsagesSlot(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result CsmUsageQuotaCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListUsagesSlot") + defer func() { + sc := -1 + if result.cuqc.Response.Response != nil { + sc = result.cuqc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListUsagesSlot", err.Error()) + } + + result.fn = client.listUsagesSlotNextResults + req, err := client.ListUsagesSlotPreparer(ctx, resourceGroupName, name, slot, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListUsagesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSlotSender(req) + if err != nil { + result.cuqc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListUsagesSlot", resp, "Failure sending request") + return + } + + result.cuqc, err = client.ListUsagesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListUsagesSlot", resp, "Failure responding to request") + return + } + if result.cuqc.hasNextLink() && result.cuqc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListUsagesSlotPreparer prepares the ListUsagesSlot request. +func (client AppsClient) ListUsagesSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSlotSender sends the ListUsagesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListUsagesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesSlotResponder handles the response to the ListUsagesSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListUsagesSlotResponder(resp *http.Response) (result CsmUsageQuotaCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listUsagesSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listUsagesSlotNextResults(ctx context.Context, lastResults CsmUsageQuotaCollection) (result CsmUsageQuotaCollection, err error) { + req, err := lastResults.csmUsageQuotaCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listUsagesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListUsagesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listUsagesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListUsagesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listUsagesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListUsagesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListUsagesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result CsmUsageQuotaCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListUsagesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListUsagesSlot(ctx, resourceGroupName, name, slot, filter) + return +} + +// ListVnetConnections description for Gets the virtual networks the app (or deployment slot) is connected to. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ListVnetConnections(ctx context.Context, resourceGroupName string, name string) (result ListVnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListVnetConnections") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListVnetConnections", err.Error()) + } + + req, err := client.ListVnetConnectionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListVnetConnections", nil, "Failure preparing request") + return + } + + resp, err := client.ListVnetConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListVnetConnections", resp, "Failure sending request") + return + } + + result, err = client.ListVnetConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListVnetConnections", resp, "Failure responding to request") + return + } + + return +} + +// ListVnetConnectionsPreparer prepares the ListVnetConnections request. +func (client AppsClient) ListVnetConnectionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListVnetConnectionsSender sends the ListVnetConnections request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListVnetConnectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListVnetConnectionsResponder handles the response to the ListVnetConnections request. The method always +// closes the http.Response Body. +func (client AppsClient) ListVnetConnectionsResponder(resp *http.Response) (result ListVnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListVnetConnectionsSlot description for Gets the virtual networks the app (or deployment slot) is connected to. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will get virtual network connections +// for the production slot. +func (client AppsClient) ListVnetConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ListVnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListVnetConnectionsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListVnetConnectionsSlot", err.Error()) + } + + req, err := client.ListVnetConnectionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListVnetConnectionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListVnetConnectionsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListVnetConnectionsSlot", resp, "Failure sending request") + return + } + + result, err = client.ListVnetConnectionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListVnetConnectionsSlot", resp, "Failure responding to request") + return + } + + return +} + +// ListVnetConnectionsSlotPreparer prepares the ListVnetConnectionsSlot request. +func (client AppsClient) ListVnetConnectionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListVnetConnectionsSlotSender sends the ListVnetConnectionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListVnetConnectionsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListVnetConnectionsSlotResponder handles the response to the ListVnetConnectionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListVnetConnectionsSlotResponder(resp *http.Response) (result ListVnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListWebJobs description for List webjobs for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +func (client AppsClient) ListWebJobs(ctx context.Context, resourceGroupName string, name string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListWebJobs") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListWebJobs", err.Error()) + } + + result.fn = client.listWebJobsNextResults + req, err := client.ListWebJobsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListWebJobs", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebJobsSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListWebJobs", resp, "Failure sending request") + return + } + + result.jc, err = client.ListWebJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListWebJobs", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebJobsPreparer prepares the ListWebJobs request. +func (client AppsClient) ListWebJobsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/webjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebJobsSender sends the ListWebJobs request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListWebJobsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebJobsResponder handles the response to the ListWebJobs request. The method always +// closes the http.Response Body. +func (client AppsClient) ListWebJobsResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebJobsNextResults retrieves the next set of results, if any. +func (client AppsClient) listWebJobsNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listWebJobsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebJobsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listWebJobsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listWebJobsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebJobsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListWebJobs") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebJobs(ctx, resourceGroupName, name) + return +} + +// ListWebJobsSlot description for List webjobs for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// slot - name of the deployment slot. If a slot is not specified, the API returns deployments for the +// production slot. +func (client AppsClient) ListWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result JobCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListWebJobsSlot") + defer func() { + sc := -1 + if result.jc.Response.Response != nil { + sc = result.jc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ListWebJobsSlot", err.Error()) + } + + result.fn = client.listWebJobsSlotNextResults + req, err := client.ListWebJobsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListWebJobsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebJobsSlotSender(req) + if err != nil { + result.jc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListWebJobsSlot", resp, "Failure sending request") + return + } + + result.jc, err = client.ListWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ListWebJobsSlot", resp, "Failure responding to request") + return + } + if result.jc.hasNextLink() && result.jc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebJobsSlotPreparer prepares the ListWebJobsSlot request. +func (client AppsClient) ListWebJobsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/webjobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebJobsSlotSender sends the ListWebJobsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ListWebJobsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebJobsSlotResponder handles the response to the ListWebJobsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ListWebJobsSlotResponder(resp *http.Response) (result JobCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebJobsSlotNextResults retrieves the next set of results, if any. +func (client AppsClient) listWebJobsSlotNextResults(ctx context.Context, lastResults JobCollection) (result JobCollection, err error) { + req, err := lastResults.jobCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listWebJobsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebJobsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppsClient", "listWebJobsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebJobsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "listWebJobsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebJobsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppsClient) ListWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result JobCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ListWebJobsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebJobsSlot(ctx, resourceGroupName, name, slot) + return +} + +// MigrateMySQL description for Migrates a local (in-app) MySql database to a remote MySql database. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// migrationRequestEnvelope - mySql migration options. +func (client AppsClient) MigrateMySQL(ctx context.Context, resourceGroupName string, name string, migrationRequestEnvelope MigrateMySQLRequest) (result AppsMigrateMySQLFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.MigrateMySQL") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: migrationRequestEnvelope, + Constraints: []validation.Constraint{{Target: "migrationRequestEnvelope.MigrateMySQLRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "migrationRequestEnvelope.MigrateMySQLRequestProperties.ConnectionString", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "MigrateMySQL", err.Error()) + } + + req, err := client.MigrateMySQLPreparer(ctx, resourceGroupName, name, migrationRequestEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "MigrateMySQL", nil, "Failure preparing request") + return + } + + result, err = client.MigrateMySQLSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "MigrateMySQL", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateMySQLPreparer prepares the MigrateMySQL request. +func (client AppsClient) MigrateMySQLPreparer(ctx context.Context, resourceGroupName string, name string, migrationRequestEnvelope MigrateMySQLRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migratemysql", pathParameters), + autorest.WithJSON(migrationRequestEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateMySQLSender sends the MigrateMySQL request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) MigrateMySQLSender(req *http.Request) (future AppsMigrateMySQLFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateMySQLResponder handles the response to the MigrateMySQL request. The method always +// closes the http.Response Body. +func (client AppsClient) MigrateMySQLResponder(resp *http.Response) (result Operation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// MigrateStorage description for Restores a web app. +// Parameters: +// subscriptionName - azure subscription. +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// migrationOptions - migration migrationOptions. +func (client AppsClient) MigrateStorage(ctx context.Context, subscriptionName string, resourceGroupName string, name string, migrationOptions StorageMigrationOptions) (result AppsMigrateStorageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.MigrateStorage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: migrationOptions, + Constraints: []validation.Constraint{{Target: "migrationOptions.StorageMigrationOptionsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "migrationOptions.StorageMigrationOptionsProperties.AzurefilesConnectionString", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "migrationOptions.StorageMigrationOptionsProperties.AzurefilesShare", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "MigrateStorage", err.Error()) + } + + req, err := client.MigrateStoragePreparer(ctx, subscriptionName, resourceGroupName, name, migrationOptions) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "MigrateStorage", nil, "Failure preparing request") + return + } + + result, err = client.MigrateStorageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "MigrateStorage", result.Response(), "Failure sending request") + return + } + + return +} + +// MigrateStoragePreparer prepares the MigrateStorage request. +func (client AppsClient) MigrateStoragePreparer(ctx context.Context, subscriptionName string, resourceGroupName string, name string, migrationOptions StorageMigrationOptions) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "subscriptionName": autorest.Encode("query", subscriptionName), + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/migrate", pathParameters), + autorest.WithJSON(migrationOptions), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MigrateStorageSender sends the MigrateStorage request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) MigrateStorageSender(req *http.Request) (future AppsMigrateStorageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// MigrateStorageResponder handles the response to the MigrateStorage request. The method always +// closes the http.Response Body. +func (client AppsClient) MigrateStorageResponder(resp *http.Response) (result StorageMigrationResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PutPrivateAccessVnet description for Sets data around private site access enablement and authorized Virtual Networks +// that can access the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// access - the information for the private access +func (client AppsClient) PutPrivateAccessVnet(ctx context.Context, resourceGroupName string, name string, access PrivateAccess) (result PrivateAccess, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.PutPrivateAccessVnet") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "PutPrivateAccessVnet", err.Error()) + } + + req, err := client.PutPrivateAccessVnetPreparer(ctx, resourceGroupName, name, access) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "PutPrivateAccessVnet", nil, "Failure preparing request") + return + } + + resp, err := client.PutPrivateAccessVnetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "PutPrivateAccessVnet", resp, "Failure sending request") + return + } + + result, err = client.PutPrivateAccessVnetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "PutPrivateAccessVnet", resp, "Failure responding to request") + return + } + + return +} + +// PutPrivateAccessVnetPreparer prepares the PutPrivateAccessVnet request. +func (client AppsClient) PutPrivateAccessVnetPreparer(ctx context.Context, resourceGroupName string, name string, access PrivateAccess) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/privateAccess/virtualNetworks", pathParameters), + autorest.WithJSON(access), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutPrivateAccessVnetSender sends the PutPrivateAccessVnet request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) PutPrivateAccessVnetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutPrivateAccessVnetResponder handles the response to the PutPrivateAccessVnet request. The method always +// closes the http.Response Body. +func (client AppsClient) PutPrivateAccessVnetResponder(resp *http.Response) (result PrivateAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// PutPrivateAccessVnetSlot description for Sets data around private site access enablement and authorized Virtual +// Networks that can access the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// access - the information for the private access +// slot - the name of the slot for the web app. +func (client AppsClient) PutPrivateAccessVnetSlot(ctx context.Context, resourceGroupName string, name string, access PrivateAccess, slot string) (result PrivateAccess, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.PutPrivateAccessVnetSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "PutPrivateAccessVnetSlot", err.Error()) + } + + req, err := client.PutPrivateAccessVnetSlotPreparer(ctx, resourceGroupName, name, access, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "PutPrivateAccessVnetSlot", nil, "Failure preparing request") + return + } + + resp, err := client.PutPrivateAccessVnetSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "PutPrivateAccessVnetSlot", resp, "Failure sending request") + return + } + + result, err = client.PutPrivateAccessVnetSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "PutPrivateAccessVnetSlot", resp, "Failure responding to request") + return + } + + return +} + +// PutPrivateAccessVnetSlotPreparer prepares the PutPrivateAccessVnetSlot request. +func (client AppsClient) PutPrivateAccessVnetSlotPreparer(ctx context.Context, resourceGroupName string, name string, access PrivateAccess, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/privateAccess/virtualNetworks", pathParameters), + autorest.WithJSON(access), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PutPrivateAccessVnetSlotSender sends the PutPrivateAccessVnetSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) PutPrivateAccessVnetSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PutPrivateAccessVnetSlotResponder handles the response to the PutPrivateAccessVnetSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) PutPrivateAccessVnetSlotResponder(resp *http.Response) (result PrivateAccess, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RecoverSiteConfigurationSnapshot description for Reverts the configuration of an app to a previous snapshot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// snapshotID - the ID of the snapshot to read. +func (client AppsClient) RecoverSiteConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RecoverSiteConfigurationSnapshot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RecoverSiteConfigurationSnapshot", err.Error()) + } + + req, err := client.RecoverSiteConfigurationSnapshotPreparer(ctx, resourceGroupName, name, snapshotID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshot", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverSiteConfigurationSnapshotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshot", resp, "Failure sending request") + return + } + + result, err = client.RecoverSiteConfigurationSnapshotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshot", resp, "Failure responding to request") + return + } + + return +} + +// RecoverSiteConfigurationSnapshotPreparer prepares the RecoverSiteConfigurationSnapshot request. +func (client AppsClient) RecoverSiteConfigurationSnapshotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "snapshotId": autorest.Encode("path", snapshotID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web/snapshots/{snapshotId}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverSiteConfigurationSnapshotSender sends the RecoverSiteConfigurationSnapshot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RecoverSiteConfigurationSnapshotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RecoverSiteConfigurationSnapshotResponder handles the response to the RecoverSiteConfigurationSnapshot request. The method always +// closes the http.Response Body. +func (client AppsClient) RecoverSiteConfigurationSnapshotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RecoverSiteConfigurationSnapshotSlot description for Reverts the configuration of an app to a previous snapshot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// snapshotID - the ID of the snapshot to read. +// slot - name of the deployment slot. If a slot is not specified, the API will return configuration for the +// production slot. +func (client AppsClient) RecoverSiteConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RecoverSiteConfigurationSnapshotSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RecoverSiteConfigurationSnapshotSlot", err.Error()) + } + + req, err := client.RecoverSiteConfigurationSnapshotSlotPreparer(ctx, resourceGroupName, name, snapshotID, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshotSlot", nil, "Failure preparing request") + return + } + + resp, err := client.RecoverSiteConfigurationSnapshotSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshotSlot", resp, "Failure sending request") + return + } + + result, err = client.RecoverSiteConfigurationSnapshotSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RecoverSiteConfigurationSnapshotSlot", resp, "Failure responding to request") + return + } + + return +} + +// RecoverSiteConfigurationSnapshotSlotPreparer prepares the RecoverSiteConfigurationSnapshotSlot request. +func (client AppsClient) RecoverSiteConfigurationSnapshotSlotPreparer(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "snapshotId": autorest.Encode("path", snapshotID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web/snapshots/{snapshotId}/recover", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RecoverSiteConfigurationSnapshotSlotSender sends the RecoverSiteConfigurationSnapshotSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RecoverSiteConfigurationSnapshotSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RecoverSiteConfigurationSnapshotSlotResponder handles the response to the RecoverSiteConfigurationSnapshotSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RecoverSiteConfigurationSnapshotSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetProductionSlotConfig description for Resets the configuration settings of the current slot if they were +// previously modified by calling the API with POST. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) ResetProductionSlotConfig(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ResetProductionSlotConfig") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ResetProductionSlotConfig", err.Error()) + } + + req, err := client.ResetProductionSlotConfigPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ResetProductionSlotConfig", nil, "Failure preparing request") + return + } + + resp, err := client.ResetProductionSlotConfigSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ResetProductionSlotConfig", resp, "Failure sending request") + return + } + + result, err = client.ResetProductionSlotConfigResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ResetProductionSlotConfig", resp, "Failure responding to request") + return + } + + return +} + +// ResetProductionSlotConfigPreparer prepares the ResetProductionSlotConfig request. +func (client AppsClient) ResetProductionSlotConfigPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resetSlotConfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetProductionSlotConfigSender sends the ResetProductionSlotConfig request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ResetProductionSlotConfigSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetProductionSlotConfigResponder handles the response to the ResetProductionSlotConfig request. The method always +// closes the http.Response Body. +func (client AppsClient) ResetProductionSlotConfigResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetSlotConfigurationSlot description for Resets the configuration settings of the current slot if they were +// previously modified by calling the API with POST. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API resets configuration settings for +// the production slot. +func (client AppsClient) ResetSlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.ResetSlotConfigurationSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "ResetSlotConfigurationSlot", err.Error()) + } + + req, err := client.ResetSlotConfigurationSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ResetSlotConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ResetSlotConfigurationSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "ResetSlotConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.ResetSlotConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "ResetSlotConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// ResetSlotConfigurationSlotPreparer prepares the ResetSlotConfigurationSlot request. +func (client AppsClient) ResetSlotConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resetSlotConfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetSlotConfigurationSlotSender sends the ResetSlotConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) ResetSlotConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetSlotConfigurationSlotResponder handles the response to the ResetSlotConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) ResetSlotConfigurationSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restart description for Restarts an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// softRestart - specify true to apply the configuration settings and restarts the app only if necessary. By +// default, the API always restarts and reprovisions the app. +// synchronous - specify true to block until the app is restarted. By default, it is set to false, and the API +// responds immediately (asynchronous). +func (client AppsClient) Restart(ctx context.Context, resourceGroupName string, name string, softRestart *bool, synchronous *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Restart") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Restart", err.Error()) + } + + req, err := client.RestartPreparer(ctx, resourceGroupName, name, softRestart, synchronous) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Restart", nil, "Failure preparing request") + return + } + + resp, err := client.RestartSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "Restart", resp, "Failure sending request") + return + } + + result, err = client.RestartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Restart", resp, "Failure responding to request") + return + } + + return +} + +// RestartPreparer prepares the Restart request. +func (client AppsClient) RestartPreparer(ctx context.Context, resourceGroupName string, name string, softRestart *bool, synchronous *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if softRestart != nil { + queryParameters["softRestart"] = autorest.Encode("query", *softRestart) + } + if synchronous != nil { + queryParameters["synchronous"] = autorest.Encode("query", *synchronous) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSender sends the Restart request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestartSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RestartResponder handles the response to the Restart request. The method always +// closes the http.Response Body. +func (client AppsClient) RestartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestartSlot description for Restarts an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will restart the production slot. +// softRestart - specify true to apply the configuration settings and restarts the app only if necessary. By +// default, the API always restarts and reprovisions the app. +// synchronous - specify true to block until the app is restarted. By default, it is set to false, and the API +// responds immediately (asynchronous). +func (client AppsClient) RestartSlot(ctx context.Context, resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestartSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestartSlot", err.Error()) + } + + req, err := client.RestartSlotPreparer(ctx, resourceGroupName, name, slot, softRestart, synchronous) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestartSlot", nil, "Failure preparing request") + return + } + + resp, err := client.RestartSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestartSlot", resp, "Failure sending request") + return + } + + result, err = client.RestartSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestartSlot", resp, "Failure responding to request") + return + } + + return +} + +// RestartSlotPreparer prepares the RestartSlot request. +func (client AppsClient) RestartSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if softRestart != nil { + queryParameters["softRestart"] = autorest.Encode("query", *softRestart) + } + if synchronous != nil { + queryParameters["synchronous"] = autorest.Encode("query", *synchronous) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartSlotSender sends the RestartSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestartSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RestartSlotResponder handles the response to the RestartSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RestartSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Restore description for Restores a specific backup to another app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// backupID - ID of the backup. +// request - information on restore request . +func (client AppsClient) Restore(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest) (result AppsRestoreFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Restore") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Restore", err.Error()) + } + + req, err := client.RestorePreparer(ctx, resourceGroupName, name, backupID, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Restore", nil, "Failure preparing request") + return + } + + result, err = client.RestoreSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Restore", result.Response(), "Failure sending request") + return + } + + return +} + +// RestorePreparer prepares the Restore request. +func (client AppsClient) RestorePreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/backups/{backupId}/restore", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSender sends the Restore request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreSender(req *http.Request) (future AppsRestoreFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreResponder handles the response to the Restore request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreFromBackupBlob description for Restores an app from a backup blob in Azure Storage. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - information on restore request . +func (client AppsClient) RestoreFromBackupBlob(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (result AppsRestoreFromBackupBlobFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreFromBackupBlob") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreFromBackupBlob", err.Error()) + } + + req, err := client.RestoreFromBackupBlobPreparer(ctx, resourceGroupName, name, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromBackupBlob", nil, "Failure preparing request") + return + } + + result, err = client.RestoreFromBackupBlobSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromBackupBlob", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreFromBackupBlobPreparer prepares the RestoreFromBackupBlob request. +func (client AppsClient) RestoreFromBackupBlobPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromBackupBlob", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreFromBackupBlobSender sends the RestoreFromBackupBlob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreFromBackupBlobSender(req *http.Request) (future AppsRestoreFromBackupBlobFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreFromBackupBlobResponder handles the response to the RestoreFromBackupBlob request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreFromBackupBlobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreFromBackupBlobSlot description for Restores an app from a backup blob in Azure Storage. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - information on restore request . +// slot - name of the deployment slot. If a slot is not specified, the API will restore a backup of the +// production slot. +func (client AppsClient) RestoreFromBackupBlobSlot(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (result AppsRestoreFromBackupBlobSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreFromBackupBlobSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreFromBackupBlobSlot", err.Error()) + } + + req, err := client.RestoreFromBackupBlobSlotPreparer(ctx, resourceGroupName, name, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromBackupBlobSlot", nil, "Failure preparing request") + return + } + + result, err = client.RestoreFromBackupBlobSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromBackupBlobSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreFromBackupBlobSlotPreparer prepares the RestoreFromBackupBlobSlot request. +func (client AppsClient) RestoreFromBackupBlobSlotPreparer(ctx context.Context, resourceGroupName string, name string, request RestoreRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromBackupBlob", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreFromBackupBlobSlotSender sends the RestoreFromBackupBlobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreFromBackupBlobSlotSender(req *http.Request) (future AppsRestoreFromBackupBlobSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreFromBackupBlobSlotResponder handles the response to the RestoreFromBackupBlobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreFromBackupBlobSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreFromDeletedApp description for Restores a deleted web app to this web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// restoreRequest - deleted web app restore information. +func (client AppsClient) RestoreFromDeletedApp(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest) (result AppsRestoreFromDeletedAppFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreFromDeletedApp") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreFromDeletedApp", err.Error()) + } + + req, err := client.RestoreFromDeletedAppPreparer(ctx, resourceGroupName, name, restoreRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromDeletedApp", nil, "Failure preparing request") + return + } + + result, err = client.RestoreFromDeletedAppSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromDeletedApp", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreFromDeletedAppPreparer prepares the RestoreFromDeletedApp request. +func (client AppsClient) RestoreFromDeletedAppPreparer(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreFromDeletedApp", pathParameters), + autorest.WithJSON(restoreRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreFromDeletedAppSender sends the RestoreFromDeletedApp request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreFromDeletedAppSender(req *http.Request) (future AppsRestoreFromDeletedAppFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreFromDeletedAppResponder handles the response to the RestoreFromDeletedApp request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreFromDeletedAppResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreFromDeletedAppSlot description for Restores a deleted web app to this web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// restoreRequest - deleted web app restore information. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) RestoreFromDeletedAppSlot(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest, slot string) (result AppsRestoreFromDeletedAppSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreFromDeletedAppSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreFromDeletedAppSlot", err.Error()) + } + + req, err := client.RestoreFromDeletedAppSlotPreparer(ctx, resourceGroupName, name, restoreRequest, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromDeletedAppSlot", nil, "Failure preparing request") + return + } + + result, err = client.RestoreFromDeletedAppSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreFromDeletedAppSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreFromDeletedAppSlotPreparer prepares the RestoreFromDeletedAppSlot request. +func (client AppsClient) RestoreFromDeletedAppSlotPreparer(ctx context.Context, resourceGroupName string, name string, restoreRequest DeletedAppRestoreRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreFromDeletedApp", pathParameters), + autorest.WithJSON(restoreRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreFromDeletedAppSlotSender sends the RestoreFromDeletedAppSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreFromDeletedAppSlotSender(req *http.Request) (future AppsRestoreFromDeletedAppSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreFromDeletedAppSlotResponder handles the response to the RestoreFromDeletedAppSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreFromDeletedAppSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreSlot description for Restores a specific backup to another app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// backupID - ID of the backup. +// request - information on restore request . +// slot - name of the deployment slot. If a slot is not specified, the API will restore a backup of the +// production slot. +func (client AppsClient) RestoreSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest, slot string) (result AppsRestoreSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.RestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.RestoreRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.RestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreSlot", err.Error()) + } + + req, err := client.RestoreSlotPreparer(ctx, resourceGroupName, name, backupID, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreSlot", nil, "Failure preparing request") + return + } + + result, err = client.RestoreSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreSlotPreparer prepares the RestoreSlot request. +func (client AppsClient) RestoreSlotPreparer(ctx context.Context, resourceGroupName string, name string, backupID string, request RestoreRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "backupId": autorest.Encode("path", backupID), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/backups/{backupId}/restore", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSlotSender sends the RestoreSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreSlotSender(req *http.Request) (future AppsRestoreSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreSlotResponder handles the response to the RestoreSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreSnapshot description for Restores a web app from a snapshot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// restoreRequest - snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites +// or GetSiteSnapshots API. +func (client AppsClient) RestoreSnapshot(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest) (result AppsRestoreSnapshotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreSnapshot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: restoreRequest, + Constraints: []validation.Constraint{{Target: "restoreRequest.SnapshotRestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "restoreRequest.SnapshotRestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreSnapshot", err.Error()) + } + + req, err := client.RestoreSnapshotPreparer(ctx, resourceGroupName, name, restoreRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreSnapshot", nil, "Failure preparing request") + return + } + + result, err = client.RestoreSnapshotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreSnapshot", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreSnapshotPreparer prepares the RestoreSnapshot request. +func (client AppsClient) RestoreSnapshotPreparer(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/restoreSnapshot", pathParameters), + autorest.WithJSON(restoreRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSnapshotSender sends the RestoreSnapshot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreSnapshotSender(req *http.Request) (future AppsRestoreSnapshotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreSnapshotResponder handles the response to the RestoreSnapshot request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreSnapshotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestoreSnapshotSlot description for Restores a web app from a snapshot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// restoreRequest - snapshot restore settings. Snapshot information can be obtained by calling GetDeletedSites +// or GetSiteSnapshots API. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) RestoreSnapshotSlot(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest, slot string) (result AppsRestoreSnapshotSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RestoreSnapshotSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: restoreRequest, + Constraints: []validation.Constraint{{Target: "restoreRequest.SnapshotRestoreRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "restoreRequest.SnapshotRestoreRequestProperties.Overwrite", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RestoreSnapshotSlot", err.Error()) + } + + req, err := client.RestoreSnapshotSlotPreparer(ctx, resourceGroupName, name, restoreRequest, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreSnapshotSlot", nil, "Failure preparing request") + return + } + + result, err = client.RestoreSnapshotSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RestoreSnapshotSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// RestoreSnapshotSlotPreparer prepares the RestoreSnapshotSlot request. +func (client AppsClient) RestoreSnapshotSlotPreparer(ctx context.Context, resourceGroupName string, name string, restoreRequest SnapshotRestoreRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/restoreSnapshot", pathParameters), + autorest.WithJSON(restoreRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestoreSnapshotSlotSender sends the RestoreSnapshotSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RestoreSnapshotSlotSender(req *http.Request) (future AppsRestoreSnapshotSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RestoreSnapshotSlotResponder handles the response to the RestoreSnapshotSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RestoreSnapshotSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// RunTriggeredWebJob description for Run a triggered web job for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) RunTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RunTriggeredWebJob") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RunTriggeredWebJob", err.Error()) + } + + req, err := client.RunTriggeredWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RunTriggeredWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.RunTriggeredWebJobSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "RunTriggeredWebJob", resp, "Failure sending request") + return + } + + result, err = client.RunTriggeredWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RunTriggeredWebJob", resp, "Failure responding to request") + return + } + + return +} + +// RunTriggeredWebJobPreparer prepares the RunTriggeredWebJob request. +func (client AppsClient) RunTriggeredWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/triggeredwebjobs/{webJobName}/run", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RunTriggeredWebJobSender sends the RunTriggeredWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RunTriggeredWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RunTriggeredWebJobResponder handles the response to the RunTriggeredWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) RunTriggeredWebJobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// RunTriggeredWebJobSlot description for Run a triggered web job for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API uses the production slot. +func (client AppsClient) RunTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.RunTriggeredWebJobSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "RunTriggeredWebJobSlot", err.Error()) + } + + req, err := client.RunTriggeredWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RunTriggeredWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.RunTriggeredWebJobSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "RunTriggeredWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.RunTriggeredWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "RunTriggeredWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// RunTriggeredWebJobSlotPreparer prepares the RunTriggeredWebJobSlot request. +func (client AppsClient) RunTriggeredWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/triggeredwebjobs/{webJobName}/run", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RunTriggeredWebJobSlotSender sends the RunTriggeredWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) RunTriggeredWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RunTriggeredWebJobSlotResponder handles the response to the RunTriggeredWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) RunTriggeredWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start description for Starts an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) Start(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Start") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Start", nil, "Failure preparing request") + return + } + + resp, err := client.StartSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "Start", resp, "Failure sending request") + return + } + + result, err = client.StartResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Start", resp, "Failure responding to request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client AppsClient) StartPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client AppsClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StartContinuousWebJob description for Start a continuous web job for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) StartContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartContinuousWebJob") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartContinuousWebJob", err.Error()) + } + + req, err := client.StartContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartContinuousWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.StartContinuousWebJobSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartContinuousWebJob", resp, "Failure sending request") + return + } + + result, err = client.StartContinuousWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartContinuousWebJob", resp, "Failure responding to request") + return + } + + return +} + +// StartContinuousWebJobPreparer prepares the StartContinuousWebJob request. +func (client AppsClient) StartContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartContinuousWebJobSender sends the StartContinuousWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartContinuousWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartContinuousWebJobResponder handles the response to the StartContinuousWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) StartContinuousWebJobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StartContinuousWebJobSlot description for Start a continuous web job for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) StartContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartContinuousWebJobSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartContinuousWebJobSlot", err.Error()) + } + + req, err := client.StartContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartContinuousWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StartContinuousWebJobSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartContinuousWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.StartContinuousWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartContinuousWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// StartContinuousWebJobSlotPreparer prepares the StartContinuousWebJobSlot request. +func (client AppsClient) StartContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartContinuousWebJobSlotSender sends the StartContinuousWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartContinuousWebJobSlotResponder handles the response to the StartContinuousWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StartContinuousWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StartNetworkTrace description for Start capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// durationInSeconds - the duration to keep capturing in seconds. +// maxFrameLength - the maximum frame length in bytes (Optional). +// sasURL - the Blob URL to store capture file. +func (client AppsClient) StartNetworkTrace(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result AppsStartNetworkTraceFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartNetworkTrace") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartNetworkTrace", err.Error()) + } + + req, err := client.StartNetworkTracePreparer(ctx, resourceGroupName, name, durationInSeconds, maxFrameLength, sasURL) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartNetworkTrace", nil, "Failure preparing request") + return + } + + result, err = client.StartNetworkTraceSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartNetworkTrace", result.Response(), "Failure sending request") + return + } + + return +} + +// StartNetworkTracePreparer prepares the StartNetworkTrace request. +func (client AppsClient) StartNetworkTracePreparer(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if durationInSeconds != nil { + queryParameters["durationInSeconds"] = autorest.Encode("query", *durationInSeconds) + } + if maxFrameLength != nil { + queryParameters["maxFrameLength"] = autorest.Encode("query", *maxFrameLength) + } + if len(sasURL) > 0 { + queryParameters["sasUrl"] = autorest.Encode("query", sasURL) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/startNetworkTrace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartNetworkTraceSender sends the StartNetworkTrace request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartNetworkTraceSender(req *http.Request) (future AppsStartNetworkTraceFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartNetworkTraceResponder handles the response to the StartNetworkTrace request. The method always +// closes the http.Response Body. +func (client AppsClient) StartNetworkTraceResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartNetworkTraceSlot description for Start capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for this web app. +// durationInSeconds - the duration to keep capturing in seconds. +// maxFrameLength - the maximum frame length in bytes (Optional). +// sasURL - the Blob URL to store capture file. +func (client AppsClient) StartNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result AppsStartNetworkTraceSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartNetworkTraceSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartNetworkTraceSlot", err.Error()) + } + + req, err := client.StartNetworkTraceSlotPreparer(ctx, resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasURL) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartNetworkTraceSlot", nil, "Failure preparing request") + return + } + + result, err = client.StartNetworkTraceSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartNetworkTraceSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// StartNetworkTraceSlotPreparer prepares the StartNetworkTraceSlot request. +func (client AppsClient) StartNetworkTraceSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if durationInSeconds != nil { + queryParameters["durationInSeconds"] = autorest.Encode("query", *durationInSeconds) + } + if maxFrameLength != nil { + queryParameters["maxFrameLength"] = autorest.Encode("query", *maxFrameLength) + } + if len(sasURL) > 0 { + queryParameters["sasUrl"] = autorest.Encode("query", sasURL) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/startNetworkTrace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartNetworkTraceSlotSender sends the StartNetworkTraceSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartNetworkTraceSlotSender(req *http.Request) (future AppsStartNetworkTraceSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartNetworkTraceSlotResponder handles the response to the StartNetworkTraceSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StartNetworkTraceSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartSlot description for Starts an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will start the production slot. +func (client AppsClient) StartSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartSlot", err.Error()) + } + + req, err := client.StartSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StartSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartSlot", resp, "Failure sending request") + return + } + + result, err = client.StartSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartSlot", resp, "Failure responding to request") + return + } + + return +} + +// StartSlotPreparer prepares the StartSlot request. +func (client AppsClient) StartSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSlotSender sends the StartSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartSlotResponder handles the response to the StartSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StartSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StartWebSiteNetworkTrace description for Start capturing network packets for the site (To be deprecated). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// durationInSeconds - the duration to keep capturing in seconds. +// maxFrameLength - the maximum frame length in bytes (Optional). +// sasURL - the Blob URL to store capture file. +func (client AppsClient) StartWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartWebSiteNetworkTrace") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartWebSiteNetworkTrace", err.Error()) + } + + req, err := client.StartWebSiteNetworkTracePreparer(ctx, resourceGroupName, name, durationInSeconds, maxFrameLength, sasURL) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTrace", nil, "Failure preparing request") + return + } + + resp, err := client.StartWebSiteNetworkTraceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTrace", resp, "Failure sending request") + return + } + + result, err = client.StartWebSiteNetworkTraceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTrace", resp, "Failure responding to request") + return + } + + return +} + +// StartWebSiteNetworkTracePreparer prepares the StartWebSiteNetworkTrace request. +func (client AppsClient) StartWebSiteNetworkTracePreparer(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if durationInSeconds != nil { + queryParameters["durationInSeconds"] = autorest.Encode("query", *durationInSeconds) + } + if maxFrameLength != nil { + queryParameters["maxFrameLength"] = autorest.Encode("query", *maxFrameLength) + } + if len(sasURL) > 0 { + queryParameters["sasUrl"] = autorest.Encode("query", sasURL) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartWebSiteNetworkTraceSender sends the StartWebSiteNetworkTrace request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartWebSiteNetworkTraceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartWebSiteNetworkTraceResponder handles the response to the StartWebSiteNetworkTrace request. The method always +// closes the http.Response Body. +func (client AppsClient) StartWebSiteNetworkTraceResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartWebSiteNetworkTraceOperation description for Start capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// durationInSeconds - the duration to keep capturing in seconds. +// maxFrameLength - the maximum frame length in bytes (Optional). +// sasURL - the Blob URL to store capture file. +func (client AppsClient) StartWebSiteNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result AppsStartWebSiteNetworkTraceOperationFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartWebSiteNetworkTraceOperation") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartWebSiteNetworkTraceOperation", err.Error()) + } + + req, err := client.StartWebSiteNetworkTraceOperationPreparer(ctx, resourceGroupName, name, durationInSeconds, maxFrameLength, sasURL) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceOperation", nil, "Failure preparing request") + return + } + + result, err = client.StartWebSiteNetworkTraceOperationSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceOperation", result.Response(), "Failure sending request") + return + } + + return +} + +// StartWebSiteNetworkTraceOperationPreparer prepares the StartWebSiteNetworkTraceOperation request. +func (client AppsClient) StartWebSiteNetworkTraceOperationPreparer(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if durationInSeconds != nil { + queryParameters["durationInSeconds"] = autorest.Encode("query", *durationInSeconds) + } + if maxFrameLength != nil { + queryParameters["maxFrameLength"] = autorest.Encode("query", *maxFrameLength) + } + if len(sasURL) > 0 { + queryParameters["sasUrl"] = autorest.Encode("query", sasURL) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/startOperation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartWebSiteNetworkTraceOperationSender sends the StartWebSiteNetworkTraceOperation request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartWebSiteNetworkTraceOperationSender(req *http.Request) (future AppsStartWebSiteNetworkTraceOperationFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartWebSiteNetworkTraceOperationResponder handles the response to the StartWebSiteNetworkTraceOperation request. The method always +// closes the http.Response Body. +func (client AppsClient) StartWebSiteNetworkTraceOperationResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartWebSiteNetworkTraceOperationSlot description for Start capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for this web app. +// durationInSeconds - the duration to keep capturing in seconds. +// maxFrameLength - the maximum frame length in bytes (Optional). +// sasURL - the Blob URL to store capture file. +func (client AppsClient) StartWebSiteNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result AppsStartWebSiteNetworkTraceOperationSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartWebSiteNetworkTraceOperationSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartWebSiteNetworkTraceOperationSlot", err.Error()) + } + + req, err := client.StartWebSiteNetworkTraceOperationSlotPreparer(ctx, resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasURL) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceOperationSlot", nil, "Failure preparing request") + return + } + + result, err = client.StartWebSiteNetworkTraceOperationSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceOperationSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// StartWebSiteNetworkTraceOperationSlotPreparer prepares the StartWebSiteNetworkTraceOperationSlot request. +func (client AppsClient) StartWebSiteNetworkTraceOperationSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if durationInSeconds != nil { + queryParameters["durationInSeconds"] = autorest.Encode("query", *durationInSeconds) + } + if maxFrameLength != nil { + queryParameters["maxFrameLength"] = autorest.Encode("query", *maxFrameLength) + } + if len(sasURL) > 0 { + queryParameters["sasUrl"] = autorest.Encode("query", sasURL) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/startOperation", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartWebSiteNetworkTraceOperationSlotSender sends the StartWebSiteNetworkTraceOperationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartWebSiteNetworkTraceOperationSlotSender(req *http.Request) (future AppsStartWebSiteNetworkTraceOperationSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartWebSiteNetworkTraceOperationSlotResponder handles the response to the StartWebSiteNetworkTraceOperationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StartWebSiteNetworkTraceOperationSlotResponder(resp *http.Response) (result ListNetworkTrace, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// StartWebSiteNetworkTraceSlot description for Start capturing network packets for the site (To be deprecated). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for this web app. +// durationInSeconds - the duration to keep capturing in seconds. +// maxFrameLength - the maximum frame length in bytes (Optional). +// sasURL - the Blob URL to store capture file. +func (client AppsClient) StartWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result String, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StartWebSiteNetworkTraceSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StartWebSiteNetworkTraceSlot", err.Error()) + } + + req, err := client.StartWebSiteNetworkTraceSlotPreparer(ctx, resourceGroupName, name, slot, durationInSeconds, maxFrameLength, sasURL) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StartWebSiteNetworkTraceSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceSlot", resp, "Failure sending request") + return + } + + result, err = client.StartWebSiteNetworkTraceSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StartWebSiteNetworkTraceSlot", resp, "Failure responding to request") + return + } + + return +} + +// StartWebSiteNetworkTraceSlotPreparer prepares the StartWebSiteNetworkTraceSlot request. +func (client AppsClient) StartWebSiteNetworkTraceSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if durationInSeconds != nil { + queryParameters["durationInSeconds"] = autorest.Encode("query", *durationInSeconds) + } + if maxFrameLength != nil { + queryParameters["maxFrameLength"] = autorest.Encode("query", *maxFrameLength) + } + if len(sasURL) > 0 { + queryParameters["sasUrl"] = autorest.Encode("query", sasURL) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartWebSiteNetworkTraceSlotSender sends the StartWebSiteNetworkTraceSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StartWebSiteNetworkTraceSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StartWebSiteNetworkTraceSlotResponder handles the response to the StartWebSiteNetworkTraceSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StartWebSiteNetworkTraceSlotResponder(resp *http.Response) (result String, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Stop description for Stops an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) Stop(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Stop") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Stop", nil, "Failure preparing request") + return + } + + resp, err := client.StopSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "Stop", resp, "Failure sending request") + return + } + + result, err = client.StopResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Stop", resp, "Failure responding to request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client AppsClient) StopPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client AppsClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopContinuousWebJob description for Stop a continuous web job for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +func (client AppsClient) StopContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopContinuousWebJob") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopContinuousWebJob", err.Error()) + } + + req, err := client.StopContinuousWebJobPreparer(ctx, resourceGroupName, name, webJobName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopContinuousWebJob", nil, "Failure preparing request") + return + } + + resp, err := client.StopContinuousWebJobSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopContinuousWebJob", resp, "Failure sending request") + return + } + + result, err = client.StopContinuousWebJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopContinuousWebJob", resp, "Failure responding to request") + return + } + + return +} + +// StopContinuousWebJobPreparer prepares the StopContinuousWebJob request. +func (client AppsClient) StopContinuousWebJobPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/continuouswebjobs/{webJobName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopContinuousWebJobSender sends the StopContinuousWebJob request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopContinuousWebJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopContinuousWebJobResponder handles the response to the StopContinuousWebJob request. The method always +// closes the http.Response Body. +func (client AppsClient) StopContinuousWebJobResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopContinuousWebJobSlot description for Stop a continuous web job for an app, or a deployment slot. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site name. +// webJobName - name of Web Job. +// slot - name of the deployment slot. If a slot is not specified, the API deletes a deployment for the +// production slot. +func (client AppsClient) StopContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopContinuousWebJobSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopContinuousWebJobSlot", err.Error()) + } + + req, err := client.StopContinuousWebJobSlotPreparer(ctx, resourceGroupName, name, webJobName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopContinuousWebJobSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StopContinuousWebJobSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopContinuousWebJobSlot", resp, "Failure sending request") + return + } + + result, err = client.StopContinuousWebJobSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopContinuousWebJobSlot", resp, "Failure responding to request") + return + } + + return +} + +// StopContinuousWebJobSlotPreparer prepares the StopContinuousWebJobSlot request. +func (client AppsClient) StopContinuousWebJobSlotPreparer(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webJobName": autorest.Encode("path", webJobName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/continuouswebjobs/{webJobName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopContinuousWebJobSlotSender sends the StopContinuousWebJobSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopContinuousWebJobSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopContinuousWebJobSlotResponder handles the response to the StopContinuousWebJobSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StopContinuousWebJobSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopNetworkTrace description for Stop ongoing capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +func (client AppsClient) StopNetworkTrace(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopNetworkTrace") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopNetworkTrace", err.Error()) + } + + req, err := client.StopNetworkTracePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopNetworkTrace", nil, "Failure preparing request") + return + } + + resp, err := client.StopNetworkTraceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopNetworkTrace", resp, "Failure sending request") + return + } + + result, err = client.StopNetworkTraceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopNetworkTrace", resp, "Failure responding to request") + return + } + + return +} + +// StopNetworkTracePreparer prepares the StopNetworkTrace request. +func (client AppsClient) StopNetworkTracePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/stopNetworkTrace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopNetworkTraceSender sends the StopNetworkTrace request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopNetworkTraceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopNetworkTraceResponder handles the response to the StopNetworkTrace request. The method always +// closes the http.Response Body. +func (client AppsClient) StopNetworkTraceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopNetworkTraceSlot description for Stop ongoing capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for this web app. +func (client AppsClient) StopNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopNetworkTraceSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopNetworkTraceSlot", err.Error()) + } + + req, err := client.StopNetworkTraceSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopNetworkTraceSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StopNetworkTraceSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopNetworkTraceSlot", resp, "Failure sending request") + return + } + + result, err = client.StopNetworkTraceSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopNetworkTraceSlot", resp, "Failure responding to request") + return + } + + return +} + +// StopNetworkTraceSlotPreparer prepares the StopNetworkTraceSlot request. +func (client AppsClient) StopNetworkTraceSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stopNetworkTrace", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopNetworkTraceSlotSender sends the StopNetworkTraceSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopNetworkTraceSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopNetworkTraceSlotResponder handles the response to the StopNetworkTraceSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StopNetworkTraceSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopSlot description for Stops an app (or deployment slot, if specified). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will stop the production slot. +func (client AppsClient) StopSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopSlot", err.Error()) + } + + req, err := client.StopSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StopSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopSlot", resp, "Failure sending request") + return + } + + result, err = client.StopSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopSlot", resp, "Failure responding to request") + return + } + + return +} + +// StopSlotPreparer prepares the StopSlot request. +func (client AppsClient) StopSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSlotSender sends the StopSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopSlotResponder handles the response to the StopSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StopSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopWebSiteNetworkTrace description for Stop ongoing capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +func (client AppsClient) StopWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopWebSiteNetworkTrace") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopWebSiteNetworkTrace", err.Error()) + } + + req, err := client.StopWebSiteNetworkTracePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopWebSiteNetworkTrace", nil, "Failure preparing request") + return + } + + resp, err := client.StopWebSiteNetworkTraceSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopWebSiteNetworkTrace", resp, "Failure sending request") + return + } + + result, err = client.StopWebSiteNetworkTraceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopWebSiteNetworkTrace", resp, "Failure responding to request") + return + } + + return +} + +// StopWebSiteNetworkTracePreparer prepares the StopWebSiteNetworkTrace request. +func (client AppsClient) StopWebSiteNetworkTracePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkTrace/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopWebSiteNetworkTraceSender sends the StopWebSiteNetworkTrace request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopWebSiteNetworkTraceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopWebSiteNetworkTraceResponder handles the response to the StopWebSiteNetworkTrace request. The method always +// closes the http.Response Body. +func (client AppsClient) StopWebSiteNetworkTraceResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// StopWebSiteNetworkTraceSlot description for Stop ongoing capturing network packets for the site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// slot - the name of the slot for this web app. +func (client AppsClient) StopWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.StopWebSiteNetworkTraceSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "StopWebSiteNetworkTraceSlot", err.Error()) + } + + req, err := client.StopWebSiteNetworkTraceSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopWebSiteNetworkTraceSlot", nil, "Failure preparing request") + return + } + + resp, err := client.StopWebSiteNetworkTraceSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopWebSiteNetworkTraceSlot", resp, "Failure sending request") + return + } + + result, err = client.StopWebSiteNetworkTraceSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "StopWebSiteNetworkTraceSlot", resp, "Failure responding to request") + return + } + + return +} + +// StopWebSiteNetworkTraceSlotPreparer prepares the StopWebSiteNetworkTraceSlot request. +func (client AppsClient) StopWebSiteNetworkTraceSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkTrace/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopWebSiteNetworkTraceSlotSender sends the StopWebSiteNetworkTraceSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) StopWebSiteNetworkTraceSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// StopWebSiteNetworkTraceSlotResponder handles the response to the StopWebSiteNetworkTraceSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) StopWebSiteNetworkTraceSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SwapSlotSlot description for Swaps two deployment slots of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotSwapEntity - JSON object that contains the target slot name. See example. +// slot - name of the source slot. If a slot is not specified, the production slot is used as the source slot. +func (client AppsClient) SwapSlotSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (result AppsSwapSlotSlotFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SwapSlotSlot") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: slotSwapEntity, + Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SwapSlotSlot", err.Error()) + } + + req, err := client.SwapSlotSlotPreparer(ctx, resourceGroupName, name, slotSwapEntity, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SwapSlotSlot", nil, "Failure preparing request") + return + } + + result, err = client.SwapSlotSlotSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SwapSlotSlot", result.Response(), "Failure sending request") + return + } + + return +} + +// SwapSlotSlotPreparer prepares the SwapSlotSlot request. +func (client AppsClient) SwapSlotSlotPreparer(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/slotsswap", pathParameters), + autorest.WithJSON(slotSwapEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwapSlotSlotSender sends the SwapSlotSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SwapSlotSlotSender(req *http.Request) (future AppsSwapSlotSlotFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwapSlotSlotResponder handles the response to the SwapSlotSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) SwapSlotSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// SwapSlotWithProduction description for Swaps two deployment slots of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotSwapEntity - JSON object that contains the target slot name. See example. +func (client AppsClient) SwapSlotWithProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (result AppsSwapSlotWithProductionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SwapSlotWithProduction") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: slotSwapEntity, + Constraints: []validation.Constraint{{Target: "slotSwapEntity.TargetSlot", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "slotSwapEntity.PreserveVnet", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SwapSlotWithProduction", err.Error()) + } + + req, err := client.SwapSlotWithProductionPreparer(ctx, resourceGroupName, name, slotSwapEntity) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SwapSlotWithProduction", nil, "Failure preparing request") + return + } + + result, err = client.SwapSlotWithProductionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SwapSlotWithProduction", result.Response(), "Failure sending request") + return + } + + return +} + +// SwapSlotWithProductionPreparer prepares the SwapSlotWithProduction request. +func (client AppsClient) SwapSlotWithProductionPreparer(ctx context.Context, resourceGroupName string, name string, slotSwapEntity CsmSlotEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slotsswap", pathParameters), + autorest.WithJSON(slotSwapEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SwapSlotWithProductionSender sends the SwapSlotWithProduction request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SwapSlotWithProductionSender(req *http.Request) (future AppsSwapSlotWithProductionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SwapSlotWithProductionResponder handles the response to the SwapSlotWithProduction request. The method always +// closes the http.Response Body. +func (client AppsClient) SwapSlotWithProductionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncFunctions description for Syncs function trigger metadata to the management database +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) SyncFunctions(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctions") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncFunctions", err.Error()) + } + + req, err := client.SyncFunctionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.SyncFunctionsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctions", resp, "Failure sending request") + return + } + + result, err = client.SyncFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctions", resp, "Failure responding to request") + return + } + + return +} + +// SyncFunctionsPreparer prepares the SyncFunctions request. +func (client AppsClient) SyncFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/host/default/sync", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncFunctionsSender sends the SyncFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncFunctionsResponder handles the response to the SyncFunctions request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncFunctionsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncFunctionsSlot description for Syncs function trigger metadata to the management database +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. +func (client AppsClient) SyncFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctionsSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncFunctionsSlot", err.Error()) + } + + req, err := client.SyncFunctionsSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.SyncFunctionsSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionsSlot", resp, "Failure sending request") + return + } + + result, err = client.SyncFunctionsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionsSlot", resp, "Failure responding to request") + return + } + + return +} + +// SyncFunctionsSlotPreparer prepares the SyncFunctionsSlot request. +func (client AppsClient) SyncFunctionsSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/host/default/sync", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncFunctionsSlotSender sends the SyncFunctionsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncFunctionsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncFunctionsSlotResponder handles the response to the SyncFunctionsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncFunctionsSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncFunctionTriggers description for Syncs function trigger metadata to the management database +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) SyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctionTriggers") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncFunctionTriggers", err.Error()) + } + + req, err := client.SyncFunctionTriggersPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionTriggers", nil, "Failure preparing request") + return + } + + resp, err := client.SyncFunctionTriggersSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionTriggers", resp, "Failure sending request") + return + } + + result, err = client.SyncFunctionTriggersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionTriggers", resp, "Failure responding to request") + return + } + + return +} + +// SyncFunctionTriggersPreparer prepares the SyncFunctionTriggers request. +func (client AppsClient) SyncFunctionTriggersPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/syncfunctiontriggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncFunctionTriggersSender sends the SyncFunctionTriggers request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncFunctionTriggersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncFunctionTriggersResponder handles the response to the SyncFunctionTriggers request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncFunctionTriggersResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncFunctionTriggersSlot description for Syncs function trigger metadata to the management database +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slot - name of the deployment slot. +func (client AppsClient) SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncFunctionTriggersSlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncFunctionTriggersSlot", err.Error()) + } + + req, err := client.SyncFunctionTriggersSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionTriggersSlot", nil, "Failure preparing request") + return + } + + resp, err := client.SyncFunctionTriggersSlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionTriggersSlot", resp, "Failure sending request") + return + } + + result, err = client.SyncFunctionTriggersSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncFunctionTriggersSlot", resp, "Failure responding to request") + return + } + + return +} + +// SyncFunctionTriggersSlotPreparer prepares the SyncFunctionTriggersSlot request. +func (client AppsClient) SyncFunctionTriggersSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/syncfunctiontriggers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncFunctionTriggersSlotSender sends the SyncFunctionTriggersSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncFunctionTriggersSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncFunctionTriggersSlotResponder handles the response to the SyncFunctionTriggersSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncFunctionTriggersSlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncRepository description for Sync web app repository. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client AppsClient) SyncRepository(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncRepository") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncRepository", err.Error()) + } + + req, err := client.SyncRepositoryPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncRepository", nil, "Failure preparing request") + return + } + + resp, err := client.SyncRepositorySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncRepository", resp, "Failure sending request") + return + } + + result, err = client.SyncRepositoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncRepository", resp, "Failure responding to request") + return + } + + return +} + +// SyncRepositoryPreparer prepares the SyncRepository request. +func (client AppsClient) SyncRepositoryPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sync", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncRepositorySender sends the SyncRepository request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncRepositorySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncRepositoryResponder handles the response to the SyncRepository request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncRepositoryResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncRepositorySlot description for Sync web app repository. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) SyncRepositorySlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.SyncRepositorySlot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "SyncRepositorySlot", err.Error()) + } + + req, err := client.SyncRepositorySlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncRepositorySlot", nil, "Failure preparing request") + return + } + + resp, err := client.SyncRepositorySlotSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncRepositorySlot", resp, "Failure sending request") + return + } + + result, err = client.SyncRepositorySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "SyncRepositorySlot", resp, "Failure responding to request") + return + } + + return +} + +// SyncRepositorySlotPreparer prepares the SyncRepositorySlot request. +func (client AppsClient) SyncRepositorySlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sync", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncRepositorySlotSender sends the SyncRepositorySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) SyncRepositorySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// SyncRepositorySlotResponder handles the response to the SyncRepositorySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) SyncRepositorySlotResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update description for Creates a new web, mobile, or API app in an existing resource group, or updates an existing +// app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} +// parameter. +// siteEnvelope - a JSON representation of the app properties. See example. +func (client AppsClient) Update(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource) (result Site, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, siteEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AppsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}", pathParameters), + autorest.WithJSON(siteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateResponder(resp *http.Response) (result Site, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateApplicationSettings description for Replaces the application settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// appSettings - application settings of the app. +func (client AppsClient) UpdateApplicationSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateApplicationSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateApplicationSettings", err.Error()) + } + + req, err := client.UpdateApplicationSettingsPreparer(ctx, resourceGroupName, name, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateApplicationSettings", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateApplicationSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateApplicationSettings", resp, "Failure sending request") + return + } + + result, err = client.UpdateApplicationSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateApplicationSettings", resp, "Failure responding to request") + return + } + + return +} + +// UpdateApplicationSettingsPreparer prepares the UpdateApplicationSettings request. +func (client AppsClient) UpdateApplicationSettingsPreparer(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/appsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplicationSettingsSender sends the UpdateApplicationSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateApplicationSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateApplicationSettingsResponder handles the response to the UpdateApplicationSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateApplicationSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateApplicationSettingsSlot description for Replaces the application settings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// appSettings - application settings of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will update the application settings +// for the production slot. +func (client AppsClient) UpdateApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateApplicationSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateApplicationSettingsSlot", err.Error()) + } + + req, err := client.UpdateApplicationSettingsSlotPreparer(ctx, resourceGroupName, name, appSettings, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateApplicationSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateApplicationSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateApplicationSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateApplicationSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateApplicationSettingsSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateApplicationSettingsSlotPreparer prepares the UpdateApplicationSettingsSlot request. +func (client AppsClient) UpdateApplicationSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/appsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateApplicationSettingsSlotSender sends the UpdateApplicationSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateApplicationSettingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateApplicationSettingsSlotResponder handles the response to the UpdateApplicationSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateApplicationSettingsSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAuthSettings description for Updates the Authentication / Authorization settings associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// siteAuthSettings - auth settings associated with web app. +func (client AppsClient) UpdateAuthSettings(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings) (result SiteAuthSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateAuthSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateAuthSettings", err.Error()) + } + + req, err := client.UpdateAuthSettingsPreparer(ctx, resourceGroupName, name, siteAuthSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettings", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAuthSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettings", resp, "Failure sending request") + return + } + + result, err = client.UpdateAuthSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettings", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAuthSettingsPreparer prepares the UpdateAuthSettings request. +func (client AppsClient) UpdateAuthSettingsPreparer(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettings", pathParameters), + autorest.WithJSON(siteAuthSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAuthSettingsSender sends the UpdateAuthSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateAuthSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAuthSettingsResponder handles the response to the UpdateAuthSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateAuthSettingsResponder(resp *http.Response) (result SiteAuthSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAuthSettingsSlot description for Updates the Authentication / Authorization settings associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// siteAuthSettings - auth settings associated with web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) UpdateAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, slot string) (result SiteAuthSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateAuthSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateAuthSettingsSlot", err.Error()) + } + + req, err := client.UpdateAuthSettingsSlotPreparer(ctx, resourceGroupName, name, siteAuthSettings, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAuthSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateAuthSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAuthSettingsSlotPreparer prepares the UpdateAuthSettingsSlot request. +func (client AppsClient) UpdateAuthSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteAuthSettings SiteAuthSettings, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettings", pathParameters), + autorest.WithJSON(siteAuthSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAuthSettingsSlotSender sends the UpdateAuthSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateAuthSettingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAuthSettingsSlotResponder handles the response to the UpdateAuthSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateAuthSettingsSlotResponder(resp *http.Response) (result SiteAuthSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAuthSettingsV2 description for Updates site's Authentication / Authorization settings for apps via the V2 +// format +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// siteAuthSettingsV2 - auth settings associated with web app. +func (client AppsClient) UpdateAuthSettingsV2(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 SiteAuthSettingsV2) (result SiteAuthSettingsV2, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateAuthSettingsV2") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateAuthSettingsV2", err.Error()) + } + + req, err := client.UpdateAuthSettingsV2Preparer(ctx, resourceGroupName, name, siteAuthSettingsV2) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsV2", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAuthSettingsV2Sender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsV2", resp, "Failure sending request") + return + } + + result, err = client.UpdateAuthSettingsV2Responder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsV2", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAuthSettingsV2Preparer prepares the UpdateAuthSettingsV2 request. +func (client AppsClient) UpdateAuthSettingsV2Preparer(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 SiteAuthSettingsV2) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/authsettingsV2", pathParameters), + autorest.WithJSON(siteAuthSettingsV2), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAuthSettingsV2Sender sends the UpdateAuthSettingsV2 request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateAuthSettingsV2Sender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAuthSettingsV2Responder handles the response to the UpdateAuthSettingsV2 request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateAuthSettingsV2Responder(resp *http.Response) (result SiteAuthSettingsV2, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAuthSettingsV2Slot description for Updates site's Authentication / Authorization settings for apps via the V2 +// format +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// siteAuthSettingsV2 - auth settings associated with web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) UpdateAuthSettingsV2Slot(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 SiteAuthSettingsV2, slot string) (result SiteAuthSettingsV2, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateAuthSettingsV2Slot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateAuthSettingsV2Slot", err.Error()) + } + + req, err := client.UpdateAuthSettingsV2SlotPreparer(ctx, resourceGroupName, name, siteAuthSettingsV2, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsV2Slot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAuthSettingsV2SlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsV2Slot", resp, "Failure sending request") + return + } + + result, err = client.UpdateAuthSettingsV2SlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAuthSettingsV2Slot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAuthSettingsV2SlotPreparer prepares the UpdateAuthSettingsV2Slot request. +func (client AppsClient) UpdateAuthSettingsV2SlotPreparer(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 SiteAuthSettingsV2, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/authsettingsV2", pathParameters), + autorest.WithJSON(siteAuthSettingsV2), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAuthSettingsV2SlotSender sends the UpdateAuthSettingsV2Slot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateAuthSettingsV2SlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAuthSettingsV2SlotResponder handles the response to the UpdateAuthSettingsV2Slot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateAuthSettingsV2SlotResponder(resp *http.Response) (result SiteAuthSettingsV2, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAzureStorageAccounts description for Updates the Azure storage account configurations of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// azureStorageAccounts - azure storage accounts of the app. +func (client AppsClient) UpdateAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts AzureStoragePropertyDictionaryResource) (result AzureStoragePropertyDictionaryResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateAzureStorageAccounts") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateAzureStorageAccounts", err.Error()) + } + + req, err := client.UpdateAzureStorageAccountsPreparer(ctx, resourceGroupName, name, azureStorageAccounts) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAzureStorageAccounts", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAzureStorageAccountsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAzureStorageAccounts", resp, "Failure sending request") + return + } + + result, err = client.UpdateAzureStorageAccountsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAzureStorageAccounts", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAzureStorageAccountsPreparer prepares the UpdateAzureStorageAccounts request. +func (client AppsClient) UpdateAzureStorageAccountsPreparer(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts AzureStoragePropertyDictionaryResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/azurestorageaccounts", pathParameters), + autorest.WithJSON(azureStorageAccounts), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAzureStorageAccountsSender sends the UpdateAzureStorageAccounts request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateAzureStorageAccountsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAzureStorageAccountsResponder handles the response to the UpdateAzureStorageAccounts request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateAzureStorageAccountsResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAzureStorageAccountsSlot description for Updates the Azure storage account configurations of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// azureStorageAccounts - azure storage accounts of the app. +// slot - name of the deployment slot. If a slot is not specified, the API will update the Azure storage +// account configurations for the production slot. +func (client AppsClient) UpdateAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts AzureStoragePropertyDictionaryResource, slot string) (result AzureStoragePropertyDictionaryResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateAzureStorageAccountsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateAzureStorageAccountsSlot", err.Error()) + } + + req, err := client.UpdateAzureStorageAccountsSlotPreparer(ctx, resourceGroupName, name, azureStorageAccounts, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAzureStorageAccountsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAzureStorageAccountsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAzureStorageAccountsSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateAzureStorageAccountsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateAzureStorageAccountsSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAzureStorageAccountsSlotPreparer prepares the UpdateAzureStorageAccountsSlot request. +func (client AppsClient) UpdateAzureStorageAccountsSlotPreparer(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts AzureStoragePropertyDictionaryResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/azurestorageaccounts", pathParameters), + autorest.WithJSON(azureStorageAccounts), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAzureStorageAccountsSlotSender sends the UpdateAzureStorageAccountsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateAzureStorageAccountsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAzureStorageAccountsSlotResponder handles the response to the UpdateAzureStorageAccountsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateAzureStorageAccountsSlotResponder(resp *http.Response) (result AzureStoragePropertyDictionaryResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateBackupConfiguration description for Updates the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - edited backup configuration. +func (client AppsClient) UpdateBackupConfiguration(ctx context.Context, resourceGroupName string, name string, request BackupRequest) (result BackupRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateBackupConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateBackupConfiguration", err.Error()) + } + + req, err := client.UpdateBackupConfigurationPreparer(ctx, resourceGroupName, name, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateBackupConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateBackupConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateBackupConfiguration", resp, "Failure sending request") + return + } + + result, err = client.UpdateBackupConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateBackupConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// UpdateBackupConfigurationPreparer prepares the UpdateBackupConfiguration request. +func (client AppsClient) UpdateBackupConfigurationPreparer(ctx context.Context, resourceGroupName string, name string, request BackupRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/backup", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateBackupConfigurationSender sends the UpdateBackupConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateBackupConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateBackupConfigurationResponder handles the response to the UpdateBackupConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateBackupConfigurationResponder(resp *http.Response) (result BackupRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateBackupConfigurationSlot description for Updates the backup configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// request - edited backup configuration. +// slot - name of the deployment slot. If a slot is not specified, the API will update the backup configuration +// for the production slot. +func (client AppsClient) UpdateBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, request BackupRequest, slot string) (result BackupRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateBackupConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.BackupRequestProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.StorageAccountURL", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "request.BackupRequestProperties.BackupSchedule.FrequencyInterval", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.KeepAtLeastOneBackup", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "request.BackupRequestProperties.BackupSchedule.RetentionPeriodInDays", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateBackupConfigurationSlot", err.Error()) + } + + req, err := client.UpdateBackupConfigurationSlotPreparer(ctx, resourceGroupName, name, request, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateBackupConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateBackupConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateBackupConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateBackupConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateBackupConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateBackupConfigurationSlotPreparer prepares the UpdateBackupConfigurationSlot request. +func (client AppsClient) UpdateBackupConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, request BackupRequest, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/backup", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateBackupConfigurationSlotSender sends the UpdateBackupConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateBackupConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateBackupConfigurationSlotResponder handles the response to the UpdateBackupConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateBackupConfigurationSlotResponder(resp *http.Response) (result BackupRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateConfiguration description for Updates the configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteConfig - JSON representation of a SiteConfig object. See example. +func (client AppsClient) UpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateConfiguration", err.Error()) + } + + req, err := client.UpdateConfigurationPreparer(ctx, resourceGroupName, name, siteConfig) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConfiguration", resp, "Failure sending request") + return + } + + result, err = client.UpdateConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// UpdateConfigurationPreparer prepares the UpdateConfiguration request. +func (client AppsClient) UpdateConfigurationPreparer(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/web", pathParameters), + autorest.WithJSON(siteConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateConfigurationSender sends the UpdateConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateConfigurationResponder handles the response to the UpdateConfiguration request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateConfigurationResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateConfigurationSlot description for Updates the configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteConfig - JSON representation of a SiteConfig object. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update configuration for the +// production slot. +func (client AppsClient) UpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, slot string) (result SiteConfigResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateConfigurationSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateConfigurationSlot", err.Error()) + } + + req, err := client.UpdateConfigurationSlotPreparer(ctx, resourceGroupName, name, siteConfig, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConfigurationSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateConfigurationSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConfigurationSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateConfigurationSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConfigurationSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateConfigurationSlotPreparer prepares the UpdateConfigurationSlot request. +func (client AppsClient) UpdateConfigurationSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteConfig SiteConfigResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/web", pathParameters), + autorest.WithJSON(siteConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateConfigurationSlotSender sends the UpdateConfigurationSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateConfigurationSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateConfigurationSlotResponder handles the response to the UpdateConfigurationSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateConfigurationSlotResponder(resp *http.Response) (result SiteConfigResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateConnectionStrings description for Replaces the connection strings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// connectionStrings - connection strings of the app or deployment slot. See example. +func (client AppsClient) UpdateConnectionStrings(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary) (result ConnectionStringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateConnectionStrings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateConnectionStrings", err.Error()) + } + + req, err := client.UpdateConnectionStringsPreparer(ctx, resourceGroupName, name, connectionStrings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConnectionStrings", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateConnectionStringsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConnectionStrings", resp, "Failure sending request") + return + } + + result, err = client.UpdateConnectionStringsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConnectionStrings", resp, "Failure responding to request") + return + } + + return +} + +// UpdateConnectionStringsPreparer prepares the UpdateConnectionStrings request. +func (client AppsClient) UpdateConnectionStringsPreparer(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/connectionstrings", pathParameters), + autorest.WithJSON(connectionStrings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateConnectionStringsSender sends the UpdateConnectionStrings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateConnectionStringsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateConnectionStringsResponder handles the response to the UpdateConnectionStrings request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateConnectionStringsResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateConnectionStringsSlot description for Replaces the connection strings of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// connectionStrings - connection strings of the app or deployment slot. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update the connection settings +// for the production slot. +func (client AppsClient) UpdateConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, slot string) (result ConnectionStringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateConnectionStringsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateConnectionStringsSlot", err.Error()) + } + + req, err := client.UpdateConnectionStringsSlotPreparer(ctx, resourceGroupName, name, connectionStrings, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConnectionStringsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateConnectionStringsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConnectionStringsSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateConnectionStringsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateConnectionStringsSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateConnectionStringsSlotPreparer prepares the UpdateConnectionStringsSlot request. +func (client AppsClient) UpdateConnectionStringsSlotPreparer(ctx context.Context, resourceGroupName string, name string, connectionStrings ConnectionStringDictionary, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/connectionstrings", pathParameters), + autorest.WithJSON(connectionStrings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateConnectionStringsSlotSender sends the UpdateConnectionStringsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateConnectionStringsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateConnectionStringsSlotResponder handles the response to the UpdateConnectionStringsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateConnectionStringsSlotResponder(resp *http.Response) (result ConnectionStringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateDiagnosticLogsConfig description for Updates the logging configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteLogsConfig - a SiteLogsConfig JSON object that contains the logging configuration to change in the +// "properties" property. +func (client AppsClient) UpdateDiagnosticLogsConfig(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig) (result SiteLogsConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateDiagnosticLogsConfig") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteLogsConfig, + Constraints: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.ApplicationLogs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.ApplicationLogs.AzureTableStorage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.ApplicationLogs.AzureTableStorage.SasURL", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMinimum, Rule: int64(25), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateDiagnosticLogsConfig", err.Error()) + } + + req, err := client.UpdateDiagnosticLogsConfigPreparer(ctx, resourceGroupName, name, siteLogsConfig) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDiagnosticLogsConfig", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateDiagnosticLogsConfigSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDiagnosticLogsConfig", resp, "Failure sending request") + return + } + + result, err = client.UpdateDiagnosticLogsConfigResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDiagnosticLogsConfig", resp, "Failure responding to request") + return + } + + return +} + +// UpdateDiagnosticLogsConfigPreparer prepares the UpdateDiagnosticLogsConfig request. +func (client AppsClient) UpdateDiagnosticLogsConfigPreparer(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/logs", pathParameters), + autorest.WithJSON(siteLogsConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateDiagnosticLogsConfigSender sends the UpdateDiagnosticLogsConfig request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateDiagnosticLogsConfigSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateDiagnosticLogsConfigResponder handles the response to the UpdateDiagnosticLogsConfig request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateDiagnosticLogsConfigResponder(resp *http.Response) (result SiteLogsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateDiagnosticLogsConfigSlot description for Updates the logging configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteLogsConfig - a SiteLogsConfig JSON object that contains the logging configuration to change in the +// "properties" property. +// slot - name of the deployment slot. If a slot is not specified, the API will update the logging +// configuration for the production slot. +func (client AppsClient) UpdateDiagnosticLogsConfigSlot(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, slot string) (result SiteLogsConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateDiagnosticLogsConfigSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: siteLogsConfig, + Constraints: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.ApplicationLogs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.ApplicationLogs.AzureTableStorage", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.ApplicationLogs.AzureTableStorage.SasURL", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "siteLogsConfig.SiteLogsConfigProperties.HTTPLogs.FileSystem.RetentionInMb", Name: validation.InclusiveMinimum, Rule: int64(25), Chain: nil}, + }}, + }}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateDiagnosticLogsConfigSlot", err.Error()) + } + + req, err := client.UpdateDiagnosticLogsConfigSlotPreparer(ctx, resourceGroupName, name, siteLogsConfig, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDiagnosticLogsConfigSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateDiagnosticLogsConfigSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDiagnosticLogsConfigSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateDiagnosticLogsConfigSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDiagnosticLogsConfigSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateDiagnosticLogsConfigSlotPreparer prepares the UpdateDiagnosticLogsConfigSlot request. +func (client AppsClient) UpdateDiagnosticLogsConfigSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteLogsConfig SiteLogsConfig, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/logs", pathParameters), + autorest.WithJSON(siteLogsConfig), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateDiagnosticLogsConfigSlotSender sends the UpdateDiagnosticLogsConfigSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateDiagnosticLogsConfigSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateDiagnosticLogsConfigSlotResponder handles the response to the UpdateDiagnosticLogsConfigSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateDiagnosticLogsConfigSlotResponder(resp *http.Response) (result SiteLogsConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateDomainOwnershipIdentifier description for Creates a domain ownership identifier for web app, or updates an +// existing ownership identifier. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// domainOwnershipIdentifier - a JSON representation of the domain ownership properties. +func (client AppsClient) UpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (result Identifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateDomainOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateDomainOwnershipIdentifier", err.Error()) + } + + req, err := client.UpdateDomainOwnershipIdentifierPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateDomainOwnershipIdentifierSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.UpdateDomainOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// UpdateDomainOwnershipIdentifierPreparer prepares the UpdateDomainOwnershipIdentifier request. +func (client AppsClient) UpdateDomainOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithJSON(domainOwnershipIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateDomainOwnershipIdentifierSender sends the UpdateDomainOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateDomainOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateDomainOwnershipIdentifierResponder handles the response to the UpdateDomainOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateDomainOwnershipIdentifierResponder(resp *http.Response) (result Identifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateDomainOwnershipIdentifierSlot description for Creates a domain ownership identifier for web app, or updates an +// existing ownership identifier. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// domainOwnershipIdentifierName - name of domain ownership identifier. +// domainOwnershipIdentifier - a JSON representation of the domain ownership properties. +// slot - name of the deployment slot. If a slot is not specified, the API will delete the binding for the +// production slot. +func (client AppsClient) UpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (result Identifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateDomainOwnershipIdentifierSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateDomainOwnershipIdentifierSlot", err.Error()) + } + + req, err := client.UpdateDomainOwnershipIdentifierSlotPreparer(ctx, resourceGroupName, name, domainOwnershipIdentifierName, domainOwnershipIdentifier, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifierSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateDomainOwnershipIdentifierSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifierSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateDomainOwnershipIdentifierSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateDomainOwnershipIdentifierSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateDomainOwnershipIdentifierSlotPreparer prepares the UpdateDomainOwnershipIdentifierSlot request. +func (client AppsClient) UpdateDomainOwnershipIdentifierSlotPreparer(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier Identifier, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainOwnershipIdentifierName": autorest.Encode("path", domainOwnershipIdentifierName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/domainOwnershipIdentifiers/{domainOwnershipIdentifierName}", pathParameters), + autorest.WithJSON(domainOwnershipIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateDomainOwnershipIdentifierSlotSender sends the UpdateDomainOwnershipIdentifierSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateDomainOwnershipIdentifierSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateDomainOwnershipIdentifierSlotResponder handles the response to the UpdateDomainOwnershipIdentifierSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateDomainOwnershipIdentifierSlotResponder(resp *http.Response) (result Identifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateFtpAllowed description for Updates whether FTP is allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) UpdateFtpAllowed(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateFtpAllowed") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: csmPublishingAccessPoliciesEntity, + Constraints: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties.Allow", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateFtpAllowed", err.Error()) + } + + req, err := client.UpdateFtpAllowedPreparer(ctx, resourceGroupName, name, csmPublishingAccessPoliciesEntity) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateFtpAllowed", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateFtpAllowedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateFtpAllowed", resp, "Failure sending request") + return + } + + result, err = client.UpdateFtpAllowedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateFtpAllowed", resp, "Failure responding to request") + return + } + + return +} + +// UpdateFtpAllowedPreparer prepares the UpdateFtpAllowed request. +func (client AppsClient) UpdateFtpAllowedPreparer(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/ftp", pathParameters), + autorest.WithJSON(csmPublishingAccessPoliciesEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateFtpAllowedSender sends the UpdateFtpAllowed request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateFtpAllowedSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateFtpAllowedResponder handles the response to the UpdateFtpAllowed request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateFtpAllowedResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateFtpAllowedSlot description for Updates whether FTP is allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) UpdateFtpAllowedSlot(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, slot string) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateFtpAllowedSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: csmPublishingAccessPoliciesEntity, + Constraints: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties.Allow", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateFtpAllowedSlot", err.Error()) + } + + req, err := client.UpdateFtpAllowedSlotPreparer(ctx, resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateFtpAllowedSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateFtpAllowedSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateFtpAllowedSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateFtpAllowedSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateFtpAllowedSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateFtpAllowedSlotPreparer prepares the UpdateFtpAllowedSlot request. +func (client AppsClient) UpdateFtpAllowedSlotPreparer(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/ftp", pathParameters), + autorest.WithJSON(csmPublishingAccessPoliciesEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateFtpAllowedSlotSender sends the UpdateFtpAllowedSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateFtpAllowedSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateFtpAllowedSlotResponder handles the response to the UpdateFtpAllowedSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateFtpAllowedSlotResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateHybridConnection description for Creates a new Hybrid Connection using a Service Bus relay. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// connectionEnvelope - the details of the hybrid connection. +func (client AppsClient) UpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateHybridConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateHybridConnection", err.Error()) + } + + req, err := client.UpdateHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateHybridConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateHybridConnection", resp, "Failure sending request") + return + } + + result, err = client.UpdateHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateHybridConnection", resp, "Failure responding to request") + return + } + + return +} + +// UpdateHybridConnectionPreparer prepares the UpdateHybridConnection request. +func (client AppsClient) UpdateHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateHybridConnectionSender sends the UpdateHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateHybridConnectionResponder handles the response to the UpdateHybridConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateHybridConnectionSlot description for Creates a new Hybrid Connection using a Service Bus relay. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - the name of the web app. +// namespaceName - the namespace for this hybrid connection. +// relayName - the relay name for this hybrid connection. +// connectionEnvelope - the details of the hybrid connection. +// slot - the name of the slot for the web app. +func (client AppsClient) UpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateHybridConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateHybridConnectionSlot", err.Error()) + } + + req, err := client.UpdateHybridConnectionSlotPreparer(ctx, resourceGroupName, name, namespaceName, relayName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateHybridConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateHybridConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateHybridConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateHybridConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateHybridConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateHybridConnectionSlotPreparer prepares the UpdateHybridConnectionSlot request. +func (client AppsClient) UpdateHybridConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope HybridConnection, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateHybridConnectionSlotSender sends the UpdateHybridConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateHybridConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateHybridConnectionSlotResponder handles the response to the UpdateHybridConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateHybridConnectionSlotResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMetadata description for Replaces the metadata of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// metadata - edited metadata of the app or deployment slot. See example. +func (client AppsClient) UpdateMetadata(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateMetadata") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateMetadata", err.Error()) + } + + req, err := client.UpdateMetadataPreparer(ctx, resourceGroupName, name, metadata) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateMetadata", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateMetadataSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateMetadata", resp, "Failure sending request") + return + } + + result, err = client.UpdateMetadataResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateMetadata", resp, "Failure responding to request") + return + } + + return +} + +// UpdateMetadataPreparer prepares the UpdateMetadata request. +func (client AppsClient) UpdateMetadataPreparer(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/metadata", pathParameters), + autorest.WithJSON(metadata), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMetadataSender sends the UpdateMetadata request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateMetadataSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateMetadataResponder handles the response to the UpdateMetadata request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateMetadataResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMetadataSlot description for Replaces the metadata of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// metadata - edited metadata of the app or deployment slot. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update the metadata for the +// production slot. +func (client AppsClient) UpdateMetadataSlot(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary, slot string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateMetadataSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateMetadataSlot", err.Error()) + } + + req, err := client.UpdateMetadataSlotPreparer(ctx, resourceGroupName, name, metadata, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateMetadataSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateMetadataSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateMetadataSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateMetadataSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateMetadataSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateMetadataSlotPreparer prepares the UpdateMetadataSlot request. +func (client AppsClient) UpdateMetadataSlotPreparer(ctx context.Context, resourceGroupName string, name string, metadata StringDictionary, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/metadata", pathParameters), + autorest.WithJSON(metadata), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMetadataSlotSender sends the UpdateMetadataSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateMetadataSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateMetadataSlotResponder handles the response to the UpdateMetadataSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateMetadataSlotResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdatePremierAddOn description for Updates a named add-on of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +// premierAddOn - a JSON representation of the edited premier add-on. +func (client AppsClient) UpdatePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnPatchResource) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdatePremierAddOn") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdatePremierAddOn", err.Error()) + } + + req, err := client.UpdatePremierAddOnPreparer(ctx, resourceGroupName, name, premierAddOnName, premierAddOn) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdatePremierAddOn", nil, "Failure preparing request") + return + } + + resp, err := client.UpdatePremierAddOnSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdatePremierAddOn", resp, "Failure sending request") + return + } + + result, err = client.UpdatePremierAddOnResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdatePremierAddOn", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePremierAddOnPreparer prepares the UpdatePremierAddOn request. +func (client AppsClient) UpdatePremierAddOnPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithJSON(premierAddOn), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdatePremierAddOnSender sends the UpdatePremierAddOn request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdatePremierAddOnSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdatePremierAddOnResponder handles the response to the UpdatePremierAddOn request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdatePremierAddOnResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdatePremierAddOnSlot description for Updates a named add-on of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// premierAddOnName - add-on name. +// premierAddOn - a JSON representation of the edited premier add-on. +// slot - name of the deployment slot. If a slot is not specified, the API will update the named add-on for the +// production slot. +func (client AppsClient) UpdatePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnPatchResource, slot string) (result PremierAddOn, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdatePremierAddOnSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdatePremierAddOnSlot", err.Error()) + } + + req, err := client.UpdatePremierAddOnSlotPreparer(ctx, resourceGroupName, name, premierAddOnName, premierAddOn, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdatePremierAddOnSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdatePremierAddOnSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdatePremierAddOnSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdatePremierAddOnSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdatePremierAddOnSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePremierAddOnSlotPreparer prepares the UpdatePremierAddOnSlot request. +func (client AppsClient) UpdatePremierAddOnSlotPreparer(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn PremierAddOnPatchResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "premierAddOnName": autorest.Encode("path", premierAddOnName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/premieraddons/{premierAddOnName}", pathParameters), + autorest.WithJSON(premierAddOn), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdatePremierAddOnSlotSender sends the UpdatePremierAddOnSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdatePremierAddOnSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdatePremierAddOnSlotResponder handles the response to the UpdatePremierAddOnSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdatePremierAddOnSlotResponder(resp *http.Response) (result PremierAddOn, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateRelayServiceConnection description for Creates a new hybrid connection configuration (PUT), or updates an +// existing one (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection configuration. +// connectionEnvelope - details of the hybrid connection configuration. +func (client AppsClient) UpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateRelayServiceConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateRelayServiceConnection", err.Error()) + } + + req, err := client.UpdateRelayServiceConnectionPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateRelayServiceConnection", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateRelayServiceConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateRelayServiceConnection", resp, "Failure sending request") + return + } + + result, err = client.UpdateRelayServiceConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateRelayServiceConnection", resp, "Failure responding to request") + return + } + + return +} + +// UpdateRelayServiceConnectionPreparer prepares the UpdateRelayServiceConnection request. +func (client AppsClient) UpdateRelayServiceConnectionPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/hybridconnection/{entityName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateRelayServiceConnectionSender sends the UpdateRelayServiceConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateRelayServiceConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateRelayServiceConnectionResponder handles the response to the UpdateRelayServiceConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateRelayServiceConnectionResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateRelayServiceConnectionSlot description for Creates a new hybrid connection configuration (PUT), or updates an +// existing one (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// entityName - name of the hybrid connection configuration. +// connectionEnvelope - details of the hybrid connection configuration. +// slot - name of the deployment slot. If a slot is not specified, the API will create or update a hybrid +// connection for the production slot. +func (client AppsClient) UpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (result RelayServiceConnectionEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateRelayServiceConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateRelayServiceConnectionSlot", err.Error()) + } + + req, err := client.UpdateRelayServiceConnectionSlotPreparer(ctx, resourceGroupName, name, entityName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateRelayServiceConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateRelayServiceConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateRelayServiceConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateRelayServiceConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateRelayServiceConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateRelayServiceConnectionSlotPreparer prepares the UpdateRelayServiceConnectionSlot request. +func (client AppsClient) UpdateRelayServiceConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope RelayServiceConnectionEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "entityName": autorest.Encode("path", entityName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/hybridconnection/{entityName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateRelayServiceConnectionSlotSender sends the UpdateRelayServiceConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateRelayServiceConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateRelayServiceConnectionSlotResponder handles the response to the UpdateRelayServiceConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateRelayServiceConnectionSlotResponder(resp *http.Response) (result RelayServiceConnectionEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateScmAllowed description for Updates whether user publishing credentials are allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) UpdateScmAllowed(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateScmAllowed") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: csmPublishingAccessPoliciesEntity, + Constraints: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties.Allow", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateScmAllowed", err.Error()) + } + + req, err := client.UpdateScmAllowedPreparer(ctx, resourceGroupName, name, csmPublishingAccessPoliciesEntity) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateScmAllowed", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateScmAllowedSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateScmAllowed", resp, "Failure sending request") + return + } + + result, err = client.UpdateScmAllowedResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateScmAllowed", resp, "Failure responding to request") + return + } + + return +} + +// UpdateScmAllowedPreparer prepares the UpdateScmAllowed request. +func (client AppsClient) UpdateScmAllowedPreparer(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/basicPublishingCredentialsPolicies/scm", pathParameters), + autorest.WithJSON(csmPublishingAccessPoliciesEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateScmAllowedSender sends the UpdateScmAllowed request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateScmAllowedSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateScmAllowedResponder handles the response to the UpdateScmAllowed request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateScmAllowedResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateScmAllowedSlot description for Updates whether user publishing credentials are allowed on the site or not. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +func (client AppsClient) UpdateScmAllowedSlot(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, slot string) (result CsmPublishingCredentialsPoliciesEntity, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateScmAllowedSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: csmPublishingAccessPoliciesEntity, + Constraints: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "csmPublishingAccessPoliciesEntity.CsmPublishingCredentialsPoliciesEntityProperties.Allow", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateScmAllowedSlot", err.Error()) + } + + req, err := client.UpdateScmAllowedSlotPreparer(ctx, resourceGroupName, name, csmPublishingAccessPoliciesEntity, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateScmAllowedSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateScmAllowedSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateScmAllowedSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateScmAllowedSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateScmAllowedSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateScmAllowedSlotPreparer prepares the UpdateScmAllowedSlot request. +func (client AppsClient) UpdateScmAllowedSlotPreparer(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity CsmPublishingCredentialsPoliciesEntity, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/basicPublishingCredentialsPolicies/scm", pathParameters), + autorest.WithJSON(csmPublishingAccessPoliciesEntity), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateScmAllowedSlotSender sends the UpdateScmAllowedSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateScmAllowedSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateScmAllowedSlotResponder handles the response to the UpdateScmAllowedSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateScmAllowedSlotResponder(resp *http.Response) (result CsmPublishingCredentialsPoliciesEntity, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSitePushSettings description for Updates the Push settings associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// pushSettings - push settings associated with web app. +func (client AppsClient) UpdateSitePushSettings(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings) (result PushSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSitePushSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: pushSettings, + Constraints: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSitePushSettings", err.Error()) + } + + req, err := client.UpdateSitePushSettingsPreparer(ctx, resourceGroupName, name, pushSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSitePushSettings", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSitePushSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSitePushSettings", resp, "Failure sending request") + return + } + + result, err = client.UpdateSitePushSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSitePushSettings", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSitePushSettingsPreparer prepares the UpdateSitePushSettings request. +func (client AppsClient) UpdateSitePushSettingsPreparer(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/pushsettings", pathParameters), + autorest.WithJSON(pushSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSitePushSettingsSender sends the UpdateSitePushSettings request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSitePushSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSitePushSettingsResponder handles the response to the UpdateSitePushSettings request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSitePushSettingsResponder(resp *http.Response) (result PushSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSitePushSettingsSlot description for Updates the Push settings associated with web app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// pushSettings - push settings associated with web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client AppsClient) UpdateSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings, slot string) (result PushSettings, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSitePushSettingsSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: pushSettings, + Constraints: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "pushSettings.PushSettingsProperties.IsPushEnabled", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSitePushSettingsSlot", err.Error()) + } + + req, err := client.UpdateSitePushSettingsSlotPreparer(ctx, resourceGroupName, name, pushSettings, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSitePushSettingsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSitePushSettingsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSitePushSettingsSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateSitePushSettingsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSitePushSettingsSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSitePushSettingsSlotPreparer prepares the UpdateSitePushSettingsSlot request. +func (client AppsClient) UpdateSitePushSettingsSlotPreparer(ctx context.Context, resourceGroupName string, name string, pushSettings PushSettings, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/config/pushsettings", pathParameters), + autorest.WithJSON(pushSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSitePushSettingsSlotSender sends the UpdateSitePushSettingsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSitePushSettingsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSitePushSettingsSlotResponder handles the response to the UpdateSitePushSettingsSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSitePushSettingsSlotResponder(resp *http.Response) (result PushSettings, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSlot description for Creates a new web, mobile, or API app in an existing resource group, or updates an +// existing app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - unique name of the app to create or update. To create or update a deployment slot, use the {slot} +// parameter. +// siteEnvelope - a JSON representation of the app properties. See example. +// slot - name of the deployment slot to create or update. By default, this API attempts to create or modify +// the production slot. +func (client AppsClient) UpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, slot string) (result Site, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSlot", err.Error()) + } + + req, err := client.UpdateSlotPreparer(ctx, resourceGroupName, name, siteEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSlotPreparer prepares the UpdateSlot request. +func (client AppsClient) UpdateSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteEnvelope SitePatchResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}", pathParameters), + autorest.WithJSON(siteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSlotSender sends the UpdateSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSlotResponder handles the response to the UpdateSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSlotResponder(resp *http.Response) (result Site, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSlotConfigurationNames description for Updates the names of application settings and connection string that +// remain with the slot during swap operation. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// slotConfigNames - names of application settings and connection strings. See example. +func (client AppsClient) UpdateSlotConfigurationNames(ctx context.Context, resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource) (result SlotConfigNamesResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSlotConfigurationNames") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSlotConfigurationNames", err.Error()) + } + + req, err := client.UpdateSlotConfigurationNamesPreparer(ctx, resourceGroupName, name, slotConfigNames) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSlotConfigurationNames", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSlotConfigurationNamesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSlotConfigurationNames", resp, "Failure sending request") + return + } + + result, err = client.UpdateSlotConfigurationNamesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSlotConfigurationNames", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSlotConfigurationNamesPreparer prepares the UpdateSlotConfigurationNames request. +func (client AppsClient) UpdateSlotConfigurationNamesPreparer(ctx context.Context, resourceGroupName string, name string, slotConfigNames SlotConfigNamesResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/config/slotConfigNames", pathParameters), + autorest.WithJSON(slotConfigNames), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSlotConfigurationNamesSender sends the UpdateSlotConfigurationNames request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSlotConfigurationNamesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSlotConfigurationNamesResponder handles the response to the UpdateSlotConfigurationNames request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSlotConfigurationNamesResponder(resp *http.Response) (result SlotConfigNamesResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSourceControl description for Updates the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteSourceControl - JSON representation of a SiteSourceControl object. See example. +func (client AppsClient) UpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (result SiteSourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSourceControl") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSourceControl", err.Error()) + } + + req, err := client.UpdateSourceControlPreparer(ctx, resourceGroupName, name, siteSourceControl) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSourceControl", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSourceControlSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSourceControl", resp, "Failure sending request") + return + } + + result, err = client.UpdateSourceControlResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSourceControl", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSourceControlPreparer prepares the UpdateSourceControl request. +func (client AppsClient) UpdateSourceControlPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/sourcecontrols/web", pathParameters), + autorest.WithJSON(siteSourceControl), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSourceControlSender sends the UpdateSourceControl request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSourceControlSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSourceControlResponder handles the response to the UpdateSourceControl request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSourceControlResponder(resp *http.Response) (result SiteSourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSourceControlSlot description for Updates the source control configuration of an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// siteSourceControl - JSON representation of a SiteSourceControl object. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will update the source control +// configuration for the production slot. +func (client AppsClient) UpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (result SiteSourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSourceControlSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSourceControlSlot", err.Error()) + } + + req, err := client.UpdateSourceControlSlotPreparer(ctx, resourceGroupName, name, siteSourceControl, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSourceControlSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSourceControlSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSourceControlSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateSourceControlSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSourceControlSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSourceControlSlotPreparer prepares the UpdateSourceControlSlot request. +func (client AppsClient) UpdateSourceControlSlotPreparer(ctx context.Context, resourceGroupName string, name string, siteSourceControl SiteSourceControl, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/sourcecontrols/web", pathParameters), + autorest.WithJSON(siteSourceControl), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSourceControlSlotSender sends the UpdateSourceControlSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSourceControlSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSourceControlSlotResponder handles the response to the UpdateSourceControlSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSourceControlSlotResponder(resp *http.Response) (result SiteSourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSwiftVirtualNetworkConnectionWithCheck description for Integrates this Web App with a Virtual Network. This +// requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet has +// already been delegated, and is not +// in use by another App Service Plan other than the one this App is in. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// connectionEnvelope - properties of the Virtual Network connection. See example. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheck(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (result SwiftVirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSwiftVirtualNetworkConnectionWithCheck") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheck", err.Error()) + } + + req, err := client.UpdateSwiftVirtualNetworkConnectionWithCheckPreparer(ctx, resourceGroupName, name, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheck", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSwiftVirtualNetworkConnectionWithCheckSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheck", resp, "Failure sending request") + return + } + + result, err = client.UpdateSwiftVirtualNetworkConnectionWithCheckResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheck", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckPreparer prepares the UpdateSwiftVirtualNetworkConnectionWithCheck request. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/networkConfig/virtualNetwork", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckSender sends the UpdateSwiftVirtualNetworkConnectionWithCheck request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckResponder handles the response to the UpdateSwiftVirtualNetworkConnectionWithCheck request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckSlot description for Integrates this Web App with a Virtual Network. +// This requires that 1) "swiftSupported" is true when doing a GET against this resource, and 2) that the target Subnet +// has already been delegated, and is not +// in use by another App Service Plan other than the one this App is in. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// connectionEnvelope - properties of the Virtual Network connection. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for +// the production slot. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckSlot(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (result SwiftVirtualNetwork, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateSwiftVirtualNetworkConnectionWithCheckSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheckSlot", err.Error()) + } + + req, err := client.UpdateSwiftVirtualNetworkConnectionWithCheckSlotPreparer(ctx, resourceGroupName, name, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheckSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSwiftVirtualNetworkConnectionWithCheckSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheckSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateSwiftVirtualNetworkConnectionWithCheckSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateSwiftVirtualNetworkConnectionWithCheckSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckSlotPreparer prepares the UpdateSwiftVirtualNetworkConnectionWithCheckSlot request. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckSlotPreparer(ctx context.Context, resourceGroupName string, name string, connectionEnvelope SwiftVirtualNetwork, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/networkConfig/virtualNetwork", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckSlotSender sends the UpdateSwiftVirtualNetworkConnectionWithCheckSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateSwiftVirtualNetworkConnectionWithCheckSlotResponder handles the response to the UpdateSwiftVirtualNetworkConnectionWithCheckSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateSwiftVirtualNetworkConnectionWithCheckSlotResponder(resp *http.Response) (result SwiftVirtualNetwork, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateVnetConnection description for Adds a Virtual Network connection to an app or slot (PUT) or updates the +// connection properties (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of an existing Virtual Network. +// connectionEnvelope - properties of the Virtual Network connection. See example. +func (client AppsClient) UpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateVnetConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateVnetConnection", err.Error()) + } + + req, err := client.UpdateVnetConnectionPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnection", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateVnetConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnection", resp, "Failure sending request") + return + } + + result, err = client.UpdateVnetConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnection", resp, "Failure responding to request") + return + } + + return +} + +// UpdateVnetConnectionPreparer prepares the UpdateVnetConnection request. +func (client AppsClient) UpdateVnetConnectionPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateVnetConnectionSender sends the UpdateVnetConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateVnetConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateVnetConnectionResponder handles the response to the UpdateVnetConnection request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateVnetConnectionResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateVnetConnectionGateway description for Adds a gateway to a connected Virtual Network (PUT) or updates it +// (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// connectionEnvelope - the properties to update this gateway with. +func (client AppsClient) UpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateVnetConnectionGateway") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateVnetConnectionGateway", err.Error()) + } + + req, err := client.UpdateVnetConnectionGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionGateway", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateVnetConnectionGatewaySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionGateway", resp, "Failure sending request") + return + } + + result, err = client.UpdateVnetConnectionGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionGateway", resp, "Failure responding to request") + return + } + + return +} + +// UpdateVnetConnectionGatewayPreparer prepares the UpdateVnetConnectionGateway request. +func (client AppsClient) UpdateVnetConnectionGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateVnetConnectionGatewaySender sends the UpdateVnetConnectionGateway request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateVnetConnectionGatewaySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateVnetConnectionGatewayResponder handles the response to the UpdateVnetConnectionGateway request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateVnetConnectionGatewayResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateVnetConnectionGatewaySlot description for Adds a gateway to a connected Virtual Network (PUT) or updates it +// (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Currently, the only supported string is "primary". +// connectionEnvelope - the properties to update this gateway with. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update a gateway for the +// production slot's Virtual Network. +func (client AppsClient) UpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateVnetConnectionGatewaySlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateVnetConnectionGatewaySlot", err.Error()) + } + + req, err := client.UpdateVnetConnectionGatewaySlotPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionGatewaySlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateVnetConnectionGatewaySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionGatewaySlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateVnetConnectionGatewaySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionGatewaySlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateVnetConnectionGatewaySlotPreparer prepares the UpdateVnetConnectionGatewaySlot request. +func (client AppsClient) UpdateVnetConnectionGatewaySlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateVnetConnectionGatewaySlotSender sends the UpdateVnetConnectionGatewaySlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateVnetConnectionGatewaySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateVnetConnectionGatewaySlotResponder handles the response to the UpdateVnetConnectionGatewaySlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateVnetConnectionGatewaySlotResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateVnetConnectionSlot description for Adds a Virtual Network connection to an app or slot (PUT) or updates the +// connection properties (PATCH). +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the app. +// vnetName - name of an existing Virtual Network. +// connectionEnvelope - properties of the Virtual Network connection. See example. +// slot - name of the deployment slot. If a slot is not specified, the API will add or update connections for +// the production slot. +func (client AppsClient) UpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, slot string) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppsClient.UpdateVnetConnectionSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppsClient", "UpdateVnetConnectionSlot", err.Error()) + } + + req, err := client.UpdateVnetConnectionSlotPreparer(ctx, resourceGroupName, name, vnetName, connectionEnvelope, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionSlot", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateVnetConnectionSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionSlot", resp, "Failure sending request") + return + } + + result, err = client.UpdateVnetConnectionSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsClient", "UpdateVnetConnectionSlot", resp, "Failure responding to request") + return + } + + return +} + +// UpdateVnetConnectionSlotPreparer prepares the UpdateVnetConnectionSlot request. +func (client AppsClient) UpdateVnetConnectionSlotPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope VnetInfoResource, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateVnetConnectionSlotSender sends the UpdateVnetConnectionSlot request. The method will close the +// http.Response Body if it receives an error. +func (client AppsClient) UpdateVnetConnectionSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateVnetConnectionSlotResponder handles the response to the UpdateVnetConnectionSlot request. The method always +// closes the http.Response Body. +func (client AppsClient) UpdateVnetConnectionSlotResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/appservicecertificateorders.go b/services/web/mgmt/2021-03-01/web/appservicecertificateorders.go new file mode 100644 index 000000000000..3b852f77db6c --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/appservicecertificateorders.go @@ -0,0 +1,1851 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AppServiceCertificateOrdersClient is the webSite Management Client +type AppServiceCertificateOrdersClient struct { + BaseClient +} + +// NewAppServiceCertificateOrdersClient creates an instance of the AppServiceCertificateOrdersClient client. +func NewAppServiceCertificateOrdersClient(subscriptionID string) AppServiceCertificateOrdersClient { + return NewAppServiceCertificateOrdersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAppServiceCertificateOrdersClientWithBaseURI creates an instance of the AppServiceCertificateOrdersClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewAppServiceCertificateOrdersClientWithBaseURI(baseURI string, subscriptionID string) AppServiceCertificateOrdersClient { + return AppServiceCertificateOrdersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate description for Create or update a certificate purchase order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// certificateDistinguishedName - distinguished name to use for the certificate order. +func (client AppServiceCertificateOrdersClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrder) (result AppServiceCertificateOrdersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AppServiceCertificateOrdersClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrder) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}", pathParameters), + autorest.WithJSON(certificateDistinguishedName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) CreateOrUpdateSender(req *http.Request) (future AppServiceCertificateOrdersCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) CreateOrUpdateResponder(resp *http.Response) (result AppServiceCertificateOrder, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateCertificate description for Creates or updates a certificate and associates with key vault secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// name - name of the certificate. +// keyVaultCertificate - key vault certificate resource Id. +func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificateResource) (result AppServiceCertificateOrdersCreateOrUpdateCertificateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.CreateOrUpdateCertificate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "CreateOrUpdateCertificate", err.Error()) + } + + req, err := client.CreateOrUpdateCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "CreateOrUpdateCertificate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateCertificateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "CreateOrUpdateCertificate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateCertificatePreparer prepares the CreateOrUpdateCertificate request. +func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificatePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificateResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters), + autorest.WithJSON(keyVaultCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateCertificateSender sends the CreateOrUpdateCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificateSender(req *http.Request) (future AppServiceCertificateOrdersCreateOrUpdateCertificateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateCertificateResponder handles the response to the CreateOrUpdateCertificate request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) CreateOrUpdateCertificateResponder(resp *http.Response) (result AppServiceCertificateResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete an existing certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +func (client AppServiceCertificateOrdersClient) Delete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, certificateOrderName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AppServiceCertificateOrdersClient) DeletePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteCertificate description for Delete the certificate associated with a certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// name - name of the certificate. +func (client AppServiceCertificateOrdersClient) DeleteCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.DeleteCertificate") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "DeleteCertificate", err.Error()) + } + + req, err := client.DeleteCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "DeleteCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteCertificateSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "DeleteCertificate", resp, "Failure sending request") + return + } + + result, err = client.DeleteCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "DeleteCertificate", resp, "Failure responding to request") + return + } + + return +} + +// DeleteCertificatePreparer prepares the DeleteCertificate request. +func (client AppServiceCertificateOrdersClient) DeleteCertificatePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteCertificateSender sends the DeleteCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) DeleteCertificateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteCertificateResponder handles the response to the DeleteCertificate request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) DeleteCertificateResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get description for Get a certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order.. +func (client AppServiceCertificateOrdersClient) Get(ctx context.Context, resourceGroupName string, certificateOrderName string) (result AppServiceCertificateOrder, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, certificateOrderName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AppServiceCertificateOrdersClient) GetPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) GetResponder(resp *http.Response) (result AppServiceCertificateOrder, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCertificate description for Get the certificate associated with a certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// name - name of the certificate. +func (client AppServiceCertificateOrdersClient) GetCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (result AppServiceCertificateResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.GetCertificate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "GetCertificate", err.Error()) + } + + req, err := client.GetCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "GetCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.GetCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "GetCertificate", resp, "Failure sending request") + return + } + + result, err = client.GetCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "GetCertificate", resp, "Failure responding to request") + return + } + + return +} + +// GetCertificatePreparer prepares the GetCertificate request. +func (client AppServiceCertificateOrdersClient) GetCertificatePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCertificateSender sends the GetCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) GetCertificateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCertificateResponder handles the response to the GetCertificate request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) GetCertificateResponder(resp *http.Response) (result AppServiceCertificateResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for List all certificate orders in a subscription. +func (client AppServiceCertificateOrdersClient) List(ctx context.Context) (result AppServiceCertificateOrderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.List") + defer func() { + sc := -1 + if result.ascoc.Response.Response != nil { + sc = result.ascoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ascoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "List", resp, "Failure sending request") + return + } + + result.ascoc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "List", resp, "Failure responding to request") + return + } + if result.ascoc.hasNextLink() && result.ascoc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AppServiceCertificateOrdersClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/certificateOrders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ListResponder(resp *http.Response) (result AppServiceCertificateOrderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AppServiceCertificateOrdersClient) listNextResults(ctx context.Context, lastResults AppServiceCertificateOrderCollection) (result AppServiceCertificateOrderCollection, err error) { + req, err := lastResults.appServiceCertificateOrderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceCertificateOrdersClient) ListComplete(ctx context.Context) (result AppServiceCertificateOrderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup description for Get certificate orders in a resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client AppServiceCertificateOrdersClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppServiceCertificateOrderCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ascoc.Response.Response != nil { + sc = result.ascoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ascoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ascoc, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ascoc.hasNextLink() && result.ascoc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AppServiceCertificateOrdersClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ListByResourceGroupResponder(resp *http.Response) (result AppServiceCertificateOrderCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AppServiceCertificateOrdersClient) listByResourceGroupNextResults(ctx context.Context, lastResults AppServiceCertificateOrderCollection) (result AppServiceCertificateOrderCollection, err error) { + req, err := lastResults.appServiceCertificateOrderCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceCertificateOrdersClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AppServiceCertificateOrderCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListCertificates description for List all certificates associated with a certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +func (client AppServiceCertificateOrdersClient) ListCertificates(ctx context.Context, resourceGroupName string, certificateOrderName string) (result AppServiceCertificateCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ListCertificates") + defer func() { + sc := -1 + if result.ascc.Response.Response != nil { + sc = result.ascc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ListCertificates", err.Error()) + } + + result.fn = client.listCertificatesNextResults + req, err := client.ListCertificatesPreparer(ctx, resourceGroupName, certificateOrderName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ListCertificates", nil, "Failure preparing request") + return + } + + resp, err := client.ListCertificatesSender(req) + if err != nil { + result.ascc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ListCertificates", resp, "Failure sending request") + return + } + + result.ascc, err = client.ListCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ListCertificates", resp, "Failure responding to request") + return + } + if result.ascc.hasNextLink() && result.ascc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListCertificatesPreparer prepares the ListCertificates request. +func (client AppServiceCertificateOrdersClient) ListCertificatesPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCertificatesSender sends the ListCertificates request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ListCertificatesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCertificatesResponder handles the response to the ListCertificates request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ListCertificatesResponder(resp *http.Response) (result AppServiceCertificateCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCertificatesNextResults retrieves the next set of results, if any. +func (client AppServiceCertificateOrdersClient) listCertificatesNextResults(ctx context.Context, lastResults AppServiceCertificateCollection) (result AppServiceCertificateCollection, err error) { + req, err := lastResults.appServiceCertificateCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listCertificatesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCertificatesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listCertificatesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCertificatesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "listCertificatesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCertificatesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceCertificateOrdersClient) ListCertificatesComplete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result AppServiceCertificateCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ListCertificates") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCertificates(ctx, resourceGroupName, certificateOrderName) + return +} + +// Reissue description for Reissue an existing certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// reissueCertificateOrderRequest - parameters for the reissue. +func (client AppServiceCertificateOrdersClient) Reissue(ctx context.Context, resourceGroupName string, certificateOrderName string, reissueCertificateOrderRequest ReissueCertificateOrderRequest) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.Reissue") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Reissue", err.Error()) + } + + req, err := client.ReissuePreparer(ctx, resourceGroupName, certificateOrderName, reissueCertificateOrderRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Reissue", nil, "Failure preparing request") + return + } + + resp, err := client.ReissueSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Reissue", resp, "Failure sending request") + return + } + + result, err = client.ReissueResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Reissue", resp, "Failure responding to request") + return + } + + return +} + +// ReissuePreparer prepares the Reissue request. +func (client AppServiceCertificateOrdersClient) ReissuePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, reissueCertificateOrderRequest ReissueCertificateOrderRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/reissue", pathParameters), + autorest.WithJSON(reissueCertificateOrderRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReissueSender sends the Reissue request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ReissueSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ReissueResponder handles the response to the Reissue request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ReissueResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Renew description for Renew an existing certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// renewCertificateOrderRequest - renew parameters +func (client AppServiceCertificateOrdersClient) Renew(ctx context.Context, resourceGroupName string, certificateOrderName string, renewCertificateOrderRequest RenewCertificateOrderRequest) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.Renew") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Renew", err.Error()) + } + + req, err := client.RenewPreparer(ctx, resourceGroupName, certificateOrderName, renewCertificateOrderRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Renew", nil, "Failure preparing request") + return + } + + resp, err := client.RenewSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Renew", resp, "Failure sending request") + return + } + + result, err = client.RenewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Renew", resp, "Failure responding to request") + return + } + + return +} + +// RenewPreparer prepares the Renew request. +func (client AppServiceCertificateOrdersClient) RenewPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, renewCertificateOrderRequest RenewCertificateOrderRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/renew", pathParameters), + autorest.WithJSON(renewCertificateOrderRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewSender sends the Renew request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) RenewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RenewResponder handles the response to the Renew request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) RenewResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResendEmail description for Resend certificate email. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +func (client AppServiceCertificateOrdersClient) ResendEmail(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ResendEmail") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ResendEmail", err.Error()) + } + + req, err := client.ResendEmailPreparer(ctx, resourceGroupName, certificateOrderName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ResendEmail", nil, "Failure preparing request") + return + } + + resp, err := client.ResendEmailSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ResendEmail", resp, "Failure sending request") + return + } + + result, err = client.ResendEmailResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ResendEmail", resp, "Failure responding to request") + return + } + + return +} + +// ResendEmailPreparer prepares the ResendEmail request. +func (client AppServiceCertificateOrdersClient) ResendEmailPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendEmail", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResendEmailSender sends the ResendEmail request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ResendEmailSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResendEmailResponder handles the response to the ResendEmail request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ResendEmailResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResendRequestEmails resend domain verification ownership email containing steps on how to verify a domain for a +// given certificate order +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// nameIdentifier - email address +func (client AppServiceCertificateOrdersClient) ResendRequestEmails(ctx context.Context, resourceGroupName string, certificateOrderName string, nameIdentifier NameIdentifier) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ResendRequestEmails") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "ResendRequestEmails", err.Error()) + } + + req, err := client.ResendRequestEmailsPreparer(ctx, resourceGroupName, certificateOrderName, nameIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ResendRequestEmails", nil, "Failure preparing request") + return + } + + resp, err := client.ResendRequestEmailsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ResendRequestEmails", resp, "Failure sending request") + return + } + + result, err = client.ResendRequestEmailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ResendRequestEmails", resp, "Failure responding to request") + return + } + + return +} + +// ResendRequestEmailsPreparer prepares the ResendRequestEmails request. +func (client AppServiceCertificateOrdersClient) ResendRequestEmailsPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, nameIdentifier NameIdentifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/resendRequestEmails", pathParameters), + autorest.WithJSON(nameIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResendRequestEmailsSender sends the ResendRequestEmails request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ResendRequestEmailsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResendRequestEmailsResponder handles the response to the ResendRequestEmails request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ResendRequestEmailsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RetrieveCertificateActions description for Retrieve the list of certificate actions. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the certificate order. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateActions(ctx context.Context, resourceGroupName string, name string) (result ListCertificateOrderAction, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.RetrieveCertificateActions") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "RetrieveCertificateActions", err.Error()) + } + + req, err := client.RetrieveCertificateActionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateActions", nil, "Failure preparing request") + return + } + + resp, err := client.RetrieveCertificateActionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateActions", resp, "Failure sending request") + return + } + + result, err = client.RetrieveCertificateActionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateActions", resp, "Failure responding to request") + return + } + + return +} + +// RetrieveCertificateActionsPreparer prepares the RetrieveCertificateActions request. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateActionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveCertificateActions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RetrieveCertificateActionsSender sends the RetrieveCertificateActions request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateActionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RetrieveCertificateActionsResponder handles the response to the RetrieveCertificateActions request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateActionsResponder(resp *http.Response) (result ListCertificateOrderAction, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RetrieveCertificateEmailHistory description for Retrieve email history. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the certificate order. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistory(ctx context.Context, resourceGroupName string, name string) (result ListCertificateEmail, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.RetrieveCertificateEmailHistory") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "RetrieveCertificateEmailHistory", err.Error()) + } + + req, err := client.RetrieveCertificateEmailHistoryPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateEmailHistory", nil, "Failure preparing request") + return + } + + resp, err := client.RetrieveCertificateEmailHistorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateEmailHistory", resp, "Failure sending request") + return + } + + result, err = client.RetrieveCertificateEmailHistoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveCertificateEmailHistory", resp, "Failure responding to request") + return + } + + return +} + +// RetrieveCertificateEmailHistoryPreparer prepares the RetrieveCertificateEmailHistory request. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistoryPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{name}/retrieveEmailHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RetrieveCertificateEmailHistorySender sends the RetrieveCertificateEmailHistory request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistorySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RetrieveCertificateEmailHistoryResponder handles the response to the RetrieveCertificateEmailHistory request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) RetrieveCertificateEmailHistoryResponder(resp *http.Response) (result ListCertificateEmail, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RetrieveSiteSeal this method is used to obtain the site seal information for an issued certificate. A site seal is a +// graphic that the certificate purchaser can embed on their web site to show their visitors information about their +// SSL certificate. If a web site visitor clicks on the site seal image, a pop-up page is displayed that contains +// detailed information about the SSL certificate. The site seal token is used to link the site seal graphic image to +// the appropriate certificate details pop-up page display when a user clicks on the site seal. The site seal images +// are expected to be static images and hosted by the reseller, to minimize delays for customer page load times. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// siteSealRequest - site seal request. +func (client AppServiceCertificateOrdersClient) RetrieveSiteSeal(ctx context.Context, resourceGroupName string, certificateOrderName string, siteSealRequest SiteSealRequest) (result SiteSeal, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.RetrieveSiteSeal") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "RetrieveSiteSeal", err.Error()) + } + + req, err := client.RetrieveSiteSealPreparer(ctx, resourceGroupName, certificateOrderName, siteSealRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveSiteSeal", nil, "Failure preparing request") + return + } + + resp, err := client.RetrieveSiteSealSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveSiteSeal", resp, "Failure sending request") + return + } + + result, err = client.RetrieveSiteSealResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "RetrieveSiteSeal", resp, "Failure responding to request") + return + } + + return +} + +// RetrieveSiteSealPreparer prepares the RetrieveSiteSeal request. +func (client AppServiceCertificateOrdersClient) RetrieveSiteSealPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, siteSealRequest SiteSealRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/retrieveSiteSeal", pathParameters), + autorest.WithJSON(siteSealRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RetrieveSiteSealSender sends the RetrieveSiteSeal request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) RetrieveSiteSealSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RetrieveSiteSealResponder handles the response to the RetrieveSiteSeal request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) RetrieveSiteSealResponder(resp *http.Response) (result SiteSeal, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update description for Create or update a certificate purchase order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// certificateDistinguishedName - distinguished name to use for the certificate order. +func (client AppServiceCertificateOrdersClient) Update(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrderPatchResource) (result AppServiceCertificateOrder, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, certificateOrderName, certificateDistinguishedName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AppServiceCertificateOrdersClient) UpdatePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName AppServiceCertificateOrderPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}", pathParameters), + autorest.WithJSON(certificateDistinguishedName), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) UpdateResponder(resp *http.Response) (result AppServiceCertificateOrder, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateCertificate description for Creates or updates a certificate and associates with key vault secret. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +// name - name of the certificate. +// keyVaultCertificate - key vault certificate resource Id. +func (client AppServiceCertificateOrdersClient) UpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificatePatchResource) (result AppServiceCertificateResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.UpdateCertificate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "UpdateCertificate", err.Error()) + } + + req, err := client.UpdateCertificatePreparer(ctx, resourceGroupName, certificateOrderName, name, keyVaultCertificate) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "UpdateCertificate", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateCertificateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "UpdateCertificate", resp, "Failure sending request") + return + } + + result, err = client.UpdateCertificateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "UpdateCertificate", resp, "Failure responding to request") + return + } + + return +} + +// UpdateCertificatePreparer prepares the UpdateCertificate request. +func (client AppServiceCertificateOrdersClient) UpdateCertificatePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate AppServiceCertificatePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/certificates/{name}", pathParameters), + autorest.WithJSON(keyVaultCertificate), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateCertificateSender sends the UpdateCertificate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) UpdateCertificateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateCertificateResponder handles the response to the UpdateCertificate request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) UpdateCertificateResponder(resp *http.Response) (result AppServiceCertificateResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidatePurchaseInformation description for Validate information for a certificate order. +// Parameters: +// appServiceCertificateOrder - information for a certificate order. +func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformation(ctx context.Context, appServiceCertificateOrder AppServiceCertificateOrder) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.ValidatePurchaseInformation") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ValidatePurchaseInformationPreparer(ctx, appServiceCertificateOrder) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ValidatePurchaseInformation", nil, "Failure preparing request") + return + } + + resp, err := client.ValidatePurchaseInformationSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ValidatePurchaseInformation", resp, "Failure sending request") + return + } + + result, err = client.ValidatePurchaseInformationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "ValidatePurchaseInformation", resp, "Failure responding to request") + return + } + + return +} + +// ValidatePurchaseInformationPreparer prepares the ValidatePurchaseInformation request. +func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationPreparer(ctx context.Context, appServiceCertificateOrder AppServiceCertificateOrder) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.CertificateRegistration/validateCertificateRegistrationInformation", pathParameters), + autorest.WithJSON(appServiceCertificateOrder), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidatePurchaseInformationSender sends the ValidatePurchaseInformation request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidatePurchaseInformationResponder handles the response to the ValidatePurchaseInformation request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) ValidatePurchaseInformationResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// VerifyDomainOwnership description for Verify domain ownership for this certificate order. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - name of the certificate order. +func (client AppServiceCertificateOrdersClient) VerifyDomainOwnership(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrdersClient.VerifyDomainOwnership") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceCertificateOrdersClient", "VerifyDomainOwnership", err.Error()) + } + + req, err := client.VerifyDomainOwnershipPreparer(ctx, resourceGroupName, certificateOrderName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "VerifyDomainOwnership", nil, "Failure preparing request") + return + } + + resp, err := client.VerifyDomainOwnershipSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "VerifyDomainOwnership", resp, "Failure sending request") + return + } + + result, err = client.VerifyDomainOwnershipResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersClient", "VerifyDomainOwnership", resp, "Failure responding to request") + return + } + + return +} + +// VerifyDomainOwnershipPreparer prepares the VerifyDomainOwnership request. +func (client AppServiceCertificateOrdersClient) VerifyDomainOwnershipPreparer(ctx context.Context, resourceGroupName string, certificateOrderName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/verifyDomainOwnership", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// VerifyDomainOwnershipSender sends the VerifyDomainOwnership request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceCertificateOrdersClient) VerifyDomainOwnershipSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// VerifyDomainOwnershipResponder handles the response to the VerifyDomainOwnership request. The method always +// closes the http.Response Body. +func (client AppServiceCertificateOrdersClient) VerifyDomainOwnershipResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/web/mgmt/2021-03-01/web/appserviceenvironments.go b/services/web/mgmt/2021-03-01/web/appserviceenvironments.go new file mode 100644 index 000000000000..1c51249c605d --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/appserviceenvironments.go @@ -0,0 +1,4656 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AppServiceEnvironmentsClient is the webSite Management Client +type AppServiceEnvironmentsClient struct { + BaseClient +} + +// NewAppServiceEnvironmentsClient creates an instance of the AppServiceEnvironmentsClient client. +func NewAppServiceEnvironmentsClient(subscriptionID string) AppServiceEnvironmentsClient { + return NewAppServiceEnvironmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAppServiceEnvironmentsClientWithBaseURI creates an instance of the AppServiceEnvironmentsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewAppServiceEnvironmentsClientWithBaseURI(baseURI string, subscriptionID string) AppServiceEnvironmentsClient { + return AppServiceEnvironmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ApproveOrRejectPrivateEndpointConnection description for Approves or rejects a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (result AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ApproveOrRejectPrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ApproveOrRejectPrivateEndpointConnection", err.Error()) + } + + req, err := client.ApproveOrRejectPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ApproveOrRejectPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.ApproveOrRejectPrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ApproveOrRejectPrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// ApproveOrRejectPrivateEndpointConnectionPreparer prepares the ApproveOrRejectPrivateEndpointConnection request. +func (client AppServiceEnvironmentsClient) ApproveOrRejectPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointWrapper), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApproveOrRejectPrivateEndpointConnectionSender sends the ApproveOrRejectPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ApproveOrRejectPrivateEndpointConnectionSender(req *http.Request) (future AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApproveOrRejectPrivateEndpointConnectionResponder handles the response to the ApproveOrRejectPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ApproveOrRejectPrivateEndpointConnectionResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ChangeVnet description for Move an App Service Environment to a different VNET. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// vnetInfo - details for the new virtual network. +func (client AppServiceEnvironmentsClient) ChangeVnet(ctx context.Context, resourceGroupName string, name string, vnetInfo VirtualNetworkProfile) (result AppServiceEnvironmentsChangeVnetFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ChangeVnet") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: vnetInfo, + Constraints: []validation.Constraint{{Target: "vnetInfo.ID", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ChangeVnet", err.Error()) + } + + req, err := client.ChangeVnetPreparer(ctx, resourceGroupName, name, vnetInfo) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ChangeVnet", nil, "Failure preparing request") + return + } + + result, err = client.ChangeVnetSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ChangeVnet", result.Response(), "Failure sending request") + return + } + + return +} + +// ChangeVnetPreparer prepares the ChangeVnet request. +func (client AppServiceEnvironmentsClient) ChangeVnetPreparer(ctx context.Context, resourceGroupName string, name string, vnetInfo VirtualNetworkProfile) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + vnetInfo.Name = nil + vnetInfo.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/changeVirtualNetwork", pathParameters), + autorest.WithJSON(vnetInfo), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ChangeVnetSender sends the ChangeVnet request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ChangeVnetSender(req *http.Request) (future AppServiceEnvironmentsChangeVnetFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ChangeVnetResponder handles the response to the ChangeVnet request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ChangeVnetResponder(resp *http.Response) (result AppCollectionPage, err error) { + result.ac, err = client.changeVnetResponder(resp) + result.fn = client.changeVnetNextResults + return +} + +func (client AppServiceEnvironmentsClient) changeVnetResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// changeVnetNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) changeVnetNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "changeVnetNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "changeVnetNextResults", resp, "Failure sending next results request") + } + return client.changeVnetResponder(resp) +} + +// ChangeVnetComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ChangeVnetComplete(ctx context.Context, resourceGroupName string, name string, vnetInfo VirtualNetworkProfile) (result AppServiceEnvironmentsChangeVnetAllFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ChangeVnet") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + var future AppServiceEnvironmentsChangeVnetFuture + future, err = client.ChangeVnet(ctx, resourceGroupName, name, vnetInfo) + result.FutureAPI = future.FutureAPI + return +} + +// CreateOrUpdate description for Create or update an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// hostingEnvironmentEnvelope - configuration details of the App Service Environment. +func (client AppServiceEnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentResource) (result AppServiceEnvironmentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: hostingEnvironmentEnvelope, + Constraints: []validation.Constraint{{Target: "hostingEnvironmentEnvelope.AppServiceEnvironment", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "hostingEnvironmentEnvelope.AppServiceEnvironment.VirtualNetwork", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "hostingEnvironmentEnvelope.AppServiceEnvironment.VirtualNetwork.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, hostingEnvironmentEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AppServiceEnvironmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters), + autorest.WithJSON(hostingEnvironmentEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) CreateOrUpdateSender(req *http.Request) (future AppServiceEnvironmentsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) CreateOrUpdateResponder(resp *http.Response) (result AppServiceEnvironmentResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateMultiRolePool description for Create or update a multi-role pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// multiRolePoolEnvelope - properties of the multi-role pool. +func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource) (result AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.CreateOrUpdateMultiRolePool") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "CreateOrUpdateMultiRolePool", err.Error()) + } + + req, err := client.CreateOrUpdateMultiRolePoolPreparer(ctx, resourceGroupName, name, multiRolePoolEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdateMultiRolePool", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateMultiRolePoolSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdateMultiRolePool", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateMultiRolePoolPreparer prepares the CreateOrUpdateMultiRolePool request. +func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePoolPreparer(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters), + autorest.WithJSON(multiRolePoolEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateMultiRolePoolSender sends the CreateOrUpdateMultiRolePool request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePoolSender(req *http.Request) (future AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateMultiRolePoolResponder handles the response to the CreateOrUpdateMultiRolePool request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) CreateOrUpdateMultiRolePoolResponder(resp *http.Response) (result WorkerPoolResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateWorkerPool description for Create or update a worker pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +// workerPoolEnvelope - properties of the worker pool. +func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource) (result AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.CreateOrUpdateWorkerPool") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "CreateOrUpdateWorkerPool", err.Error()) + } + + req, err := client.CreateOrUpdateWorkerPoolPreparer(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdateWorkerPool", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateWorkerPoolSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "CreateOrUpdateWorkerPool", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateWorkerPoolPreparer prepares the CreateOrUpdateWorkerPool request. +func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPoolPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters), + autorest.WithJSON(workerPoolEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateWorkerPoolSender sends the CreateOrUpdateWorkerPool request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPoolSender(req *http.Request) (future AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateWorkerPoolResponder handles the response to the CreateOrUpdateWorkerPool request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) CreateOrUpdateWorkerPoolResponder(resp *http.Response) (result WorkerPoolResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// forceDelete - specify true to force the deletion even if the App Service Environment contains +// resources. The default is false. +func (client AppServiceEnvironmentsClient) Delete(ctx context.Context, resourceGroupName string, name string, forceDelete *bool) (result AppServiceEnvironmentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name, forceDelete) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AppServiceEnvironmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string, forceDelete *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceDelete != nil { + queryParameters["forceDelete"] = autorest.Encode("query", *forceDelete) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) DeleteSender(req *http.Request) (future AppServiceEnvironmentsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePrivateEndpointConnection description for Deletes a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.DeletePrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "DeletePrivateEndpointConnection", err.Error()) + } + + req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.DeletePrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "DeletePrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. +func (client AppServiceEnvironmentsClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get description for Get the properties of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) Get(ctx context.Context, resourceGroupName string, name string) (result AppServiceEnvironmentResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AppServiceEnvironmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetResponder(resp *http.Response) (result AppServiceEnvironmentResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetAseV3NetworkingConfiguration description for Get networking configuration of an App Service Environment +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetAseV3NetworkingConfiguration(ctx context.Context, resourceGroupName string, name string) (result AseV3NetworkingConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetAseV3NetworkingConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetAseV3NetworkingConfiguration", err.Error()) + } + + req, err := client.GetAseV3NetworkingConfigurationPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetAseV3NetworkingConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.GetAseV3NetworkingConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetAseV3NetworkingConfiguration", resp, "Failure sending request") + return + } + + result, err = client.GetAseV3NetworkingConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetAseV3NetworkingConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// GetAseV3NetworkingConfigurationPreparer prepares the GetAseV3NetworkingConfiguration request. +func (client AppServiceEnvironmentsClient) GetAseV3NetworkingConfigurationPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAseV3NetworkingConfigurationSender sends the GetAseV3NetworkingConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetAseV3NetworkingConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAseV3NetworkingConfigurationResponder handles the response to the GetAseV3NetworkingConfiguration request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetAseV3NetworkingConfigurationResponder(resp *http.Response) (result AseV3NetworkingConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDiagnosticsItem description for Get a diagnostics item for an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// diagnosticsName - name of the diagnostics item. +func (client AppServiceEnvironmentsClient) GetDiagnosticsItem(ctx context.Context, resourceGroupName string, name string, diagnosticsName string) (result HostingEnvironmentDiagnostics, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetDiagnosticsItem") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetDiagnosticsItem", err.Error()) + } + + req, err := client.GetDiagnosticsItemPreparer(ctx, resourceGroupName, name, diagnosticsName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetDiagnosticsItem", nil, "Failure preparing request") + return + } + + resp, err := client.GetDiagnosticsItemSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetDiagnosticsItem", resp, "Failure sending request") + return + } + + result, err = client.GetDiagnosticsItemResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetDiagnosticsItem", resp, "Failure responding to request") + return + } + + return +} + +// GetDiagnosticsItemPreparer prepares the GetDiagnosticsItem request. +func (client AppServiceEnvironmentsClient) GetDiagnosticsItemPreparer(ctx context.Context, resourceGroupName string, name string, diagnosticsName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticsName": autorest.Encode("path", diagnosticsName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics/{diagnosticsName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDiagnosticsItemSender sends the GetDiagnosticsItem request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetDiagnosticsItemSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDiagnosticsItemResponder handles the response to the GetDiagnosticsItem request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetDiagnosticsItemResponder(resp *http.Response) (result HostingEnvironmentDiagnostics, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetInboundNetworkDependenciesEndpoints description for Get the network endpoints of all inbound dependencies of an +// App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result InboundEnvironmentEndpointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.ieec.Response.Response != nil { + sc = result.ieec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", err.Error()) + } + + result.fn = client.getInboundNetworkDependenciesEndpointsNextResults + req, err := client.GetInboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.ieec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result.ieec, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetInboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + if result.ieec.hasNextLink() && result.ieec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetInboundNetworkDependenciesEndpointsPreparer prepares the GetInboundNetworkDependenciesEndpoints request. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/inboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetInboundNetworkDependenciesEndpointsSender sends the GetInboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetInboundNetworkDependenciesEndpointsResponder handles the response to the GetInboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result InboundEnvironmentEndpointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getInboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getInboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults InboundEnvironmentEndpointCollection) (result InboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.inboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetInboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetInboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getInboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetInboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetInboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result InboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetInboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetInboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + +// GetMultiRolePool description for Get properties of a multi-role pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetMultiRolePool(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetMultiRolePool") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetMultiRolePool", err.Error()) + } + + req, err := client.GetMultiRolePoolPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetMultiRolePool", nil, "Failure preparing request") + return + } + + resp, err := client.GetMultiRolePoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetMultiRolePool", resp, "Failure sending request") + return + } + + result, err = client.GetMultiRolePoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetMultiRolePool", resp, "Failure responding to request") + return + } + + return +} + +// GetMultiRolePoolPreparer prepares the GetMultiRolePool request. +func (client AppServiceEnvironmentsClient) GetMultiRolePoolPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetMultiRolePoolSender sends the GetMultiRolePool request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetMultiRolePoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetMultiRolePoolResponder handles the response to the GetMultiRolePool request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetMultiRolePoolResponder(resp *http.Response) (result WorkerPoolResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOutboundNetworkDependenciesEndpoints description for Get the network endpoints of all outbound dependencies of an +// App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.oeec.Response.Response != nil { + sc = result.oeec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", err.Error()) + } + + result.fn = client.getOutboundNetworkDependenciesEndpointsNextResults + req, err := client.GetOutboundNetworkDependenciesEndpointsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", nil, "Failure preparing request") + return + } + + resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.oeec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure sending request") + return + } + + result.oeec, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetOutboundNetworkDependenciesEndpoints", resp, "Failure responding to request") + return + } + if result.oeec.hasNextLink() && result.oeec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetOutboundNetworkDependenciesEndpointsPreparer prepares the GetOutboundNetworkDependenciesEndpoints request. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/outboundNetworkDependenciesEndpoints", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOutboundNetworkDependenciesEndpointsSender sends the GetOutboundNetworkDependenciesEndpoints request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOutboundNetworkDependenciesEndpointsResponder handles the response to the GetOutboundNetworkDependenciesEndpoints request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsResponder(resp *http.Response) (result OutboundEnvironmentEndpointCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getOutboundNetworkDependenciesEndpointsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getOutboundNetworkDependenciesEndpointsNextResults(ctx context.Context, lastResults OutboundEnvironmentEndpointCollection) (result OutboundEnvironmentEndpointCollection, err error) { + req, err := lastResults.outboundEnvironmentEndpointCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetOutboundNetworkDependenciesEndpointsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetOutboundNetworkDependenciesEndpointsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getOutboundNetworkDependenciesEndpointsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetOutboundNetworkDependenciesEndpointsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result OutboundEnvironmentEndpointCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetOutboundNetworkDependenciesEndpoints") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetOutboundNetworkDependenciesEndpoints(ctx, resourceGroupName, name) + return +} + +// GetPrivateEndpointConnection description for Gets a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// privateEndpointConnectionName - name of the private endpoint connection. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result RemotePrivateEndpointConnectionARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnection", err.Error()) + } + + req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateEndpointConnectionList description for Gets the list of private endpoints associated with a hosting +// environment +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionList(ctx context.Context, resourceGroupName string, name string) (result PrivateEndpointConnectionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetPrivateEndpointConnectionList") + defer func() { + sc := -1 + if result.pecc.Response.Response != nil { + sc = result.pecc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnectionList", err.Error()) + } + + result.fn = client.getPrivateEndpointConnectionListNextResults + req, err := client.GetPrivateEndpointConnectionListPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnectionList", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionListSender(req) + if err != nil { + result.pecc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnectionList", resp, "Failure sending request") + return + } + + result.pecc, err = client.GetPrivateEndpointConnectionListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateEndpointConnectionList", resp, "Failure responding to request") + return + } + if result.pecc.hasNextLink() && result.pecc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetPrivateEndpointConnectionListPreparer prepares the GetPrivateEndpointConnectionList request. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionListPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionListSender sends the GetPrivateEndpointConnectionList request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionListResponder handles the response to the GetPrivateEndpointConnectionList request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionListResponder(resp *http.Response) (result PrivateEndpointConnectionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getPrivateEndpointConnectionListNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) getPrivateEndpointConnectionListNextResults(ctx context.Context, lastResults PrivateEndpointConnectionCollection) (result PrivateEndpointConnectionCollection, err error) { + req, err := lastResults.privateEndpointConnectionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getPrivateEndpointConnectionListNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetPrivateEndpointConnectionListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getPrivateEndpointConnectionListNextResults", resp, "Failure sending next results request") + } + result, err = client.GetPrivateEndpointConnectionListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "getPrivateEndpointConnectionListNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetPrivateEndpointConnectionListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) GetPrivateEndpointConnectionListComplete(ctx context.Context, resourceGroupName string, name string) (result PrivateEndpointConnectionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetPrivateEndpointConnectionList") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetPrivateEndpointConnectionList(ctx, resourceGroupName, name) + return +} + +// GetPrivateLinkResources description for Gets the private link resources +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result PrivateLinkResourcesWrapper, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetPrivateLinkResources") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetPrivateLinkResources", err.Error()) + } + + req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateLinkResources", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetPrivateLinkResources", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. +func (client AppServiceEnvironmentsClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourcesWrapper, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVipInfo description for Get IP addresses assigned to an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) GetVipInfo(ctx context.Context, resourceGroupName string, name string) (result AddressResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetVipInfo") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetVipInfo", err.Error()) + } + + req, err := client.GetVipInfoPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetVipInfo", nil, "Failure preparing request") + return + } + + resp, err := client.GetVipInfoSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetVipInfo", resp, "Failure sending request") + return + } + + result, err = client.GetVipInfoResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetVipInfo", resp, "Failure responding to request") + return + } + + return +} + +// GetVipInfoPreparer prepares the GetVipInfo request. +func (client AppServiceEnvironmentsClient) GetVipInfoPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/virtualip", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVipInfoSender sends the GetVipInfo request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetVipInfoSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVipInfoResponder handles the response to the GetVipInfo request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetVipInfoResponder(resp *http.Response) (result AddressResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetWorkerPool description for Get properties of a worker pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +func (client AppServiceEnvironmentsClient) GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result WorkerPoolResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.GetWorkerPool") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "GetWorkerPool", err.Error()) + } + + req, err := client.GetWorkerPoolPreparer(ctx, resourceGroupName, name, workerPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetWorkerPool", nil, "Failure preparing request") + return + } + + resp, err := client.GetWorkerPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetWorkerPool", resp, "Failure sending request") + return + } + + result, err = client.GetWorkerPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "GetWorkerPool", resp, "Failure responding to request") + return + } + + return +} + +// GetWorkerPoolPreparer prepares the GetWorkerPool request. +func (client AppServiceEnvironmentsClient) GetWorkerPoolPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWorkerPoolSender sends the GetWorkerPool request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) GetWorkerPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetWorkerPoolResponder handles the response to the GetWorkerPool request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) GetWorkerPoolResponder(resp *http.Response) (result WorkerPoolResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all App Service Environments for a subscription. +func (client AppServiceEnvironmentsClient) List(ctx context.Context) (result AppServiceEnvironmentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.List") + defer func() { + sc := -1 + if result.asec.Response.Response != nil { + sc = result.asec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.asec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "List", resp, "Failure sending request") + return + } + + result.asec, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "List", resp, "Failure responding to request") + return + } + if result.asec.hasNextLink() && result.asec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AppServiceEnvironmentsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/hostingEnvironments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListResponder(resp *http.Response) (result AppServiceEnvironmentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listNextResults(ctx context.Context, lastResults AppServiceEnvironmentCollection) (result AppServiceEnvironmentCollection, err error) { + req, err := lastResults.appServiceEnvironmentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListComplete(ctx context.Context) (result AppServiceEnvironmentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListAppServicePlans description for Get all App Service plans in an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListAppServicePlans(ctx context.Context, resourceGroupName string, name string) (result AppServicePlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListAppServicePlans") + defer func() { + sc := -1 + if result.aspc.Response.Response != nil { + sc = result.aspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListAppServicePlans", err.Error()) + } + + result.fn = client.listAppServicePlansNextResults + req, err := client.ListAppServicePlansPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListAppServicePlans", nil, "Failure preparing request") + return + } + + resp, err := client.ListAppServicePlansSender(req) + if err != nil { + result.aspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListAppServicePlans", resp, "Failure sending request") + return + } + + result.aspc, err = client.ListAppServicePlansResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListAppServicePlans", resp, "Failure responding to request") + return + } + if result.aspc.hasNextLink() && result.aspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAppServicePlansPreparer prepares the ListAppServicePlans request. +func (client AppServiceEnvironmentsClient) ListAppServicePlansPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/serverfarms", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAppServicePlansSender sends the ListAppServicePlans request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListAppServicePlansSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAppServicePlansResponder handles the response to the ListAppServicePlans request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListAppServicePlansResponder(resp *http.Response) (result AppServicePlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAppServicePlansNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listAppServicePlansNextResults(ctx context.Context, lastResults AppServicePlanCollection) (result AppServicePlanCollection, err error) { + req, err := lastResults.appServicePlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listAppServicePlansNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAppServicePlansSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listAppServicePlansNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAppServicePlansResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listAppServicePlansNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAppServicePlansComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListAppServicePlansComplete(ctx context.Context, resourceGroupName string, name string) (result AppServicePlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListAppServicePlans") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAppServicePlans(ctx, resourceGroupName, name) + return +} + +// ListByResourceGroup description for Get all App Service Environments in a resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client AppServiceEnvironmentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppServiceEnvironmentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.asec.Response.Response != nil { + sc = result.asec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.asec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.asec, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.asec.hasNextLink() && result.asec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AppServiceEnvironmentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListByResourceGroupResponder(resp *http.Response) (result AppServiceEnvironmentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults AppServiceEnvironmentCollection) (result AppServiceEnvironmentCollection, err error) { + req, err := lastResults.appServiceEnvironmentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AppServiceEnvironmentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListCapacities description for Get the used, available, and total worker capacity an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListCapacities(ctx context.Context, resourceGroupName string, name string) (result StampCapacityCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListCapacities") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListCapacities", err.Error()) + } + + result.fn = client.listCapacitiesNextResults + req, err := client.ListCapacitiesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListCapacities", nil, "Failure preparing request") + return + } + + resp, err := client.ListCapacitiesSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListCapacities", resp, "Failure sending request") + return + } + + result.scc, err = client.ListCapacitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListCapacities", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListCapacitiesPreparer prepares the ListCapacities request. +func (client AppServiceEnvironmentsClient) ListCapacitiesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/capacities/compute", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCapacitiesSender sends the ListCapacities request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListCapacitiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCapacitiesResponder handles the response to the ListCapacities request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListCapacitiesResponder(resp *http.Response) (result StampCapacityCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCapacitiesNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listCapacitiesNextResults(ctx context.Context, lastResults StampCapacityCollection) (result StampCapacityCollection, err error) { + req, err := lastResults.stampCapacityCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listCapacitiesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCapacitiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listCapacitiesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCapacitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listCapacitiesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCapacitiesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListCapacitiesComplete(ctx context.Context, resourceGroupName string, name string) (result StampCapacityCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListCapacities") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCapacities(ctx, resourceGroupName, name) + return +} + +// ListDiagnostics description for Get diagnostic information for an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListDiagnostics(ctx context.Context, resourceGroupName string, name string) (result ListHostingEnvironmentDiagnostics, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListDiagnostics") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListDiagnostics", err.Error()) + } + + req, err := client.ListDiagnosticsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListDiagnostics", nil, "Failure preparing request") + return + } + + resp, err := client.ListDiagnosticsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListDiagnostics", resp, "Failure sending request") + return + } + + result, err = client.ListDiagnosticsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListDiagnostics", resp, "Failure responding to request") + return + } + + return +} + +// ListDiagnosticsPreparer prepares the ListDiagnostics request. +func (client AppServiceEnvironmentsClient) ListDiagnosticsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/diagnostics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListDiagnosticsSender sends the ListDiagnostics request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListDiagnosticsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListDiagnosticsResponder handles the response to the ListDiagnostics request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListDiagnosticsResponder(resp *http.Response) (result ListHostingEnvironmentDiagnostics, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListMultiRoleMetricDefinitions description for Get metric definitions for a multi-role pool of an App Service +// Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions") + defer func() { + sc := -1 + if result.rmdc.Response.Response != nil { + sc = result.rmdc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", err.Error()) + } + + result.fn = client.listMultiRoleMetricDefinitionsNextResults + req, err := client.ListMultiRoleMetricDefinitionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMultiRoleMetricDefinitionsSender(req) + if err != nil { + result.rmdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", resp, "Failure sending request") + return + } + + result.rmdc, err = client.ListMultiRoleMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleMetricDefinitions", resp, "Failure responding to request") + return + } + if result.rmdc.hasNextLink() && result.rmdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListMultiRoleMetricDefinitionsPreparer prepares the ListMultiRoleMetricDefinitions request. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/metricdefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMultiRoleMetricDefinitionsSender sends the ListMultiRoleMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMultiRoleMetricDefinitionsResponder handles the response to the ListMultiRoleMetricDefinitions request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMultiRoleMetricDefinitionsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRoleMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { + req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMultiRoleMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMultiRoleMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleMetricDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMultiRoleMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRoleMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string) (result ResourceMetricDefinitionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleMetricDefinitions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMultiRoleMetricDefinitions(ctx, resourceGroupName, name) + return +} + +// ListMultiRolePoolInstanceMetricDefinitions description for Get metric definitions for a specific instance of a +// multi-role pool of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// instance - name of the instance in the multi-role pool. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, instance string) (result ResourceMetricDefinitionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions") + defer func() { + sc := -1 + if result.rmdc.Response.Response != nil { + sc = result.rmdc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", err.Error()) + } + + result.fn = client.listMultiRolePoolInstanceMetricDefinitionsNextResults + req, err := client.ListMultiRolePoolInstanceMetricDefinitionsPreparer(ctx, resourceGroupName, name, instance) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListMultiRolePoolInstanceMetricDefinitionsSender(req) + if err != nil { + result.rmdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", resp, "Failure sending request") + return + } + + result.rmdc, err = client.ListMultiRolePoolInstanceMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolInstanceMetricDefinitions", resp, "Failure responding to request") + return + } + if result.rmdc.hasNextLink() && result.rmdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListMultiRolePoolInstanceMetricDefinitionsPreparer prepares the ListMultiRolePoolInstanceMetricDefinitions request. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string, instance string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instance": autorest.Encode("path", instance), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/instances/{instance}/metricdefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMultiRolePoolInstanceMetricDefinitionsSender sends the ListMultiRolePoolInstanceMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMultiRolePoolInstanceMetricDefinitionsResponder handles the response to the ListMultiRolePoolInstanceMetricDefinitions request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMultiRolePoolInstanceMetricDefinitionsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRolePoolInstanceMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { + req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMultiRolePoolInstanceMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMultiRolePoolInstanceMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolInstanceMetricDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMultiRolePoolInstanceMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, instance string) (result ResourceMetricDefinitionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolInstanceMetricDefinitions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMultiRolePoolInstanceMetricDefinitions(ctx, resourceGroupName, name, instance) + return +} + +// ListMultiRolePools description for Get all multi-role pools. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListMultiRolePools(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePools") + defer func() { + sc := -1 + if result.wpc.Response.Response != nil { + sc = result.wpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePools", err.Error()) + } + + result.fn = client.listMultiRolePoolsNextResults + req, err := client.ListMultiRolePoolsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", nil, "Failure preparing request") + return + } + + resp, err := client.ListMultiRolePoolsSender(req) + if err != nil { + result.wpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", resp, "Failure sending request") + return + } + + result.wpc, err = client.ListMultiRolePoolsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePools", resp, "Failure responding to request") + return + } + if result.wpc.hasNextLink() && result.wpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListMultiRolePoolsPreparer prepares the ListMultiRolePools request. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMultiRolePoolsSender sends the ListMultiRolePools request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMultiRolePoolsResponder handles the response to the ListMultiRolePools request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsResponder(resp *http.Response) (result WorkerPoolCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMultiRolePoolsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRolePoolsNextResults(ctx context.Context, lastResults WorkerPoolCollection) (result WorkerPoolCollection, err error) { + req, err := lastResults.workerPoolCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMultiRolePoolsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMultiRolePoolsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMultiRolePoolsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolsComplete(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePools") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMultiRolePools(ctx, resourceGroupName, name) + return +} + +// ListMultiRolePoolSkus description for Get available SKUs for scaling a multi-role pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkus(ctx context.Context, resourceGroupName string, name string) (result SkuInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolSkus") + defer func() { + sc := -1 + if result.sic.Response.Response != nil { + sc = result.sic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", err.Error()) + } + + result.fn = client.listMultiRolePoolSkusNextResults + req, err := client.ListMultiRolePoolSkusPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListMultiRolePoolSkusSender(req) + if err != nil { + result.sic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", resp, "Failure sending request") + return + } + + result.sic, err = client.ListMultiRolePoolSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRolePoolSkus", resp, "Failure responding to request") + return + } + if result.sic.hasNextLink() && result.sic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListMultiRolePoolSkusPreparer prepares the ListMultiRolePoolSkus request. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMultiRolePoolSkusSender sends the ListMultiRolePoolSkus request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMultiRolePoolSkusResponder handles the response to the ListMultiRolePoolSkus request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkusResponder(resp *http.Response) (result SkuInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMultiRolePoolSkusNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRolePoolSkusNextResults(ctx context.Context, lastResults SkuInfoCollection) (result SkuInfoCollection, err error) { + req, err := lastResults.skuInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMultiRolePoolSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMultiRolePoolSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRolePoolSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMultiRolePoolSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRolePoolSkusComplete(ctx context.Context, resourceGroupName string, name string) (result SkuInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRolePoolSkus") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMultiRolePoolSkus(ctx, resourceGroupName, name) + return +} + +// ListMultiRoleUsages description for Get usage metrics for a multi-role pool of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListMultiRoleUsages(ctx context.Context, resourceGroupName string, name string) (result UsageCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleUsages") + defer func() { + sc := -1 + if result.uc.Response.Response != nil { + sc = result.uc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListMultiRoleUsages", err.Error()) + } + + result.fn = client.listMultiRoleUsagesNextResults + req, err := client.ListMultiRoleUsagesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListMultiRoleUsagesSender(req) + if err != nil { + result.uc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleUsages", resp, "Failure sending request") + return + } + + result.uc, err = client.ListMultiRoleUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListMultiRoleUsages", resp, "Failure responding to request") + return + } + if result.uc.hasNextLink() && result.uc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListMultiRoleUsagesPreparer prepares the ListMultiRoleUsages request. +func (client AppServiceEnvironmentsClient) ListMultiRoleUsagesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListMultiRoleUsagesSender sends the ListMultiRoleUsages request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListMultiRoleUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListMultiRoleUsagesResponder handles the response to the ListMultiRoleUsages request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListMultiRoleUsagesResponder(resp *http.Response) (result UsageCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listMultiRoleUsagesNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listMultiRoleUsagesNextResults(ctx context.Context, lastResults UsageCollection) (result UsageCollection, err error) { + req, err := lastResults.usageCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleUsagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListMultiRoleUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleUsagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListMultiRoleUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listMultiRoleUsagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListMultiRoleUsagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListMultiRoleUsagesComplete(ctx context.Context, resourceGroupName string, name string) (result UsageCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListMultiRoleUsages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListMultiRoleUsages(ctx, resourceGroupName, name) + return +} + +// ListOperations description for List all currently running operations on the App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListOperations(ctx context.Context, resourceGroupName string, name string) (result ListOperation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListOperations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListOperations", err.Error()) + } + + req, err := client.ListOperationsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListOperations", nil, "Failure preparing request") + return + } + + resp, err := client.ListOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListOperations", resp, "Failure sending request") + return + } + + result, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListOperations", resp, "Failure responding to request") + return + } + + return +} + +// ListOperationsPreparer prepares the ListOperations request. +func (client AppServiceEnvironmentsClient) ListOperationsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/operations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOperationsSender sends the ListOperations request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListOperationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOperationsResponder handles the response to the ListOperations request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListOperationsResponder(resp *http.Response) (result ListOperation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages description for Get global usage metrics of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2') and startTime eq 2014-01-01T00:00:00Z and +// endTime eq 2014-12-31T23:59:59Z and timeGrain eq duration'[Hour|Minute|Day]'. +func (client AppServiceEnvironmentsClient) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListUsages") + defer func() { + sc := -1 + if result.cuqc.Response.Response != nil { + sc = result.cuqc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListUsages", err.Error()) + } + + result.fn = client.listUsagesNextResults + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, name, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.cuqc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", resp, "Failure sending request") + return + } + + result.cuqc, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListUsages", resp, "Failure responding to request") + return + } + if result.cuqc.hasNextLink() && result.cuqc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client AppServiceEnvironmentsClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, name string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListUsagesResponder(resp *http.Response) (result CsmUsageQuotaCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listUsagesNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listUsagesNextResults(ctx context.Context, lastResults CsmUsageQuotaCollection) (result CsmUsageQuotaCollection, err error) { + req, err := lastResults.csmUsageQuotaCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listUsagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListUsagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListUsages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListUsages(ctx, resourceGroupName, name, filter) + return +} + +// ListWebApps description for Get all apps in an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// propertiesToInclude - comma separated list of app properties to include. +func (client AppServiceEnvironmentsClient) ListWebApps(ctx context.Context, resourceGroupName string, name string, propertiesToInclude string) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebApps") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebApps", err.Error()) + } + + result.fn = client.listWebAppsNextResults + req, err := client.ListWebAppsPreparer(ctx, resourceGroupName, name, propertiesToInclude) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebApps", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebAppsSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebApps", resp, "Failure sending request") + return + } + + result.ac, err = client.ListWebAppsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebApps", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebAppsPreparer prepares the ListWebApps request. +func (client AppServiceEnvironmentsClient) ListWebAppsPreparer(ctx context.Context, resourceGroupName string, name string, propertiesToInclude string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(propertiesToInclude) > 0 { + queryParameters["propertiesToInclude"] = autorest.Encode("query", propertiesToInclude) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/sites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebAppsSender sends the ListWebApps request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListWebAppsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebAppsResponder handles the response to the ListWebApps request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListWebAppsResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebAppsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listWebAppsNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebAppsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebAppsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebAppsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebAppsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebAppsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebAppsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListWebAppsComplete(ctx context.Context, resourceGroupName string, name string, propertiesToInclude string) (result AppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebApps") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebApps(ctx, resourceGroupName, name, propertiesToInclude) + return +} + +// ListWebWorkerMetricDefinitions description for Get metric definitions for a worker pool of an App Service +// Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitions(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result ResourceMetricDefinitionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebWorkerMetricDefinitions") + defer func() { + sc := -1 + if result.rmdc.Response.Response != nil { + sc = result.rmdc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebWorkerMetricDefinitions", err.Error()) + } + + result.fn = client.listWebWorkerMetricDefinitionsNextResults + req, err := client.ListWebWorkerMetricDefinitionsPreparer(ctx, resourceGroupName, name, workerPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebWorkerMetricDefinitionsSender(req) + if err != nil { + result.rmdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetricDefinitions", resp, "Failure sending request") + return + } + + result.rmdc, err = client.ListWebWorkerMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerMetricDefinitions", resp, "Failure responding to request") + return + } + if result.rmdc.hasNextLink() && result.rmdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebWorkerMetricDefinitionsPreparer prepares the ListWebWorkerMetricDefinitions request. +func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/metricdefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebWorkerMetricDefinitionsSender sends the ListWebWorkerMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebWorkerMetricDefinitionsResponder handles the response to the ListWebWorkerMetricDefinitions request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebWorkerMetricDefinitionsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listWebWorkerMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { + req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerMetricDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebWorkerMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerMetricDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebWorkerMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerMetricDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebWorkerMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListWebWorkerMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result ResourceMetricDefinitionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebWorkerMetricDefinitions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebWorkerMetricDefinitions(ctx, resourceGroupName, name, workerPoolName) + return +} + +// ListWebWorkerUsages description for Get usage metrics for a worker pool of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +func (client AppServiceEnvironmentsClient) ListWebWorkerUsages(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result UsageCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebWorkerUsages") + defer func() { + sc := -1 + if result.uc.Response.Response != nil { + sc = result.uc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWebWorkerUsages", err.Error()) + } + + result.fn = client.listWebWorkerUsagesNextResults + req, err := client.ListWebWorkerUsagesPreparer(ctx, resourceGroupName, name, workerPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebWorkerUsagesSender(req) + if err != nil { + result.uc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerUsages", resp, "Failure sending request") + return + } + + result.uc, err = client.ListWebWorkerUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWebWorkerUsages", resp, "Failure responding to request") + return + } + if result.uc.hasNextLink() && result.uc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebWorkerUsagesPreparer prepares the ListWebWorkerUsages request. +func (client AppServiceEnvironmentsClient) ListWebWorkerUsagesPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebWorkerUsagesSender sends the ListWebWorkerUsages request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListWebWorkerUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebWorkerUsagesResponder handles the response to the ListWebWorkerUsages request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListWebWorkerUsagesResponder(resp *http.Response) (result UsageCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebWorkerUsagesNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listWebWorkerUsagesNextResults(ctx context.Context, lastResults UsageCollection) (result UsageCollection, err error) { + req, err := lastResults.usageCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerUsagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebWorkerUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerUsagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebWorkerUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWebWorkerUsagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebWorkerUsagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListWebWorkerUsagesComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result UsageCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWebWorkerUsages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebWorkerUsages(ctx, resourceGroupName, name, workerPoolName) + return +} + +// ListWorkerPoolInstanceMetricDefinitions description for Get metric definitions for a specific instance of a worker +// pool of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +// instance - name of the instance in the worker pool. +func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string) (result ResourceMetricDefinitionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPoolInstanceMetricDefinitions") + defer func() { + sc := -1 + if result.rmdc.Response.Response != nil { + sc = result.rmdc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetricDefinitions", err.Error()) + } + + result.fn = client.listWorkerPoolInstanceMetricDefinitionsNextResults + req, err := client.ListWorkerPoolInstanceMetricDefinitionsPreparer(ctx, resourceGroupName, name, workerPoolName, instance) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetricDefinitions", nil, "Failure preparing request") + return + } + + resp, err := client.ListWorkerPoolInstanceMetricDefinitionsSender(req) + if err != nil { + result.rmdc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetricDefinitions", resp, "Failure sending request") + return + } + + result.rmdc, err = client.ListWorkerPoolInstanceMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolInstanceMetricDefinitions", resp, "Failure responding to request") + return + } + if result.rmdc.hasNextLink() && result.rmdc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWorkerPoolInstanceMetricDefinitionsPreparer prepares the ListWorkerPoolInstanceMetricDefinitions request. +func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitionsPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "instance": autorest.Encode("path", instance), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/instances/{instance}/metricdefinitions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWorkerPoolInstanceMetricDefinitionsSender sends the ListWorkerPoolInstanceMetricDefinitions request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWorkerPoolInstanceMetricDefinitionsResponder handles the response to the ListWorkerPoolInstanceMetricDefinitions request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitionsResponder(resp *http.Response) (result ResourceMetricDefinitionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWorkerPoolInstanceMetricDefinitionsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listWorkerPoolInstanceMetricDefinitionsNextResults(ctx context.Context, lastResults ResourceMetricDefinitionCollection) (result ResourceMetricDefinitionCollection, err error) { + req, err := lastResults.resourceMetricDefinitionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolInstanceMetricDefinitionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWorkerPoolInstanceMetricDefinitionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolInstanceMetricDefinitionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWorkerPoolInstanceMetricDefinitionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolInstanceMetricDefinitionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWorkerPoolInstanceMetricDefinitionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListWorkerPoolInstanceMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string) (result ResourceMetricDefinitionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPoolInstanceMetricDefinitions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWorkerPoolInstanceMetricDefinitions(ctx, resourceGroupName, name, workerPoolName, instance) + return +} + +// ListWorkerPools description for Get all worker pools of an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) ListWorkerPools(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPools") + defer func() { + sc := -1 + if result.wpc.Response.Response != nil { + sc = result.wpc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPools", err.Error()) + } + + result.fn = client.listWorkerPoolsNextResults + req, err := client.ListWorkerPoolsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPools", nil, "Failure preparing request") + return + } + + resp, err := client.ListWorkerPoolsSender(req) + if err != nil { + result.wpc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPools", resp, "Failure sending request") + return + } + + result.wpc, err = client.ListWorkerPoolsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPools", resp, "Failure responding to request") + return + } + if result.wpc.hasNextLink() && result.wpc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWorkerPoolsPreparer prepares the ListWorkerPools request. +func (client AppServiceEnvironmentsClient) ListWorkerPoolsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWorkerPoolsSender sends the ListWorkerPools request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListWorkerPoolsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWorkerPoolsResponder handles the response to the ListWorkerPools request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListWorkerPoolsResponder(resp *http.Response) (result WorkerPoolCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWorkerPoolsNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listWorkerPoolsNextResults(ctx context.Context, lastResults WorkerPoolCollection) (result WorkerPoolCollection, err error) { + req, err := lastResults.workerPoolCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWorkerPoolsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWorkerPoolsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWorkerPoolsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListWorkerPoolsComplete(ctx context.Context, resourceGroupName string, name string) (result WorkerPoolCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPools") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWorkerPools(ctx, resourceGroupName, name) + return +} + +// ListWorkerPoolSkus description for Get available SKUs for scaling a worker pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +func (client AppServiceEnvironmentsClient) ListWorkerPoolSkus(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result SkuInfoCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPoolSkus") + defer func() { + sc := -1 + if result.sic.Response.Response != nil { + sc = result.sic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "ListWorkerPoolSkus", err.Error()) + } + + result.fn = client.listWorkerPoolSkusNextResults + req, err := client.ListWorkerPoolSkusPreparer(ctx, resourceGroupName, name, workerPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListWorkerPoolSkusSender(req) + if err != nil { + result.sic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolSkus", resp, "Failure sending request") + return + } + + result.sic, err = client.ListWorkerPoolSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "ListWorkerPoolSkus", resp, "Failure responding to request") + return + } + if result.sic.hasNextLink() && result.sic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWorkerPoolSkusPreparer prepares the ListWorkerPoolSkus request. +func (client AppServiceEnvironmentsClient) ListWorkerPoolSkusPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWorkerPoolSkusSender sends the ListWorkerPoolSkus request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ListWorkerPoolSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWorkerPoolSkusResponder handles the response to the ListWorkerPoolSkus request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ListWorkerPoolSkusResponder(resp *http.Response) (result SkuInfoCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWorkerPoolSkusNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) listWorkerPoolSkusNextResults(ctx context.Context, lastResults SkuInfoCollection) (result SkuInfoCollection, err error) { + req, err := lastResults.skuInfoCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWorkerPoolSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWorkerPoolSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "listWorkerPoolSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWorkerPoolSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ListWorkerPoolSkusComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result SkuInfoCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.ListWorkerPoolSkus") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWorkerPoolSkus(ctx, resourceGroupName, name, workerPoolName) + return +} + +// Reboot description for Reboot all machines in an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) Reboot(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Reboot") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Reboot", err.Error()) + } + + req, err := client.RebootPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Reboot", nil, "Failure preparing request") + return + } + + resp, err := client.RebootSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Reboot", resp, "Failure sending request") + return + } + + result, err = client.RebootResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Reboot", resp, "Failure responding to request") + return + } + + return +} + +// RebootPreparer prepares the Reboot request. +func (client AppServiceEnvironmentsClient) RebootPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/reboot", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RebootSender sends the Reboot request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) RebootSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RebootResponder handles the response to the Reboot request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) RebootResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Resume description for Resume an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) Resume(ctx context.Context, resourceGroupName string, name string) (result AppServiceEnvironmentsResumeFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Resume") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Resume", err.Error()) + } + + req, err := client.ResumePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Resume", nil, "Failure preparing request") + return + } + + result, err = client.ResumeSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Resume", result.Response(), "Failure sending request") + return + } + + return +} + +// ResumePreparer prepares the Resume request. +func (client AppServiceEnvironmentsClient) ResumePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/resume", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResumeSender sends the Resume request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) ResumeSender(req *http.Request) (future AppServiceEnvironmentsResumeFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResumeResponder handles the response to the Resume request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) ResumeResponder(resp *http.Response) (result AppCollectionPage, err error) { + result.ac, err = client.resumeResponder(resp) + result.fn = client.resumeNextResults + return +} + +func (client AppServiceEnvironmentsClient) resumeResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// resumeNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) resumeNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "resumeNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "resumeNextResults", resp, "Failure sending next results request") + } + return client.resumeResponder(resp) +} + +// ResumeComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) ResumeComplete(ctx context.Context, resourceGroupName string, name string) (result AppServiceEnvironmentsResumeAllFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Resume") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + var future AppServiceEnvironmentsResumeFuture + future, err = client.Resume(ctx, resourceGroupName, name) + result.FutureAPI = future.FutureAPI + return +} + +// Suspend description for Suspend an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) Suspend(ctx context.Context, resourceGroupName string, name string) (result AppServiceEnvironmentsSuspendFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Suspend") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Suspend", err.Error()) + } + + req, err := client.SuspendPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Suspend", nil, "Failure preparing request") + return + } + + result, err = client.SuspendSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Suspend", result.Response(), "Failure sending request") + return + } + + return +} + +// SuspendPreparer prepares the Suspend request. +func (client AppServiceEnvironmentsClient) SuspendPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/suspend", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SuspendSender sends the Suspend request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) SuspendSender(req *http.Request) (future AppServiceEnvironmentsSuspendFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SuspendResponder handles the response to the Suspend request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) SuspendResponder(resp *http.Response) (result AppCollectionPage, err error) { + result.ac, err = client.suspendResponder(resp) + result.fn = client.suspendNextResults + return +} + +func (client AppServiceEnvironmentsClient) suspendResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// suspendNextResults retrieves the next set of results, if any. +func (client AppServiceEnvironmentsClient) suspendNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "suspendNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + var resp *http.Response + resp, err = client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "suspendNextResults", resp, "Failure sending next results request") + } + return client.suspendResponder(resp) +} + +// SuspendComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServiceEnvironmentsClient) SuspendComplete(ctx context.Context, resourceGroupName string, name string) (result AppServiceEnvironmentsSuspendAllFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Suspend") + defer func() { + sc := -1 + if result.Response() != nil { + sc = result.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + var future AppServiceEnvironmentsSuspendFuture + future, err = client.Suspend(ctx, resourceGroupName, name) + result.FutureAPI = future.FutureAPI + return +} + +// Update description for Create or update an App Service Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// hostingEnvironmentEnvelope - configuration details of the App Service Environment. +func (client AppServiceEnvironmentsClient) Update(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentPatchResource) (result AppServiceEnvironmentResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, hostingEnvironmentEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AppServiceEnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope AppServiceEnvironmentPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}", pathParameters), + autorest.WithJSON(hostingEnvironmentEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) UpdateResponder(resp *http.Response) (result AppServiceEnvironmentResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateAseNetworkingConfiguration description for Update networking configuration of an App Service Environment +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +func (client AppServiceEnvironmentsClient) UpdateAseNetworkingConfiguration(ctx context.Context, resourceGroupName string, name string, aseNetworkingConfiguration AseV3NetworkingConfiguration) (result AseV3NetworkingConfiguration, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.UpdateAseNetworkingConfiguration") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "UpdateAseNetworkingConfiguration", err.Error()) + } + + req, err := client.UpdateAseNetworkingConfigurationPreparer(ctx, resourceGroupName, name, aseNetworkingConfiguration) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateAseNetworkingConfiguration", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateAseNetworkingConfigurationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateAseNetworkingConfiguration", resp, "Failure sending request") + return + } + + result, err = client.UpdateAseNetworkingConfigurationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateAseNetworkingConfiguration", resp, "Failure responding to request") + return + } + + return +} + +// UpdateAseNetworkingConfigurationPreparer prepares the UpdateAseNetworkingConfiguration request. +func (client AppServiceEnvironmentsClient) UpdateAseNetworkingConfigurationPreparer(ctx context.Context, resourceGroupName string, name string, aseNetworkingConfiguration AseV3NetworkingConfiguration) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/configurations/networking", pathParameters), + autorest.WithJSON(aseNetworkingConfiguration), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateAseNetworkingConfigurationSender sends the UpdateAseNetworkingConfiguration request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) UpdateAseNetworkingConfigurationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateAseNetworkingConfigurationResponder handles the response to the UpdateAseNetworkingConfiguration request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) UpdateAseNetworkingConfigurationResponder(resp *http.Response) (result AseV3NetworkingConfiguration, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateMultiRolePool description for Create or update a multi-role pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// multiRolePoolEnvelope - properties of the multi-role pool. +func (client AppServiceEnvironmentsClient) UpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource) (result WorkerPoolResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.UpdateMultiRolePool") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "UpdateMultiRolePool", err.Error()) + } + + req, err := client.UpdateMultiRolePoolPreparer(ctx, resourceGroupName, name, multiRolePoolEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateMultiRolePool", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateMultiRolePoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateMultiRolePool", resp, "Failure sending request") + return + } + + result, err = client.UpdateMultiRolePoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateMultiRolePool", resp, "Failure responding to request") + return + } + + return +} + +// UpdateMultiRolePoolPreparer prepares the UpdateMultiRolePool request. +func (client AppServiceEnvironmentsClient) UpdateMultiRolePoolPreparer(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope WorkerPoolResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/multiRolePools/default", pathParameters), + autorest.WithJSON(multiRolePoolEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateMultiRolePoolSender sends the UpdateMultiRolePool request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) UpdateMultiRolePoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateMultiRolePoolResponder handles the response to the UpdateMultiRolePool request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) UpdateMultiRolePoolResponder(resp *http.Response) (result WorkerPoolResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateWorkerPool description for Create or update a worker pool. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service Environment. +// workerPoolName - name of the worker pool. +// workerPoolEnvelope - properties of the worker pool. +func (client AppServiceEnvironmentsClient) UpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource) (result WorkerPoolResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentsClient.UpdateWorkerPool") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServiceEnvironmentsClient", "UpdateWorkerPool", err.Error()) + } + + req, err := client.UpdateWorkerPoolPreparer(ctx, resourceGroupName, name, workerPoolName, workerPoolEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateWorkerPool", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateWorkerPoolSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateWorkerPool", resp, "Failure sending request") + return + } + + result, err = client.UpdateWorkerPoolResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsClient", "UpdateWorkerPool", resp, "Failure responding to request") + return + } + + return +} + +// UpdateWorkerPoolPreparer prepares the UpdateWorkerPool request. +func (client AppServiceEnvironmentsClient) UpdateWorkerPoolPreparer(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope WorkerPoolResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerPoolName": autorest.Encode("path", workerPoolName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/workerPools/{workerPoolName}", pathParameters), + autorest.WithJSON(workerPoolEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateWorkerPoolSender sends the UpdateWorkerPool request. The method will close the +// http.Response Body if it receives an error. +func (client AppServiceEnvironmentsClient) UpdateWorkerPoolSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateWorkerPoolResponder handles the response to the UpdateWorkerPool request. The method always +// closes the http.Response Body. +func (client AppServiceEnvironmentsClient) UpdateWorkerPoolResponder(resp *http.Response) (result WorkerPoolResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/appserviceplans.go b/services/web/mgmt/2021-03-01/web/appserviceplans.go new file mode 100644 index 000000000000..90503203f87d --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/appserviceplans.go @@ -0,0 +1,2632 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AppServicePlansClient is the webSite Management Client +type AppServicePlansClient struct { + BaseClient +} + +// NewAppServicePlansClient creates an instance of the AppServicePlansClient client. +func NewAppServicePlansClient(subscriptionID string) AppServicePlansClient { + return NewAppServicePlansClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAppServicePlansClientWithBaseURI creates an instance of the AppServicePlansClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAppServicePlansClientWithBaseURI(baseURI string, subscriptionID string) AppServicePlansClient { + return AppServicePlansClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate description for Creates or updates an App Service Plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// appServicePlan - details of the App Service plan. +func (client AppServicePlansClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlan) (result AppServicePlansCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, appServicePlan) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client AppServicePlansClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlan) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters), + autorest.WithJSON(appServicePlan), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) CreateOrUpdateSender(req *http.Request) (future AppServicePlansCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) CreateOrUpdateResponder(resp *http.Response) (result AppServicePlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateVnetRoute description for Create or update a Virtual Network route in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +// routeName - name of the Virtual Network route. +// route - definition of the Virtual Network route. +func (client AppServicePlansClient) CreateOrUpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.CreateOrUpdateVnetRoute") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "CreateOrUpdateVnetRoute", err.Error()) + } + + req, err := client.CreateOrUpdateVnetRoutePreparer(ctx, resourceGroupName, name, vnetName, routeName, route) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "CreateOrUpdateVnetRoute", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateVnetRouteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "CreateOrUpdateVnetRoute", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateVnetRouteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "CreateOrUpdateVnetRoute", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateVnetRoutePreparer prepares the CreateOrUpdateVnetRoute request. +func (client AppServicePlansClient) CreateOrUpdateVnetRoutePreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeName": autorest.Encode("path", routeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters), + autorest.WithJSON(route), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateVnetRouteSender sends the CreateOrUpdateVnetRoute request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) CreateOrUpdateVnetRouteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateVnetRouteResponder handles the response to the CreateOrUpdateVnetRoute request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) CreateOrUpdateVnetRouteResponder(resp *http.Response) (result VnetRoute, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +func (client AppServicePlansClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AppServicePlansClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteHybridConnection description for Delete a Hybrid Connection in use in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// namespaceName - name of the Service Bus namespace. +// relayName - name of the Service Bus relay. +func (client AppServicePlansClient) DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.DeleteHybridConnection") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "DeleteHybridConnection", err.Error()) + } + + req, err := client.DeleteHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "DeleteHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteHybridConnectionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "DeleteHybridConnection", resp, "Failure sending request") + return + } + + result, err = client.DeleteHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "DeleteHybridConnection", resp, "Failure responding to request") + return + } + + return +} + +// DeleteHybridConnectionPreparer prepares the DeleteHybridConnection request. +func (client AppServicePlansClient) DeleteHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteHybridConnectionSender sends the DeleteHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) DeleteHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteHybridConnectionResponder handles the response to the DeleteHybridConnection request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) DeleteHybridConnectionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteVnetRoute description for Delete a Virtual Network route in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +// routeName - name of the Virtual Network route. +func (client AppServicePlansClient) DeleteVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.DeleteVnetRoute") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "DeleteVnetRoute", err.Error()) + } + + req, err := client.DeleteVnetRoutePreparer(ctx, resourceGroupName, name, vnetName, routeName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "DeleteVnetRoute", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteVnetRouteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "DeleteVnetRoute", resp, "Failure sending request") + return + } + + result, err = client.DeleteVnetRouteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "DeleteVnetRoute", resp, "Failure responding to request") + return + } + + return +} + +// DeleteVnetRoutePreparer prepares the DeleteVnetRoute request. +func (client AppServicePlansClient) DeleteVnetRoutePreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeName": autorest.Encode("path", routeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteVnetRouteSender sends the DeleteVnetRoute request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) DeleteVnetRouteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteVnetRouteResponder handles the response to the DeleteVnetRoute request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) DeleteVnetRouteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get description for Get an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +func (client AppServicePlansClient) Get(ctx context.Context, resourceGroupName string, name string) (result AppServicePlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AppServicePlansClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetResponder(resp *http.Response) (result AppServicePlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHybridConnection description for Retrieve a Hybrid Connection in use in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// namespaceName - name of the Service Bus namespace. +// relayName - name of the Service Bus relay. +func (client AppServicePlansClient) GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.GetHybridConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "GetHybridConnection", err.Error()) + } + + req, err := client.GetHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetHybridConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetHybridConnection", resp, "Failure sending request") + return + } + + result, err = client.GetHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetHybridConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetHybridConnectionPreparer prepares the GetHybridConnection request. +func (client AppServicePlansClient) GetHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHybridConnectionSender sends the GetHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHybridConnectionResponder handles the response to the GetHybridConnection request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetHybridConnectionResponder(resp *http.Response) (result HybridConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHybridConnectionPlanLimit description for Get the maximum number of Hybrid Connections allowed in an App Service +// plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +func (client AppServicePlansClient) GetHybridConnectionPlanLimit(ctx context.Context, resourceGroupName string, name string) (result HybridConnectionLimits, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.GetHybridConnectionPlanLimit") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "GetHybridConnectionPlanLimit", err.Error()) + } + + req, err := client.GetHybridConnectionPlanLimitPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetHybridConnectionPlanLimit", nil, "Failure preparing request") + return + } + + resp, err := client.GetHybridConnectionPlanLimitSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetHybridConnectionPlanLimit", resp, "Failure sending request") + return + } + + result, err = client.GetHybridConnectionPlanLimitResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetHybridConnectionPlanLimit", resp, "Failure responding to request") + return + } + + return +} + +// GetHybridConnectionPlanLimitPreparer prepares the GetHybridConnectionPlanLimit request. +func (client AppServicePlansClient) GetHybridConnectionPlanLimitPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionPlanLimits/limit", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHybridConnectionPlanLimitSender sends the GetHybridConnectionPlanLimit request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetHybridConnectionPlanLimitSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHybridConnectionPlanLimitResponder handles the response to the GetHybridConnectionPlanLimit request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetHybridConnectionPlanLimitResponder(resp *http.Response) (result HybridConnectionLimits, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRouteForVnet description for Get a Virtual Network route in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +// routeName - name of the Virtual Network route. +func (client AppServicePlansClient) GetRouteForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (result ListVnetRoute, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.GetRouteForVnet") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "GetRouteForVnet", err.Error()) + } + + req, err := client.GetRouteForVnetPreparer(ctx, resourceGroupName, name, vnetName, routeName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetRouteForVnet", nil, "Failure preparing request") + return + } + + resp, err := client.GetRouteForVnetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetRouteForVnet", resp, "Failure sending request") + return + } + + result, err = client.GetRouteForVnetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetRouteForVnet", resp, "Failure responding to request") + return + } + + return +} + +// GetRouteForVnetPreparer prepares the GetRouteForVnet request. +func (client AppServicePlansClient) GetRouteForVnetPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeName": autorest.Encode("path", routeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRouteForVnetSender sends the GetRouteForVnet request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetRouteForVnetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRouteForVnetResponder handles the response to the GetRouteForVnet request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetRouteForVnetResponder(resp *http.Response) (result ListVnetRoute, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetServerFarmSkus description for Gets all selectable SKUs for a given App Service Plan +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of App Service Plan +func (client AppServicePlansClient) GetServerFarmSkus(ctx context.Context, resourceGroupName string, name string) (result SetObject, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.GetServerFarmSkus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "GetServerFarmSkus", err.Error()) + } + + req, err := client.GetServerFarmSkusPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetServerFarmSkus", nil, "Failure preparing request") + return + } + + resp, err := client.GetServerFarmSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetServerFarmSkus", resp, "Failure sending request") + return + } + + result, err = client.GetServerFarmSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetServerFarmSkus", resp, "Failure responding to request") + return + } + + return +} + +// GetServerFarmSkusPreparer prepares the GetServerFarmSkus request. +func (client AppServicePlansClient) GetServerFarmSkusPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetServerFarmSkusSender sends the GetServerFarmSkus request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetServerFarmSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetServerFarmSkusResponder handles the response to the GetServerFarmSkus request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetServerFarmSkusResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVnetFromServerFarm description for Get a Virtual Network associated with an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +func (client AppServicePlansClient) GetVnetFromServerFarm(ctx context.Context, resourceGroupName string, name string, vnetName string) (result VnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.GetVnetFromServerFarm") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "GetVnetFromServerFarm", err.Error()) + } + + req, err := client.GetVnetFromServerFarmPreparer(ctx, resourceGroupName, name, vnetName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetVnetFromServerFarm", nil, "Failure preparing request") + return + } + + resp, err := client.GetVnetFromServerFarmSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetVnetFromServerFarm", resp, "Failure sending request") + return + } + + result, err = client.GetVnetFromServerFarmResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetVnetFromServerFarm", resp, "Failure responding to request") + return + } + + return +} + +// GetVnetFromServerFarmPreparer prepares the GetVnetFromServerFarm request. +func (client AppServicePlansClient) GetVnetFromServerFarmPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVnetFromServerFarmSender sends the GetVnetFromServerFarm request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetVnetFromServerFarmSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVnetFromServerFarmResponder handles the response to the GetVnetFromServerFarm request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetVnetFromServerFarmResponder(resp *http.Response) (result VnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetVnetGateway description for Get a Virtual Network gateway. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Only the 'primary' gateway is supported. +func (client AppServicePlansClient) GetVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.GetVnetGateway") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "GetVnetGateway", err.Error()) + } + + req, err := client.GetVnetGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetVnetGateway", nil, "Failure preparing request") + return + } + + resp, err := client.GetVnetGatewaySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetVnetGateway", resp, "Failure sending request") + return + } + + result, err = client.GetVnetGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "GetVnetGateway", resp, "Failure responding to request") + return + } + + return +} + +// GetVnetGatewayPreparer prepares the GetVnetGateway request. +func (client AppServicePlansClient) GetVnetGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetVnetGatewaySender sends the GetVnetGateway request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) GetVnetGatewaySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetVnetGatewayResponder handles the response to the GetVnetGateway request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) GetVnetGatewayResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all App Service plans for a subscription. +// Parameters: +// detailed - specify true to return all App Service plan properties. The default is +// false, which returns a subset of the properties. +// Retrieval of all properties may increase the API latency. +func (client AppServicePlansClient) List(ctx context.Context, detailed *bool) (result AppServicePlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.List") + defer func() { + sc := -1 + if result.aspc.Response.Response != nil { + sc = result.aspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, detailed) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "List", resp, "Failure sending request") + return + } + + result.aspc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "List", resp, "Failure responding to request") + return + } + if result.aspc.hasNextLink() && result.aspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AppServicePlansClient) ListPreparer(ctx context.Context, detailed *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if detailed != nil { + queryParameters["detailed"] = autorest.Encode("query", *detailed) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/serverfarms", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListResponder(resp *http.Response) (result AppServicePlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AppServicePlansClient) listNextResults(ctx context.Context, lastResults AppServicePlanCollection) (result AppServicePlanCollection, err error) { + req, err := lastResults.appServicePlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServicePlansClient) ListComplete(ctx context.Context, detailed *bool) (result AppServicePlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, detailed) + return +} + +// ListByResourceGroup description for Get all App Service plans in a resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client AppServicePlansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result AppServicePlanCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.aspc.Response.Response != nil { + sc = result.aspc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.aspc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.aspc, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.aspc.hasNextLink() && result.aspc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client AppServicePlansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListByResourceGroupResponder(resp *http.Response) (result AppServicePlanCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client AppServicePlansClient) listByResourceGroupNextResults(ctx context.Context, lastResults AppServicePlanCollection) (result AppServicePlanCollection, err error) { + req, err := lastResults.appServicePlanCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServicePlansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result AppServicePlanCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListCapabilities description for List all capabilities of an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +func (client AppServicePlansClient) ListCapabilities(ctx context.Context, resourceGroupName string, name string) (result ListCapability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListCapabilities") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListCapabilities", err.Error()) + } + + req, err := client.ListCapabilitiesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListCapabilities", nil, "Failure preparing request") + return + } + + resp, err := client.ListCapabilitiesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListCapabilities", resp, "Failure sending request") + return + } + + result, err = client.ListCapabilitiesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListCapabilities", resp, "Failure responding to request") + return + } + + return +} + +// ListCapabilitiesPreparer prepares the ListCapabilities request. +func (client AppServicePlansClient) ListCapabilitiesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/capabilities", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCapabilitiesSender sends the ListCapabilities request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListCapabilitiesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCapabilitiesResponder handles the response to the ListCapabilities request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListCapabilitiesResponder(resp *http.Response) (result ListCapability, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHybridConnectionKeys description for Get the send key name and value of a Hybrid Connection. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// namespaceName - the name of the Service Bus namespace. +// relayName - the name of the Service Bus relay. +func (client AppServicePlansClient) ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result HybridConnectionKey, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListHybridConnectionKeys") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListHybridConnectionKeys", err.Error()) + } + + req, err := client.ListHybridConnectionKeysPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListHybridConnectionKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListHybridConnectionKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListHybridConnectionKeys", resp, "Failure sending request") + return + } + + result, err = client.ListHybridConnectionKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListHybridConnectionKeys", resp, "Failure responding to request") + return + } + + return +} + +// ListHybridConnectionKeysPreparer prepares the ListHybridConnectionKeys request. +func (client AppServicePlansClient) ListHybridConnectionKeysPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/listKeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHybridConnectionKeysSender sends the ListHybridConnectionKeys request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListHybridConnectionKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHybridConnectionKeysResponder handles the response to the ListHybridConnectionKeys request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListHybridConnectionKeysResponder(resp *http.Response) (result HybridConnectionKey, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHybridConnections description for Retrieve all Hybrid Connections in use in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +func (client AppServicePlansClient) ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result HybridConnectionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListHybridConnections") + defer func() { + sc := -1 + if result.hcc.Response.Response != nil { + sc = result.hcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListHybridConnections", err.Error()) + } + + result.fn = client.listHybridConnectionsNextResults + req, err := client.ListHybridConnectionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListHybridConnections", nil, "Failure preparing request") + return + } + + resp, err := client.ListHybridConnectionsSender(req) + if err != nil { + result.hcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListHybridConnections", resp, "Failure sending request") + return + } + + result.hcc, err = client.ListHybridConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListHybridConnections", resp, "Failure responding to request") + return + } + if result.hcc.hasNextLink() && result.hcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListHybridConnectionsPreparer prepares the ListHybridConnections request. +func (client AppServicePlansClient) ListHybridConnectionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionRelays", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHybridConnectionsSender sends the ListHybridConnections request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListHybridConnectionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHybridConnectionsResponder handles the response to the ListHybridConnections request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListHybridConnectionsResponder(resp *http.Response) (result HybridConnectionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHybridConnectionsNextResults retrieves the next set of results, if any. +func (client AppServicePlansClient) listHybridConnectionsNextResults(ctx context.Context, lastResults HybridConnectionCollection) (result HybridConnectionCollection, err error) { + req, err := lastResults.hybridConnectionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listHybridConnectionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHybridConnectionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listHybridConnectionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHybridConnectionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listHybridConnectionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHybridConnectionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServicePlansClient) ListHybridConnectionsComplete(ctx context.Context, resourceGroupName string, name string) (result HybridConnectionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListHybridConnections") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListHybridConnections(ctx, resourceGroupName, name) + return +} + +// ListRoutesForVnet description for Get all routes that are associated with a Virtual Network in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +func (client AppServicePlansClient) ListRoutesForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string) (result ListVnetRoute, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListRoutesForVnet") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListRoutesForVnet", err.Error()) + } + + req, err := client.ListRoutesForVnetPreparer(ctx, resourceGroupName, name, vnetName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListRoutesForVnet", nil, "Failure preparing request") + return + } + + resp, err := client.ListRoutesForVnetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListRoutesForVnet", resp, "Failure sending request") + return + } + + result, err = client.ListRoutesForVnetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListRoutesForVnet", resp, "Failure responding to request") + return + } + + return +} + +// ListRoutesForVnetPreparer prepares the ListRoutesForVnet request. +func (client AppServicePlansClient) ListRoutesForVnetPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRoutesForVnetSender sends the ListRoutesForVnet request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListRoutesForVnetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRoutesForVnetResponder handles the response to the ListRoutesForVnet request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListRoutesForVnetResponder(resp *http.Response) (result ListVnetRoute, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListUsages description for Gets server farm usage information +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of App Service Plan +// filter - return only usages/metrics specified in the filter. Filter conforms to odata syntax. Example: +// $filter=(name.value eq 'Metric1' or name.value eq 'Metric2'). +func (client AppServicePlansClient) ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListUsages") + defer func() { + sc := -1 + if result.cuqc.Response.Response != nil { + sc = result.cuqc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListUsages", err.Error()) + } + + result.fn = client.listUsagesNextResults + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, name, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.cuqc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListUsages", resp, "Failure sending request") + return + } + + result.cuqc, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListUsages", resp, "Failure responding to request") + return + } + if result.cuqc.hasNextLink() && result.cuqc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client AppServicePlansClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, name string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListUsagesResponder(resp *http.Response) (result CsmUsageQuotaCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listUsagesNextResults retrieves the next set of results, if any. +func (client AppServicePlansClient) listUsagesNextResults(ctx context.Context, lastResults CsmUsageQuotaCollection) (result CsmUsageQuotaCollection, err error) { + req, err := lastResults.csmUsageQuotaCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listUsagesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listUsagesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listUsagesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListUsagesComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServicePlansClient) ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result CsmUsageQuotaCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListUsages") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListUsages(ctx, resourceGroupName, name, filter) + return +} + +// ListVnets description for Get all Virtual Networks associated with an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +func (client AppServicePlansClient) ListVnets(ctx context.Context, resourceGroupName string, name string) (result ListVnetInfoResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListVnets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListVnets", err.Error()) + } + + req, err := client.ListVnetsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListVnets", nil, "Failure preparing request") + return + } + + resp, err := client.ListVnetsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListVnets", resp, "Failure sending request") + return + } + + result, err = client.ListVnetsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListVnets", resp, "Failure responding to request") + return + } + + return +} + +// ListVnetsPreparer prepares the ListVnets request. +func (client AppServicePlansClient) ListVnetsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListVnetsSender sends the ListVnets request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListVnetsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListVnetsResponder handles the response to the ListVnets request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListVnetsResponder(resp *http.Response) (result ListVnetInfoResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListWebApps description for Get all apps associated with an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// skipToken - skip to a web app in the list of webapps associated with app service plan. If specified, the +// resulting list will contain web apps starting from (including) the skipToken. Otherwise, the resulting list +// contains web apps from the start of the list +// filter - supported filter: $filter=state eq running. Returns only web apps that are currently running +// top - list page size. If specified, results are paged. +func (client AppServicePlansClient) ListWebApps(ctx context.Context, resourceGroupName string, name string, skipToken string, filter string, top string) (result AppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListWebApps") + defer func() { + sc := -1 + if result.ac.Response.Response != nil { + sc = result.ac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListWebApps", err.Error()) + } + + result.fn = client.listWebAppsNextResults + req, err := client.ListWebAppsPreparer(ctx, resourceGroupName, name, skipToken, filter, top) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListWebApps", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebAppsSender(req) + if err != nil { + result.ac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListWebApps", resp, "Failure sending request") + return + } + + result.ac, err = client.ListWebAppsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListWebApps", resp, "Failure responding to request") + return + } + if result.ac.hasNextLink() && result.ac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebAppsPreparer prepares the ListWebApps request. +func (client AppServicePlansClient) ListWebAppsPreparer(ctx context.Context, resourceGroupName string, name string, skipToken string, filter string, top string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(skipToken) > 0 { + queryParameters["$skipToken"] = autorest.Encode("query", skipToken) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + if len(top) > 0 { + queryParameters["$top"] = autorest.Encode("query", top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/sites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebAppsSender sends the ListWebApps request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListWebAppsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebAppsResponder handles the response to the ListWebApps request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListWebAppsResponder(resp *http.Response) (result AppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebAppsNextResults retrieves the next set of results, if any. +func (client AppServicePlansClient) listWebAppsNextResults(ctx context.Context, lastResults AppCollection) (result AppCollection, err error) { + req, err := lastResults.appCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listWebAppsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebAppsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listWebAppsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebAppsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listWebAppsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebAppsComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServicePlansClient) ListWebAppsComplete(ctx context.Context, resourceGroupName string, name string, skipToken string, filter string, top string) (result AppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListWebApps") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebApps(ctx, resourceGroupName, name, skipToken, filter, top) + return +} + +// ListWebAppsByHybridConnection description for Get all apps that use a Hybrid Connection in an App Service Plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// namespaceName - name of the Hybrid Connection namespace. +// relayName - name of the Hybrid Connection relay. +func (client AppServicePlansClient) ListWebAppsByHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result ResourceCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListWebAppsByHybridConnection") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "ListWebAppsByHybridConnection", err.Error()) + } + + result.fn = client.listWebAppsByHybridConnectionNextResults + req, err := client.ListWebAppsByHybridConnectionPreparer(ctx, resourceGroupName, name, namespaceName, relayName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListWebAppsByHybridConnection", nil, "Failure preparing request") + return + } + + resp, err := client.ListWebAppsByHybridConnectionSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListWebAppsByHybridConnection", resp, "Failure sending request") + return + } + + result.rc, err = client.ListWebAppsByHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "ListWebAppsByHybridConnection", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListWebAppsByHybridConnectionPreparer prepares the ListWebAppsByHybridConnection request. +func (client AppServicePlansClient) ListWebAppsByHybridConnectionPreparer(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "namespaceName": autorest.Encode("path", namespaceName), + "relayName": autorest.Encode("path", relayName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/hybridConnectionNamespaces/{namespaceName}/relays/{relayName}/sites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListWebAppsByHybridConnectionSender sends the ListWebAppsByHybridConnection request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) ListWebAppsByHybridConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListWebAppsByHybridConnectionResponder handles the response to the ListWebAppsByHybridConnection request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) ListWebAppsByHybridConnectionResponder(resp *http.Response) (result ResourceCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listWebAppsByHybridConnectionNextResults retrieves the next set of results, if any. +func (client AppServicePlansClient) listWebAppsByHybridConnectionNextResults(ctx context.Context, lastResults ResourceCollection) (result ResourceCollection, err error) { + req, err := lastResults.resourceCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listWebAppsByHybridConnectionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListWebAppsByHybridConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listWebAppsByHybridConnectionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListWebAppsByHybridConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "listWebAppsByHybridConnectionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListWebAppsByHybridConnectionComplete enumerates all values, automatically crossing page boundaries as required. +func (client AppServicePlansClient) ListWebAppsByHybridConnectionComplete(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result ResourceCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.ListWebAppsByHybridConnection") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListWebAppsByHybridConnection(ctx, resourceGroupName, name, namespaceName, relayName) + return +} + +// RebootWorker description for Reboot a worker machine in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// workerName - name of worker machine, which typically starts with RD. +func (client AppServicePlansClient) RebootWorker(ctx context.Context, resourceGroupName string, name string, workerName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.RebootWorker") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "RebootWorker", err.Error()) + } + + req, err := client.RebootWorkerPreparer(ctx, resourceGroupName, name, workerName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "RebootWorker", nil, "Failure preparing request") + return + } + + resp, err := client.RebootWorkerSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "RebootWorker", resp, "Failure sending request") + return + } + + result, err = client.RebootWorkerResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "RebootWorker", resp, "Failure responding to request") + return + } + + return +} + +// RebootWorkerPreparer prepares the RebootWorker request. +func (client AppServicePlansClient) RebootWorkerPreparer(ctx context.Context, resourceGroupName string, name string, workerName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "workerName": autorest.Encode("path", workerName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/workers/{workerName}/reboot", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RebootWorkerSender sends the RebootWorker request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) RebootWorkerSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RebootWorkerResponder handles the response to the RebootWorker request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) RebootWorkerResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// RestartWebApps description for Restart all apps in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// softRestart - specify true to perform a soft restart, applies the configuration settings and +// restarts the apps if necessary. The default is false, which always restarts and reprovisions +// the apps +func (client AppServicePlansClient) RestartWebApps(ctx context.Context, resourceGroupName string, name string, softRestart *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.RestartWebApps") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "RestartWebApps", err.Error()) + } + + req, err := client.RestartWebAppsPreparer(ctx, resourceGroupName, name, softRestart) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "RestartWebApps", nil, "Failure preparing request") + return + } + + resp, err := client.RestartWebAppsSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "RestartWebApps", resp, "Failure sending request") + return + } + + result, err = client.RestartWebAppsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "RestartWebApps", resp, "Failure responding to request") + return + } + + return +} + +// RestartWebAppsPreparer prepares the RestartWebApps request. +func (client AppServicePlansClient) RestartWebAppsPreparer(ctx context.Context, resourceGroupName string, name string, softRestart *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if softRestart != nil { + queryParameters["softRestart"] = autorest.Encode("query", *softRestart) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/restartSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartWebAppsSender sends the RestartWebApps request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) RestartWebAppsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RestartWebAppsResponder handles the response to the RestartWebApps request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) RestartWebAppsResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update description for Creates or updates an App Service Plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// appServicePlan - details of the App Service plan. +func (client AppServicePlansClient) Update(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlanPatchResource) (result AppServicePlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, appServicePlan) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AppServicePlansClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, appServicePlan AppServicePlanPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}", pathParameters), + autorest.WithJSON(appServicePlan), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) UpdateResponder(resp *http.Response) (result AppServicePlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateVnetGateway description for Update a Virtual Network gateway. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +// gatewayName - name of the gateway. Only the 'primary' gateway is supported. +// connectionEnvelope - definition of the gateway. +func (client AppServicePlansClient) UpdateVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (result VnetGateway, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.UpdateVnetGateway") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: connectionEnvelope, + Constraints: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "connectionEnvelope.VnetGatewayProperties.VpnPackageURI", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "UpdateVnetGateway", err.Error()) + } + + req, err := client.UpdateVnetGatewayPreparer(ctx, resourceGroupName, name, vnetName, gatewayName, connectionEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "UpdateVnetGateway", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateVnetGatewaySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "UpdateVnetGateway", resp, "Failure sending request") + return + } + + result, err = client.UpdateVnetGatewayResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "UpdateVnetGateway", resp, "Failure responding to request") + return + } + + return +} + +// UpdateVnetGatewayPreparer prepares the UpdateVnetGateway request. +func (client AppServicePlansClient) UpdateVnetGatewayPreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope VnetGateway) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "gatewayName": autorest.Encode("path", gatewayName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/gateways/{gatewayName}", pathParameters), + autorest.WithJSON(connectionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateVnetGatewaySender sends the UpdateVnetGateway request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) UpdateVnetGatewaySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateVnetGatewayResponder handles the response to the UpdateVnetGateway request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) UpdateVnetGatewayResponder(resp *http.Response) (result VnetGateway, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateVnetRoute description for Create or update a Virtual Network route in an App Service plan. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the App Service plan. +// vnetName - name of the Virtual Network. +// routeName - name of the Virtual Network route. +// route - definition of the Virtual Network route. +func (client AppServicePlansClient) UpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (result VnetRoute, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlansClient.UpdateVnetRoute") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.AppServicePlansClient", "UpdateVnetRoute", err.Error()) + } + + req, err := client.UpdateVnetRoutePreparer(ctx, resourceGroupName, name, vnetName, routeName, route) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "UpdateVnetRoute", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateVnetRouteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "UpdateVnetRoute", resp, "Failure sending request") + return + } + + result, err = client.UpdateVnetRouteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansClient", "UpdateVnetRoute", resp, "Failure responding to request") + return + } + + return +} + +// UpdateVnetRoutePreparer prepares the UpdateVnetRoute request. +func (client AppServicePlansClient) UpdateVnetRoutePreparer(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route VnetRoute) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "routeName": autorest.Encode("path", routeName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "vnetName": autorest.Encode("path", vnetName), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/serverfarms/{name}/virtualNetworkConnections/{vnetName}/routes/{routeName}", pathParameters), + autorest.WithJSON(route), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateVnetRouteSender sends the UpdateVnetRoute request. The method will close the +// http.Response Body if it receives an error. +func (client AppServicePlansClient) UpdateVnetRouteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateVnetRouteResponder handles the response to the UpdateVnetRoute request. The method always +// closes the http.Response Body. +func (client AppServicePlansClient) UpdateVnetRouteResponder(resp *http.Response) (result VnetRoute, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/certificateordersdiagnostics.go b/services/web/mgmt/2021-03-01/web/certificateordersdiagnostics.go new file mode 100644 index 000000000000..5394a46f0ee1 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/certificateordersdiagnostics.go @@ -0,0 +1,263 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CertificateOrdersDiagnosticsClient is the webSite Management Client +type CertificateOrdersDiagnosticsClient struct { + BaseClient +} + +// NewCertificateOrdersDiagnosticsClient creates an instance of the CertificateOrdersDiagnosticsClient client. +func NewCertificateOrdersDiagnosticsClient(subscriptionID string) CertificateOrdersDiagnosticsClient { + return NewCertificateOrdersDiagnosticsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificateOrdersDiagnosticsClientWithBaseURI creates an instance of the CertificateOrdersDiagnosticsClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewCertificateOrdersDiagnosticsClientWithBaseURI(baseURI string, subscriptionID string) CertificateOrdersDiagnosticsClient { + return CertificateOrdersDiagnosticsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetAppServiceCertificateOrderDetectorResponse description for Microsoft.CertificateRegistration call to get a +// detector response from App Lens. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - the certificate order name for which the response is needed. +// detectorName - the detector name which needs to be run. +// startTime - the start time for detector response. +// endTime - the end time for the detector response. +// timeGrain - the time grain for the detector response. +func (client CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, resourceGroupName string, certificateOrderName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateOrdersDiagnosticsClient.GetAppServiceCertificateOrderDetectorResponse") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.CertificateOrdersDiagnosticsClient", "GetAppServiceCertificateOrderDetectorResponse", err.Error()) + } + + req, err := client.GetAppServiceCertificateOrderDetectorResponsePreparer(ctx, resourceGroupName, certificateOrderName, detectorName, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "GetAppServiceCertificateOrderDetectorResponse", nil, "Failure preparing request") + return + } + + resp, err := client.GetAppServiceCertificateOrderDetectorResponseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "GetAppServiceCertificateOrderDetectorResponse", resp, "Failure sending request") + return + } + + result, err = client.GetAppServiceCertificateOrderDetectorResponseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "GetAppServiceCertificateOrderDetectorResponse", resp, "Failure responding to request") + return + } + + return +} + +// GetAppServiceCertificateOrderDetectorResponsePreparer prepares the GetAppServiceCertificateOrderDetectorResponse request. +func (client CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponsePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "detectorName": autorest.Encode("path", detectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors/{detectorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAppServiceCertificateOrderDetectorResponseSender sends the GetAppServiceCertificateOrderDetectorResponse request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAppServiceCertificateOrderDetectorResponseResponder handles the response to the GetAppServiceCertificateOrderDetectorResponse request. The method always +// closes the http.Response Body. +func (client CertificateOrdersDiagnosticsClient) GetAppServiceCertificateOrderDetectorResponseResponder(resp *http.Response) (result DetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListAppServiceCertificateOrderDetectorResponse description for Microsoft.CertificateRegistration to get the list of +// detectors for this RP. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// certificateOrderName - the certificate order name for which the response is needed. +func (client CertificateOrdersDiagnosticsClient) ListAppServiceCertificateOrderDetectorResponse(ctx context.Context, resourceGroupName string, certificateOrderName string) (result DetectorResponseCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateOrdersDiagnosticsClient.ListAppServiceCertificateOrderDetectorResponse") + defer func() { + sc := -1 + if result.drc.Response.Response != nil { + sc = result.drc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.CertificateOrdersDiagnosticsClient", "ListAppServiceCertificateOrderDetectorResponse", err.Error()) + } + + result.fn = client.listAppServiceCertificateOrderDetectorResponseNextResults + req, err := client.ListAppServiceCertificateOrderDetectorResponsePreparer(ctx, resourceGroupName, certificateOrderName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "ListAppServiceCertificateOrderDetectorResponse", nil, "Failure preparing request") + return + } + + resp, err := client.ListAppServiceCertificateOrderDetectorResponseSender(req) + if err != nil { + result.drc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "ListAppServiceCertificateOrderDetectorResponse", resp, "Failure sending request") + return + } + + result.drc, err = client.ListAppServiceCertificateOrderDetectorResponseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "ListAppServiceCertificateOrderDetectorResponse", resp, "Failure responding to request") + return + } + if result.drc.hasNextLink() && result.drc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAppServiceCertificateOrderDetectorResponsePreparer prepares the ListAppServiceCertificateOrderDetectorResponse request. +func (client CertificateOrdersDiagnosticsClient) ListAppServiceCertificateOrderDetectorResponsePreparer(ctx context.Context, resourceGroupName string, certificateOrderName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateOrderName": autorest.Encode("path", certificateOrderName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.CertificateRegistration/certificateOrders/{certificateOrderName}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAppServiceCertificateOrderDetectorResponseSender sends the ListAppServiceCertificateOrderDetectorResponse request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateOrdersDiagnosticsClient) ListAppServiceCertificateOrderDetectorResponseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAppServiceCertificateOrderDetectorResponseResponder handles the response to the ListAppServiceCertificateOrderDetectorResponse request. The method always +// closes the http.Response Body. +func (client CertificateOrdersDiagnosticsClient) ListAppServiceCertificateOrderDetectorResponseResponder(resp *http.Response) (result DetectorResponseCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAppServiceCertificateOrderDetectorResponseNextResults retrieves the next set of results, if any. +func (client CertificateOrdersDiagnosticsClient) listAppServiceCertificateOrderDetectorResponseNextResults(ctx context.Context, lastResults DetectorResponseCollection) (result DetectorResponseCollection, err error) { + req, err := lastResults.detectorResponseCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "listAppServiceCertificateOrderDetectorResponseNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAppServiceCertificateOrderDetectorResponseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "listAppServiceCertificateOrderDetectorResponseNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAppServiceCertificateOrderDetectorResponseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateOrdersDiagnosticsClient", "listAppServiceCertificateOrderDetectorResponseNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAppServiceCertificateOrderDetectorResponseComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificateOrdersDiagnosticsClient) ListAppServiceCertificateOrderDetectorResponseComplete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result DetectorResponseCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateOrdersDiagnosticsClient.ListAppServiceCertificateOrderDetectorResponse") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAppServiceCertificateOrderDetectorResponse(ctx, resourceGroupName, certificateOrderName) + return +} diff --git a/services/web/mgmt/2021-03-01/web/certificateregistrationprovider.go b/services/web/mgmt/2021-03-01/web/certificateregistrationprovider.go new file mode 100644 index 000000000000..f551c2b175c7 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/certificateregistrationprovider.go @@ -0,0 +1,142 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CertificateRegistrationProviderClient is the webSite Management Client +type CertificateRegistrationProviderClient struct { + BaseClient +} + +// NewCertificateRegistrationProviderClient creates an instance of the CertificateRegistrationProviderClient client. +func NewCertificateRegistrationProviderClient(subscriptionID string) CertificateRegistrationProviderClient { + return NewCertificateRegistrationProviderClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificateRegistrationProviderClientWithBaseURI creates an instance of the CertificateRegistrationProviderClient +// client using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI +// (sovereign clouds, Azure stack). +func NewCertificateRegistrationProviderClientWithBaseURI(baseURI string, subscriptionID string) CertificateRegistrationProviderClient { + return CertificateRegistrationProviderClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListOperations description for Implements Csm operations Api to exposes the list of available Csm Apis under the +// resource provider +func (client CertificateRegistrationProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateRegistrationProviderClient.ListOperations") + defer func() { + sc := -1 + if result.coc.Response.Response != nil { + sc = result.coc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOperationsNextResults + req, err := client.ListOperationsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateRegistrationProviderClient", "ListOperations", nil, "Failure preparing request") + return + } + + resp, err := client.ListOperationsSender(req) + if err != nil { + result.coc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificateRegistrationProviderClient", "ListOperations", resp, "Failure sending request") + return + } + + result.coc, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateRegistrationProviderClient", "ListOperations", resp, "Failure responding to request") + return + } + if result.coc.hasNextLink() && result.coc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOperationsPreparer prepares the ListOperations request. +func (client CertificateRegistrationProviderClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.CertificateRegistration/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOperationsSender sends the ListOperations request. The method will close the +// http.Response Body if it receives an error. +func (client CertificateRegistrationProviderClient) ListOperationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOperationsResponder handles the response to the ListOperations request. The method always +// closes the http.Response Body. +func (client CertificateRegistrationProviderClient) ListOperationsResponder(resp *http.Response) (result CsmOperationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOperationsNextResults retrieves the next set of results, if any. +func (client CertificateRegistrationProviderClient) listOperationsNextResults(ctx context.Context, lastResults CsmOperationCollection) (result CsmOperationCollection, err error) { + req, err := lastResults.csmOperationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.CertificateRegistrationProviderClient", "listOperationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.CertificateRegistrationProviderClient", "listOperationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificateRegistrationProviderClient", "listOperationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOperationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificateRegistrationProviderClient) ListOperationsComplete(ctx context.Context) (result CsmOperationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateRegistrationProviderClient.ListOperations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOperations(ctx) + return +} diff --git a/services/web/mgmt/2021-03-01/web/certificates.go b/services/web/mgmt/2021-03-01/web/certificates.go new file mode 100644 index 000000000000..b10e3b7cb595 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/certificates.go @@ -0,0 +1,616 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CertificatesClient is the webSite Management Client +type CertificatesClient struct { + BaseClient +} + +// NewCertificatesClient creates an instance of the CertificatesClient client. +func NewCertificatesClient(subscriptionID string) CertificatesClient { + return NewCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificatesClientWithBaseURI creates an instance of the CertificatesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCertificatesClientWithBaseURI(baseURI string, subscriptionID string) CertificatesClient { + return CertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate description for Create or update a certificate. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the certificate. +// certificateEnvelope - details of certificate, if it exists already. +func (client CertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, certificateEnvelope Certificate) (result Certificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.CertificatesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, certificateEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, certificateEnvelope Certificate) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters), + autorest.WithJSON(certificateEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CertificatesClient) CreateOrUpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete a certificate. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the certificate. +func (client CertificatesClient) Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.CertificatesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CertificatesClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CertificatesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get description for Get a certificate. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the certificate. +func (client CertificatesClient) Get(ctx context.Context, resourceGroupName string, name string) (result Certificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.CertificatesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CertificatesClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CertificatesClient) GetResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all certificates for a subscription. +// Parameters: +// filter - return only information specified in the filter (using OData syntax). For example: +// $filter=KeyVaultId eq 'KeyVaultId' +func (client CertificatesClient) List(ctx context.Context, filter string) (result CertificateCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.List") + defer func() { + sc := -1 + if result.cc.Response.Response != nil { + sc = result.cc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.cc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "List", resp, "Failure sending request") + return + } + + result.cc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "List", resp, "Failure responding to request") + return + } + if result.cc.hasNextLink() && result.cc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client CertificatesClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client CertificatesClient) ListResponder(resp *http.Response) (result CertificateCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client CertificatesClient) listNextResults(ctx context.Context, lastResults CertificateCollection) (result CertificateCollection, err error) { + req, err := lastResults.certificateCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificatesClient) ListComplete(ctx context.Context, filter string) (result CertificateCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} + +// ListByResourceGroup description for Get all certificates in a resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client CertificatesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result CertificateCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cc.Response.Response != nil { + sc = result.cc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.CertificatesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cc, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cc.hasNextLink() && result.cc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client CertificatesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client CertificatesClient) ListByResourceGroupResponder(resp *http.Response) (result CertificateCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client CertificatesClient) listByResourceGroupNextResults(ctx context.Context, lastResults CertificateCollection) (result CertificateCollection, err error) { + req, err := lastResults.certificateCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.CertificatesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client CertificatesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result CertificateCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// Update description for Create or update a certificate. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the certificate. +// certificateEnvelope - details of certificate, if it exists already. +func (client CertificatesClient) Update(ctx context.Context, resourceGroupName string, name string, certificateEnvelope CertificatePatchResource) (result Certificate, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.CertificatesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, certificateEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.CertificatesClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client CertificatesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, certificateEnvelope CertificatePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/certificates/{name}", pathParameters), + autorest.WithJSON(certificateEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client CertificatesClient) UpdateResponder(resp *http.Response) (result Certificate, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/client.go b/services/web/mgmt/2021-03-01/web/client.go new file mode 100644 index 000000000000..5b43dc64f57b --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/client.go @@ -0,0 +1,1622 @@ +// Package web implements the Azure ARM Web service API version 2021-03-01. +// +// WebSite Management Client +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +const ( + // DefaultBaseURI is the default URI used for the service Web + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Web. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} + +// CheckNameAvailability description for Check if a resource name is available. +// Parameters: +// request - name availability request. +func (client BaseClient) CheckNameAvailability(ctx context.Context, request ResourceNameAvailabilityRequest) (result ResourceNameAvailability, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: request, + Constraints: []validation.Constraint{{Target: "request.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.BaseClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, request) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client BaseClient) CheckNameAvailabilityPreparer(ctx context.Context, request ResourceNameAvailabilityRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/checknameavailability", pathParameters), + autorest.WithJSON(request), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client BaseClient) CheckNameAvailabilityResponder(resp *http.Response) (result ResourceNameAvailability, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPublishingUser description for Gets publishing user +func (client BaseClient) GetPublishingUser(ctx context.Context) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetPublishingUser") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPublishingUserPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetPublishingUser", nil, "Failure preparing request") + return + } + + resp, err := client.GetPublishingUserSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetPublishingUser", resp, "Failure sending request") + return + } + + result, err = client.GetPublishingUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetPublishingUser", resp, "Failure responding to request") + return + } + + return +} + +// GetPublishingUserPreparer prepares the GetPublishingUser request. +func (client BaseClient) GetPublishingUserPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPublishingUserSender sends the GetPublishingUser request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetPublishingUserSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetPublishingUserResponder handles the response to the GetPublishingUser request. The method always +// closes the http.Response Body. +func (client BaseClient) GetPublishingUserResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSourceControl description for Gets source control token +// Parameters: +// sourceControlType - type of source control +func (client BaseClient) GetSourceControl(ctx context.Context, sourceControlType string) (result SourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSourceControl") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetSourceControlPreparer(ctx, sourceControlType) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSourceControl", nil, "Failure preparing request") + return + } + + resp, err := client.GetSourceControlSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSourceControl", resp, "Failure sending request") + return + } + + result, err = client.GetSourceControlResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSourceControl", resp, "Failure responding to request") + return + } + + return +} + +// GetSourceControlPreparer prepares the GetSourceControl request. +func (client BaseClient) GetSourceControlPreparer(ctx context.Context, sourceControlType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "sourceControlType": autorest.Encode("path", sourceControlType), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSourceControlSender sends the GetSourceControl request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSourceControlSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetSourceControlResponder handles the response to the GetSourceControl request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSourceControlResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSubscriptionDeploymentLocations description for Gets list of available geo regions plus ministamps +func (client BaseClient) GetSubscriptionDeploymentLocations(ctx context.Context) (result DeploymentLocations, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.GetSubscriptionDeploymentLocations") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetSubscriptionDeploymentLocationsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSubscriptionDeploymentLocations", nil, "Failure preparing request") + return + } + + resp, err := client.GetSubscriptionDeploymentLocationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSubscriptionDeploymentLocations", resp, "Failure sending request") + return + } + + result, err = client.GetSubscriptionDeploymentLocationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "GetSubscriptionDeploymentLocations", resp, "Failure responding to request") + return + } + + return +} + +// GetSubscriptionDeploymentLocationsPreparer prepares the GetSubscriptionDeploymentLocations request. +func (client BaseClient) GetSubscriptionDeploymentLocationsPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deploymentLocations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSubscriptionDeploymentLocationsSender sends the GetSubscriptionDeploymentLocations request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) GetSubscriptionDeploymentLocationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSubscriptionDeploymentLocationsResponder handles the response to the GetSubscriptionDeploymentLocations request. The method always +// closes the http.Response Body. +func (client BaseClient) GetSubscriptionDeploymentLocationsResponder(resp *http.Response) (result DeploymentLocations, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListBillingMeters description for Gets a list of meters for a given location. +// Parameters: +// billingLocation - azure Location of billable resource +// osType - app Service OS type meters used for +func (client BaseClient) ListBillingMeters(ctx context.Context, billingLocation string, osType string) (result BillingMeterCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListBillingMeters") + defer func() { + sc := -1 + if result.bmc.Response.Response != nil { + sc = result.bmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBillingMetersNextResults + req, err := client.ListBillingMetersPreparer(ctx, billingLocation, osType) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListBillingMeters", nil, "Failure preparing request") + return + } + + resp, err := client.ListBillingMetersSender(req) + if err != nil { + result.bmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListBillingMeters", resp, "Failure sending request") + return + } + + result.bmc, err = client.ListBillingMetersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListBillingMeters", resp, "Failure responding to request") + return + } + if result.bmc.hasNextLink() && result.bmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBillingMetersPreparer prepares the ListBillingMeters request. +func (client BaseClient) ListBillingMetersPreparer(ctx context.Context, billingLocation string, osType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(billingLocation) > 0 { + queryParameters["billingLocation"] = autorest.Encode("query", billingLocation) + } + if len(osType) > 0 { + queryParameters["osType"] = autorest.Encode("query", osType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/billingMeters", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBillingMetersSender sends the ListBillingMeters request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListBillingMetersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBillingMetersResponder handles the response to the ListBillingMeters request. The method always +// closes the http.Response Body. +func (client BaseClient) ListBillingMetersResponder(resp *http.Response) (result BillingMeterCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBillingMetersNextResults retrieves the next set of results, if any. +func (client BaseClient) listBillingMetersNextResults(ctx context.Context, lastResults BillingMeterCollection) (result BillingMeterCollection, err error) { + req, err := lastResults.billingMeterCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listBillingMetersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBillingMetersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listBillingMetersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBillingMetersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listBillingMetersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBillingMetersComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListBillingMetersComplete(ctx context.Context, billingLocation string, osType string) (result BillingMeterCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListBillingMeters") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBillingMeters(ctx, billingLocation, osType) + return +} + +// ListCustomHostNameSites sends the list custom host name sites request. +func (client BaseClient) ListCustomHostNameSites(ctx context.Context) (result CustomHostnameSitesCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListCustomHostNameSites") + defer func() { + sc := -1 + if result.chsc.Response.Response != nil { + sc = result.chsc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listCustomHostNameSitesNextResults + req, err := client.ListCustomHostNameSitesPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListCustomHostNameSites", nil, "Failure preparing request") + return + } + + resp, err := client.ListCustomHostNameSitesSender(req) + if err != nil { + result.chsc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListCustomHostNameSites", resp, "Failure sending request") + return + } + + result.chsc, err = client.ListCustomHostNameSitesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListCustomHostNameSites", resp, "Failure responding to request") + return + } + if result.chsc.hasNextLink() && result.chsc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListCustomHostNameSitesPreparer prepares the ListCustomHostNameSites request. +func (client BaseClient) ListCustomHostNameSitesPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/customhostnameSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCustomHostNameSitesSender sends the ListCustomHostNameSites request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListCustomHostNameSitesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCustomHostNameSitesResponder handles the response to the ListCustomHostNameSites request. The method always +// closes the http.Response Body. +func (client BaseClient) ListCustomHostNameSitesResponder(resp *http.Response) (result CustomHostnameSitesCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listCustomHostNameSitesNextResults retrieves the next set of results, if any. +func (client BaseClient) listCustomHostNameSitesNextResults(ctx context.Context, lastResults CustomHostnameSitesCollection) (result CustomHostnameSitesCollection, err error) { + req, err := lastResults.customHostnameSitesCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listCustomHostNameSitesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListCustomHostNameSitesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listCustomHostNameSitesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListCustomHostNameSitesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listCustomHostNameSitesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListCustomHostNameSitesComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListCustomHostNameSitesComplete(ctx context.Context) (result CustomHostnameSitesCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListCustomHostNameSites") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListCustomHostNameSites(ctx) + return +} + +// ListGeoRegions description for Get a list of available geographical regions. +// Parameters: +// sku - name of SKU used to filter the regions. +// linuxWorkersEnabled - specify true if you want to filter to only regions that support Linux +// workers. +// xenonWorkersEnabled - specify true if you want to filter to only regions that support Xenon +// workers. +// linuxDynamicWorkersEnabled - specify true if you want to filter to only regions that support +// Linux Consumption Workers. +func (client BaseClient) ListGeoRegions(ctx context.Context, sku SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (result GeoRegionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListGeoRegions") + defer func() { + sc := -1 + if result.grc.Response.Response != nil { + sc = result.grc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listGeoRegionsNextResults + req, err := client.ListGeoRegionsPreparer(ctx, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListGeoRegions", nil, "Failure preparing request") + return + } + + resp, err := client.ListGeoRegionsSender(req) + if err != nil { + result.grc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListGeoRegions", resp, "Failure sending request") + return + } + + result.grc, err = client.ListGeoRegionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListGeoRegions", resp, "Failure responding to request") + return + } + if result.grc.hasNextLink() && result.grc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListGeoRegionsPreparer prepares the ListGeoRegions request. +func (client BaseClient) ListGeoRegionsPreparer(ctx context.Context, sku SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(sku)) > 0 { + queryParameters["sku"] = autorest.Encode("query", sku) + } + if linuxWorkersEnabled != nil { + queryParameters["linuxWorkersEnabled"] = autorest.Encode("query", *linuxWorkersEnabled) + } + if xenonWorkersEnabled != nil { + queryParameters["xenonWorkersEnabled"] = autorest.Encode("query", *xenonWorkersEnabled) + } + if linuxDynamicWorkersEnabled != nil { + queryParameters["linuxDynamicWorkersEnabled"] = autorest.Encode("query", *linuxDynamicWorkersEnabled) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/geoRegions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListGeoRegionsSender sends the ListGeoRegions request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListGeoRegionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListGeoRegionsResponder handles the response to the ListGeoRegions request. The method always +// closes the http.Response Body. +func (client BaseClient) ListGeoRegionsResponder(resp *http.Response) (result GeoRegionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listGeoRegionsNextResults retrieves the next set of results, if any. +func (client BaseClient) listGeoRegionsNextResults(ctx context.Context, lastResults GeoRegionCollection) (result GeoRegionCollection, err error) { + req, err := lastResults.geoRegionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listGeoRegionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListGeoRegionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listGeoRegionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListGeoRegionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listGeoRegionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListGeoRegionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListGeoRegionsComplete(ctx context.Context, sku SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (result GeoRegionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListGeoRegions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListGeoRegions(ctx, sku, linuxWorkersEnabled, xenonWorkersEnabled, linuxDynamicWorkersEnabled) + return +} + +// ListPremierAddOnOffers description for List all premier add-on offers. +func (client BaseClient) ListPremierAddOnOffers(ctx context.Context) (result PremierAddOnOfferCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListPremierAddOnOffers") + defer func() { + sc := -1 + if result.paooc.Response.Response != nil { + sc = result.paooc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listPremierAddOnOffersNextResults + req, err := client.ListPremierAddOnOffersPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListPremierAddOnOffers", nil, "Failure preparing request") + return + } + + resp, err := client.ListPremierAddOnOffersSender(req) + if err != nil { + result.paooc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListPremierAddOnOffers", resp, "Failure sending request") + return + } + + result.paooc, err = client.ListPremierAddOnOffersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListPremierAddOnOffers", resp, "Failure responding to request") + return + } + if result.paooc.hasNextLink() && result.paooc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPremierAddOnOffersPreparer prepares the ListPremierAddOnOffers request. +func (client BaseClient) ListPremierAddOnOffersPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/premieraddonoffers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPremierAddOnOffersSender sends the ListPremierAddOnOffers request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListPremierAddOnOffersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPremierAddOnOffersResponder handles the response to the ListPremierAddOnOffers request. The method always +// closes the http.Response Body. +func (client BaseClient) ListPremierAddOnOffersResponder(resp *http.Response) (result PremierAddOnOfferCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPremierAddOnOffersNextResults retrieves the next set of results, if any. +func (client BaseClient) listPremierAddOnOffersNextResults(ctx context.Context, lastResults PremierAddOnOfferCollection) (result PremierAddOnOfferCollection, err error) { + req, err := lastResults.premierAddOnOfferCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listPremierAddOnOffersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPremierAddOnOffersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listPremierAddOnOffersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPremierAddOnOffersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listPremierAddOnOffersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPremierAddOnOffersComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListPremierAddOnOffersComplete(ctx context.Context) (result PremierAddOnOfferCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListPremierAddOnOffers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPremierAddOnOffers(ctx) + return +} + +// ListSiteIdentifiersAssignedToHostName description for List all apps that are assigned to a hostname. +// Parameters: +// nameIdentifier - hostname information. +func (client BaseClient) ListSiteIdentifiersAssignedToHostName(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSiteIdentifiersAssignedToHostName") + defer func() { + sc := -1 + if result.ic.Response.Response != nil { + sc = result.ic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSiteIdentifiersAssignedToHostNameNextResults + req, err := client.ListSiteIdentifiersAssignedToHostNamePreparer(ctx, nameIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteIdentifiersAssignedToHostNameSender(req) + if err != nil { + result.ic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", resp, "Failure sending request") + return + } + + result.ic, err = client.ListSiteIdentifiersAssignedToHostNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSiteIdentifiersAssignedToHostName", resp, "Failure responding to request") + return + } + if result.ic.hasNextLink() && result.ic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteIdentifiersAssignedToHostNamePreparer prepares the ListSiteIdentifiersAssignedToHostName request. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNamePreparer(ctx context.Context, nameIdentifier NameIdentifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/listSitesAssignedToHostName", pathParameters), + autorest.WithJSON(nameIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteIdentifiersAssignedToHostNameSender sends the ListSiteIdentifiersAssignedToHostName request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteIdentifiersAssignedToHostNameResponder handles the response to the ListSiteIdentifiersAssignedToHostName request. The method always +// closes the http.Response Body. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNameResponder(resp *http.Response) (result IdentifierCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteIdentifiersAssignedToHostNameNextResults retrieves the next set of results, if any. +func (client BaseClient) listSiteIdentifiersAssignedToHostNameNextResults(ctx context.Context, lastResults IdentifierCollection) (result IdentifierCollection, err error) { + req, err := lastResults.identifierCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteIdentifiersAssignedToHostNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteIdentifiersAssignedToHostNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listSiteIdentifiersAssignedToHostNameNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteIdentifiersAssignedToHostNameComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListSiteIdentifiersAssignedToHostNameComplete(ctx context.Context, nameIdentifier NameIdentifier) (result IdentifierCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSiteIdentifiersAssignedToHostName") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteIdentifiersAssignedToHostName(ctx, nameIdentifier) + return +} + +// ListSkus description for List all SKUs. +func (client BaseClient) ListSkus(ctx context.Context) (result SkuInfos, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSkus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSkusPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSkus", nil, "Failure preparing request") + return + } + + resp, err := client.ListSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSkus", resp, "Failure sending request") + return + } + + result, err = client.ListSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSkus", resp, "Failure responding to request") + return + } + + return +} + +// ListSkusPreparer prepares the ListSkus request. +func (client BaseClient) ListSkusPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSkusSender sends the ListSkus request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSkusResponder handles the response to the ListSkus request. The method always +// closes the http.Response Body. +func (client BaseClient) ListSkusResponder(resp *http.Response) (result SkuInfos, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListSourceControls description for Gets the source controls available for Azure websites. +func (client BaseClient) ListSourceControls(ctx context.Context) (result SourceControlCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSourceControls") + defer func() { + sc := -1 + if result.scc.Response.Response != nil { + sc = result.scc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listSourceControlsNextResults + req, err := client.ListSourceControlsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSourceControls", nil, "Failure preparing request") + return + } + + resp, err := client.ListSourceControlsSender(req) + if err != nil { + result.scc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSourceControls", resp, "Failure sending request") + return + } + + result.scc, err = client.ListSourceControlsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ListSourceControls", resp, "Failure responding to request") + return + } + if result.scc.hasNextLink() && result.scc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSourceControlsPreparer prepares the ListSourceControls request. +func (client BaseClient) ListSourceControlsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/sourcecontrols"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSourceControlsSender sends the ListSourceControls request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ListSourceControlsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListSourceControlsResponder handles the response to the ListSourceControls request. The method always +// closes the http.Response Body. +func (client BaseClient) ListSourceControlsResponder(resp *http.Response) (result SourceControlCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSourceControlsNextResults retrieves the next set of results, if any. +func (client BaseClient) listSourceControlsNextResults(ctx context.Context, lastResults SourceControlCollection) (result SourceControlCollection, err error) { + req, err := lastResults.sourceControlCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSourceControlsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSourceControlsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.BaseClient", "listSourceControlsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSourceControlsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "listSourceControlsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSourceControlsComplete enumerates all values, automatically crossing page boundaries as required. +func (client BaseClient) ListSourceControlsComplete(ctx context.Context) (result SourceControlCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ListSourceControls") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSourceControls(ctx) + return +} + +// Move description for Move resources between resource groups. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// moveResourceEnvelope - object that represents the resource to move. +func (client BaseClient) Move(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Move") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: moveResourceEnvelope, + Constraints: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Pattern, Rule: ` ^[-\w\._\(\)]+[^\.]$`, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.BaseClient", "Move", err.Error()) + } + + req, err := client.MovePreparer(ctx, resourceGroupName, moveResourceEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "Move", nil, "Failure preparing request") + return + } + + resp, err := client.MoveSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.BaseClient", "Move", resp, "Failure sending request") + return + } + + result, err = client.MoveResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "Move", resp, "Failure responding to request") + return + } + + return +} + +// MovePreparer prepares the Move request. +func (client BaseClient) MovePreparer(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/moveResources", pathParameters), + autorest.WithJSON(moveResourceEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// MoveSender sends the Move request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) MoveSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// MoveResponder handles the response to the Move request. The method always +// closes the http.Response Body. +func (client BaseClient) MoveResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdatePublishingUser description for Updates publishing user +// Parameters: +// userDetails - details of publishing user +func (client BaseClient) UpdatePublishingUser(ctx context.Context, userDetails User) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdatePublishingUser") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: userDetails, + Constraints: []validation.Constraint{{Target: "userDetails.UserProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "userDetails.UserProperties.PublishingUserName", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.BaseClient", "UpdatePublishingUser", err.Error()) + } + + req, err := client.UpdatePublishingUserPreparer(ctx, userDetails) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdatePublishingUser", nil, "Failure preparing request") + return + } + + resp, err := client.UpdatePublishingUserSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdatePublishingUser", resp, "Failure sending request") + return + } + + result, err = client.UpdatePublishingUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdatePublishingUser", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePublishingUserPreparer prepares the UpdatePublishingUser request. +func (client BaseClient) UpdatePublishingUserPreparer(ctx context.Context, userDetails User) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/publishingUsers/web"), + autorest.WithJSON(userDetails), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdatePublishingUserSender sends the UpdatePublishingUser request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdatePublishingUserSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdatePublishingUserResponder handles the response to the UpdatePublishingUser request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdatePublishingUserResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateSourceControl description for Updates source control token +// Parameters: +// sourceControlType - type of source control +// requestMessage - source control token information +func (client BaseClient) UpdateSourceControl(ctx context.Context, sourceControlType string, requestMessage SourceControl) (result SourceControl, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.UpdateSourceControl") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdateSourceControlPreparer(ctx, sourceControlType, requestMessage) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdateSourceControl", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSourceControlSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdateSourceControl", resp, "Failure sending request") + return + } + + result, err = client.UpdateSourceControlResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "UpdateSourceControl", resp, "Failure responding to request") + return + } + + return +} + +// UpdateSourceControlPreparer prepares the UpdateSourceControl request. +func (client BaseClient) UpdateSourceControlPreparer(ctx context.Context, sourceControlType string, requestMessage SourceControl) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "sourceControlType": autorest.Encode("path", sourceControlType), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Web/sourcecontrols/{sourceControlType}", pathParameters), + autorest.WithJSON(requestMessage), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSourceControlSender sends the UpdateSourceControl request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) UpdateSourceControlSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// UpdateSourceControlResponder handles the response to the UpdateSourceControl request. The method always +// closes the http.Response Body. +func (client BaseClient) UpdateSourceControlResponder(resp *http.Response) (result SourceControl, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Validate description for Validate if a resource can be created. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// validateRequest - request with the resources to validate. +func (client BaseClient) Validate(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest) (result ValidateResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.Validate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: validateRequest, + Constraints: []validation.Constraint{{Target: "validateRequest.Name", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "validateRequest.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "validateRequest.ValidateProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.Capacity", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.Capacity", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}}}, + {Target: "validateRequest.ValidateProperties.AppServiceEnvironment", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.AppServiceEnvironment.VirtualNetwork", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "validateRequest.ValidateProperties.AppServiceEnvironment.VirtualNetwork.ID", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("web.BaseClient", "Validate", err.Error()) + } + + req, err := client.ValidatePreparer(ctx, resourceGroupName, validateRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "Validate", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "Validate", resp, "Failure sending request") + return + } + + result, err = client.ValidateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "Validate", resp, "Failure responding to request") + return + } + + return +} + +// ValidatePreparer prepares the Validate request. +func (client BaseClient) ValidatePreparer(ctx context.Context, resourceGroupName string, validateRequest ValidateRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/validate", pathParameters), + autorest.WithJSON(validateRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateSender sends the Validate request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ValidateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateResponder handles the response to the Validate request. The method always +// closes the http.Response Body. +func (client BaseClient) ValidateResponder(resp *http.Response) (result ValidateResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateMove description for Validate whether a resource can be moved. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// moveResourceEnvelope - object that represents the resource to move. +func (client BaseClient) ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.ValidateMove") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: moveResourceEnvelope, + Constraints: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "moveResourceEnvelope.TargetResourceGroup", Name: validation.Pattern, Rule: ` ^[-\w\._\(\)]+[^\.]$`, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.BaseClient", "ValidateMove", err.Error()) + } + + req, err := client.ValidateMovePreparer(ctx, resourceGroupName, moveResourceEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateMove", nil, "Failure preparing request") + return + } + + resp, err := client.ValidateMoveSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateMove", resp, "Failure sending request") + return + } + + result, err = client.ValidateMoveResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "ValidateMove", resp, "Failure responding to request") + return + } + + return +} + +// ValidateMovePreparer prepares the ValidateMove request. +func (client BaseClient) ValidateMovePreparer(ctx context.Context, resourceGroupName string, moveResourceEnvelope CsmMoveResourceEnvelope) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/validateMoveResources", pathParameters), + autorest.WithJSON(moveResourceEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateMoveSender sends the ValidateMove request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) ValidateMoveSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ValidateMoveResponder handles the response to the ValidateMove request. The method always +// closes the http.Response Body. +func (client BaseClient) ValidateMoveResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// VerifyHostingEnvironmentVnet description for Verifies if this VNET is compatible with an App Service Environment by +// analyzing the Network Security Group rules. +// Parameters: +// parameters - VNET information +func (client BaseClient) VerifyHostingEnvironmentVnet(ctx context.Context, parameters VnetParameters) (result VnetValidationFailureDetails, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BaseClient.VerifyHostingEnvironmentVnet") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.VerifyHostingEnvironmentVnetPreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "VerifyHostingEnvironmentVnet", nil, "Failure preparing request") + return + } + + resp, err := client.VerifyHostingEnvironmentVnetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.BaseClient", "VerifyHostingEnvironmentVnet", resp, "Failure sending request") + return + } + + result, err = client.VerifyHostingEnvironmentVnetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.BaseClient", "VerifyHostingEnvironmentVnet", resp, "Failure responding to request") + return + } + + return +} + +// VerifyHostingEnvironmentVnetPreparer prepares the VerifyHostingEnvironmentVnet request. +func (client BaseClient) VerifyHostingEnvironmentVnetPreparer(ctx context.Context, parameters VnetParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/verifyHostingEnvironmentVnet", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// VerifyHostingEnvironmentVnetSender sends the VerifyHostingEnvironmentVnet request. The method will close the +// http.Response Body if it receives an error. +func (client BaseClient) VerifyHostingEnvironmentVnetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// VerifyHostingEnvironmentVnetResponder handles the response to the VerifyHostingEnvironmentVnet request. The method always +// closes the http.Response Body. +func (client BaseClient) VerifyHostingEnvironmentVnetResponder(resp *http.Response) (result VnetValidationFailureDetails, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/containerapps.go b/services/web/mgmt/2021-03-01/web/containerapps.go new file mode 100644 index 000000000000..6c999ce689be --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/containerapps.go @@ -0,0 +1,602 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ContainerAppsClient is the webSite Management Client +type ContainerAppsClient struct { + BaseClient +} + +// NewContainerAppsClient creates an instance of the ContainerAppsClient client. +func NewContainerAppsClient(subscriptionID string) ContainerAppsClient { + return NewContainerAppsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerAppsClientWithBaseURI creates an instance of the ContainerAppsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewContainerAppsClientWithBaseURI(baseURI string, subscriptionID string) ContainerAppsClient { + return ContainerAppsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate description for Create or update a Container App. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Container App. +func (client ContainerAppsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, containerAppEnvelope ContainerApp) (result ContainerAppsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, containerAppEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ContainerAppsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, containerAppEnvelope ContainerApp) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name}", pathParameters), + autorest.WithJSON(containerAppEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsClient) CreateOrUpdateSender(req *http.Request) (future ContainerAppsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ContainerAppsClient) CreateOrUpdateResponder(resp *http.Response) (result ContainerApp, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete a Container App. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Container App. +func (client ContainerAppsClient) Delete(ctx context.Context, resourceGroupName string, name string) (result ContainerAppsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ContainerAppsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsClient) DeleteSender(req *http.Request) (future ContainerAppsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ContainerAppsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get sends the get request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Container App. +func (client ContainerAppsClient) Get(ctx context.Context, resourceGroupName string, name string) (result ContainerApp, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ContainerAppsClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ContainerAppsClient) GetResponder(resp *http.Response) (result ContainerApp, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup sends the list by resource group request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client ContainerAppsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ContainerAppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.cac.Response.Response != nil { + sc = result.cac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.cac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.cac, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.cac.hasNextLink() && result.cac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ContainerAppsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ContainerAppsClient) ListByResourceGroupResponder(resp *http.Response) (result ContainerAppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ContainerAppsClient) listByResourceGroupNextResults(ctx context.Context, lastResults ContainerAppCollection) (result ContainerAppCollection, err error) { + req, err := lastResults.containerAppCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ContainerAppsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ContainerAppsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerAppsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ContainerAppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription sends the list by subscription request. +func (client ContainerAppsClient) ListBySubscription(ctx context.Context) (result ContainerAppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.ListBySubscription") + defer func() { + sc := -1 + if result.cac.Response.Response != nil { + sc = result.cac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.cac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.cac, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.cac.hasNextLink() && result.cac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client ContainerAppsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client ContainerAppsClient) ListBySubscriptionResponder(resp *http.Response) (result ContainerAppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client ContainerAppsClient) listBySubscriptionNextResults(ctx context.Context, lastResults ContainerAppCollection) (result ContainerAppCollection, err error) { + req, err := lastResults.containerAppCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ContainerAppsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ContainerAppsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerAppsClient) ListBySubscriptionComplete(ctx context.Context) (result ContainerAppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// ListSecrets sends the list secrets request. +// Parameters: +// name - name of the Container App. +func (client ContainerAppsClient) ListSecrets(ctx context.Context, name string) (result SecretsCollection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsClient.ListSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListSecretsPreparer(ctx, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsClient", "ListSecrets", resp, "Failure responding to request") + return + } + + return +} + +// ListSecretsPreparer prepares the ListSecrets request. +func (client ContainerAppsClient) ListSecretsPreparer(ctx context.Context, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/containerApps/{name}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSecretsSender sends the ListSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsClient) ListSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSecretsResponder handles the response to the ListSecrets request. The method always +// closes the http.Response Body. +func (client ContainerAppsClient) ListSecretsResponder(resp *http.Response) (result SecretsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/containerappsrevisions.go b/services/web/mgmt/2021-03-01/web/containerappsrevisions.go new file mode 100644 index 000000000000..e12a386c7b64 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/containerappsrevisions.go @@ -0,0 +1,500 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ContainerAppsRevisionsClient is the webSite Management Client +type ContainerAppsRevisionsClient struct { + BaseClient +} + +// NewContainerAppsRevisionsClient creates an instance of the ContainerAppsRevisionsClient client. +func NewContainerAppsRevisionsClient(subscriptionID string) ContainerAppsRevisionsClient { + return NewContainerAppsRevisionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewContainerAppsRevisionsClientWithBaseURI creates an instance of the ContainerAppsRevisionsClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewContainerAppsRevisionsClientWithBaseURI(baseURI string, subscriptionID string) ContainerAppsRevisionsClient { + return ContainerAppsRevisionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ActivateRevision sends the activate revision request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// containerAppName - name of the Container App. +// name - name of the Container App Revision to activate +func (client ContainerAppsRevisionsClient) ActivateRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsRevisionsClient.ActivateRevision") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsRevisionsClient", "ActivateRevision", err.Error()) + } + + req, err := client.ActivateRevisionPreparer(ctx, resourceGroupName, containerAppName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "ActivateRevision", nil, "Failure preparing request") + return + } + + resp, err := client.ActivateRevisionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "ActivateRevision", resp, "Failure sending request") + return + } + + result, err = client.ActivateRevisionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "ActivateRevision", resp, "Failure responding to request") + return + } + + return +} + +// ActivateRevisionPreparer prepares the ActivateRevision request. +func (client ContainerAppsRevisionsClient) ActivateRevisionPreparer(ctx context.Context, resourceGroupName string, containerAppName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerAppName": autorest.Encode("path", containerAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name}/activate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ActivateRevisionSender sends the ActivateRevision request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsRevisionsClient) ActivateRevisionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ActivateRevisionResponder handles the response to the ActivateRevision request. The method always +// closes the http.Response Body. +func (client ContainerAppsRevisionsClient) ActivateRevisionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeactivateRevision sends the deactivate revision request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// containerAppName - name of the Container App. +// name - name of the Container App Revision to deactivate +func (client ContainerAppsRevisionsClient) DeactivateRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsRevisionsClient.DeactivateRevision") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsRevisionsClient", "DeactivateRevision", err.Error()) + } + + req, err := client.DeactivateRevisionPreparer(ctx, resourceGroupName, containerAppName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "DeactivateRevision", nil, "Failure preparing request") + return + } + + resp, err := client.DeactivateRevisionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "DeactivateRevision", resp, "Failure sending request") + return + } + + result, err = client.DeactivateRevisionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "DeactivateRevision", resp, "Failure responding to request") + return + } + + return +} + +// DeactivateRevisionPreparer prepares the DeactivateRevision request. +func (client ContainerAppsRevisionsClient) DeactivateRevisionPreparer(ctx context.Context, resourceGroupName string, containerAppName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerAppName": autorest.Encode("path", containerAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name}/deactivate", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeactivateRevisionSender sends the DeactivateRevision request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsRevisionsClient) DeactivateRevisionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeactivateRevisionResponder handles the response to the DeactivateRevision request. The method always +// closes the http.Response Body. +func (client ContainerAppsRevisionsClient) DeactivateRevisionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetRevision sends the get revision request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// containerAppName - name of the Container App. +// name - name of the Container App Revision. +func (client ContainerAppsRevisionsClient) GetRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result Revision, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsRevisionsClient.GetRevision") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsRevisionsClient", "GetRevision", err.Error()) + } + + req, err := client.GetRevisionPreparer(ctx, resourceGroupName, containerAppName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "GetRevision", nil, "Failure preparing request") + return + } + + resp, err := client.GetRevisionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "GetRevision", resp, "Failure sending request") + return + } + + result, err = client.GetRevisionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "GetRevision", resp, "Failure responding to request") + return + } + + return +} + +// GetRevisionPreparer prepares the GetRevision request. +func (client ContainerAppsRevisionsClient) GetRevisionPreparer(ctx context.Context, resourceGroupName string, containerAppName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerAppName": autorest.Encode("path", containerAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRevisionSender sends the GetRevision request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsRevisionsClient) GetRevisionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRevisionResponder handles the response to the GetRevision request. The method always +// closes the http.Response Body. +func (client ContainerAppsRevisionsClient) GetRevisionResponder(resp *http.Response) (result Revision, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListRevisions sends the list revisions request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// containerAppName - name of the Container App for which Revisions are needed. +func (client ContainerAppsRevisionsClient) ListRevisions(ctx context.Context, resourceGroupName string, containerAppName string) (result RevisionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsRevisionsClient.ListRevisions") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsRevisionsClient", "ListRevisions", err.Error()) + } + + result.fn = client.listRevisionsNextResults + req, err := client.ListRevisionsPreparer(ctx, resourceGroupName, containerAppName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "ListRevisions", nil, "Failure preparing request") + return + } + + resp, err := client.ListRevisionsSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "ListRevisions", resp, "Failure sending request") + return + } + + result.rc, err = client.ListRevisionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "ListRevisions", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListRevisionsPreparer prepares the ListRevisions request. +func (client ContainerAppsRevisionsClient) ListRevisionsPreparer(ctx context.Context, resourceGroupName string, containerAppName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerAppName": autorest.Encode("path", containerAppName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRevisionsSender sends the ListRevisions request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsRevisionsClient) ListRevisionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRevisionsResponder handles the response to the ListRevisions request. The method always +// closes the http.Response Body. +func (client ContainerAppsRevisionsClient) ListRevisionsResponder(resp *http.Response) (result RevisionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listRevisionsNextResults retrieves the next set of results, if any. +func (client ContainerAppsRevisionsClient) listRevisionsNextResults(ctx context.Context, lastResults RevisionCollection) (result RevisionCollection, err error) { + req, err := lastResults.revisionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "listRevisionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListRevisionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "listRevisionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListRevisionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "listRevisionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListRevisionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ContainerAppsRevisionsClient) ListRevisionsComplete(ctx context.Context, resourceGroupName string, containerAppName string) (result RevisionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsRevisionsClient.ListRevisions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListRevisions(ctx, resourceGroupName, containerAppName) + return +} + +// RestartRevision sends the restart revision request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// containerAppName - name of the Container App. +// name - name of the Container App Revision to restart +func (client ContainerAppsRevisionsClient) RestartRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppsRevisionsClient.RestartRevision") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ContainerAppsRevisionsClient", "RestartRevision", err.Error()) + } + + req, err := client.RestartRevisionPreparer(ctx, resourceGroupName, containerAppName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "RestartRevision", nil, "Failure preparing request") + return + } + + resp, err := client.RestartRevisionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "RestartRevision", resp, "Failure sending request") + return + } + + result, err = client.RestartRevisionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsRevisionsClient", "RestartRevision", resp, "Failure responding to request") + return + } + + return +} + +// RestartRevisionPreparer prepares the RestartRevision request. +func (client ContainerAppsRevisionsClient) RestartRevisionPreparer(ctx context.Context, resourceGroupName string, containerAppName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "containerAppName": autorest.Encode("path", containerAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/containerApps/{containerAppName}/revisions/{name}/restart", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RestartRevisionSender sends the RestartRevision request. The method will close the +// http.Response Body if it receives an error. +func (client ContainerAppsRevisionsClient) RestartRevisionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RestartRevisionResponder handles the response to the RestartRevision request. The method always +// closes the http.Response Body. +func (client ContainerAppsRevisionsClient) RestartRevisionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/web/mgmt/2021-03-01/web/deletedwebapps.go b/services/web/mgmt/2021-03-01/web/deletedwebapps.go new file mode 100644 index 000000000000..8bd440611dba --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/deletedwebapps.go @@ -0,0 +1,333 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DeletedWebAppsClient is the webSite Management Client +type DeletedWebAppsClient struct { + BaseClient +} + +// NewDeletedWebAppsClient creates an instance of the DeletedWebAppsClient client. +func NewDeletedWebAppsClient(subscriptionID string) DeletedWebAppsClient { + return NewDeletedWebAppsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDeletedWebAppsClientWithBaseURI creates an instance of the DeletedWebAppsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDeletedWebAppsClientWithBaseURI(baseURI string, subscriptionID string) DeletedWebAppsClient { + return DeletedWebAppsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetDeletedWebAppByLocation description for Get deleted app for a subscription at location. +// Parameters: +// deletedSiteID - the numeric ID of the deleted app, e.g. 12345 +func (client DeletedWebAppsClient) GetDeletedWebAppByLocation(ctx context.Context, location string, deletedSiteID string) (result DeletedSite, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.GetDeletedWebAppByLocation") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetDeletedWebAppByLocationPreparer(ctx, location, deletedSiteID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "GetDeletedWebAppByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedWebAppByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "GetDeletedWebAppByLocation", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedWebAppByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "GetDeletedWebAppByLocation", resp, "Failure responding to request") + return + } + + return +} + +// GetDeletedWebAppByLocationPreparer prepares the GetDeletedWebAppByLocation request. +func (client DeletedWebAppsClient) GetDeletedWebAppByLocationPreparer(ctx context.Context, location string, deletedSiteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deletedSiteId": autorest.Encode("path", deletedSiteID), + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites/{deletedSiteId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedWebAppByLocationSender sends the GetDeletedWebAppByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedWebAppsClient) GetDeletedWebAppByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDeletedWebAppByLocationResponder handles the response to the GetDeletedWebAppByLocation request. The method always +// closes the http.Response Body. +func (client DeletedWebAppsClient) GetDeletedWebAppByLocationResponder(resp *http.Response) (result DeletedSite, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all deleted apps for a subscription. +func (client DeletedWebAppsClient) List(ctx context.Context) (result DeletedWebAppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.List") + defer func() { + sc := -1 + if result.dwac.Response.Response != nil { + sc = result.dwac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dwac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "List", resp, "Failure sending request") + return + } + + result.dwac, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "List", resp, "Failure responding to request") + return + } + if result.dwac.hasNextLink() && result.dwac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DeletedWebAppsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedWebAppsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DeletedWebAppsClient) ListResponder(resp *http.Response) (result DeletedWebAppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DeletedWebAppsClient) listNextResults(ctx context.Context, lastResults DeletedWebAppCollection) (result DeletedWebAppCollection, err error) { + req, err := lastResults.deletedWebAppCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DeletedWebAppsClient) ListComplete(ctx context.Context) (result DeletedWebAppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByLocation description for Get all deleted apps for a subscription at location +func (client DeletedWebAppsClient) ListByLocation(ctx context.Context, location string) (result DeletedWebAppCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.ListByLocation") + defer func() { + sc := -1 + if result.dwac.Response.Response != nil { + sc = result.dwac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByLocationNextResults + req, err := client.ListByLocationPreparer(ctx, location) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.dwac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "ListByLocation", resp, "Failure sending request") + return + } + + result.dwac, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "ListByLocation", resp, "Failure responding to request") + return + } + if result.dwac.hasNextLink() && result.dwac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client DeletedWebAppsClient) ListByLocationPreparer(ctx context.Context, location string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/deletedSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client DeletedWebAppsClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client DeletedWebAppsClient) ListByLocationResponder(resp *http.Response) (result DeletedWebAppCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLocationNextResults retrieves the next set of results, if any. +func (client DeletedWebAppsClient) listByLocationNextResults(ctx context.Context, lastResults DeletedWebAppCollection) (result DeletedWebAppCollection, err error) { + req, err := lastResults.deletedWebAppCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "listByLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "listByLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DeletedWebAppsClient", "listByLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client DeletedWebAppsClient) ListByLocationComplete(ctx context.Context, location string) (result DeletedWebAppCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppsClient.ListByLocation") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLocation(ctx, location) + return +} diff --git a/services/web/mgmt/2021-03-01/web/diagnostics.go b/services/web/mgmt/2021-03-01/web/diagnostics.go new file mode 100644 index 000000000000..43988e0c81c4 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/diagnostics.go @@ -0,0 +1,2434 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DiagnosticsClient is the webSite Management Client +type DiagnosticsClient struct { + BaseClient +} + +// NewDiagnosticsClient creates an instance of the DiagnosticsClient client. +func NewDiagnosticsClient(subscriptionID string) DiagnosticsClient { + return NewDiagnosticsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDiagnosticsClientWithBaseURI creates an instance of the DiagnosticsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDiagnosticsClientWithBaseURI(baseURI string, subscriptionID string) DiagnosticsClient { + return DiagnosticsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ExecuteSiteAnalysis description for Execute Analysis +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - category Name +// analysisName - analysis Resource Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) ExecuteSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticAnalysis, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ExecuteSiteAnalysis") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteAnalysis", err.Error()) + } + + req, err := client.ExecuteSiteAnalysisPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysis", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSiteAnalysisSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysis", resp, "Failure sending request") + return + } + + result, err = client.ExecuteSiteAnalysisResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysis", resp, "Failure responding to request") + return + } + + return +} + +// ExecuteSiteAnalysisPreparer prepares the ExecuteSiteAnalysis request. +func (client DiagnosticsClient) ExecuteSiteAnalysisPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "analysisName": autorest.Encode("path", analysisName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteSiteAnalysisSender sends the ExecuteSiteAnalysis request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ExecuteSiteAnalysisSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExecuteSiteAnalysisResponder handles the response to the ExecuteSiteAnalysis request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ExecuteSiteAnalysisResponder(resp *http.Response) (result DiagnosticAnalysis, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ExecuteSiteAnalysisSlot description for Execute Analysis +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - category Name +// analysisName - analysis Resource Name +// slot - slot Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) ExecuteSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticAnalysis, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ExecuteSiteAnalysisSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteAnalysisSlot", err.Error()) + } + + req, err := client.ExecuteSiteAnalysisSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, slot, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysisSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSiteAnalysisSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysisSlot", resp, "Failure sending request") + return + } + + result, err = client.ExecuteSiteAnalysisSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteAnalysisSlot", resp, "Failure responding to request") + return + } + + return +} + +// ExecuteSiteAnalysisSlotPreparer prepares the ExecuteSiteAnalysisSlot request. +func (client DiagnosticsClient) ExecuteSiteAnalysisSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "analysisName": autorest.Encode("path", analysisName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}/execute", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteSiteAnalysisSlotSender sends the ExecuteSiteAnalysisSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ExecuteSiteAnalysisSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExecuteSiteAnalysisSlotResponder handles the response to the ExecuteSiteAnalysisSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ExecuteSiteAnalysisSlotResponder(resp *http.Response) (result DiagnosticAnalysis, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ExecuteSiteDetector description for Execute Detector +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// detectorName - detector Resource Name +// diagnosticCategory - category Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) ExecuteSiteDetector(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticDetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ExecuteSiteDetector") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteDetector", err.Error()) + } + + req, err := client.ExecuteSiteDetectorPreparer(ctx, resourceGroupName, siteName, detectorName, diagnosticCategory, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteDetector", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSiteDetectorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteDetector", resp, "Failure sending request") + return + } + + result, err = client.ExecuteSiteDetectorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteDetector", resp, "Failure responding to request") + return + } + + return +} + +// ExecuteSiteDetectorPreparer prepares the ExecuteSiteDetector request. +func (client DiagnosticsClient) ExecuteSiteDetectorPreparer(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteSiteDetectorSender sends the ExecuteSiteDetector request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ExecuteSiteDetectorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExecuteSiteDetectorResponder handles the response to the ExecuteSiteDetector request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ExecuteSiteDetectorResponder(resp *http.Response) (result DiagnosticDetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ExecuteSiteDetectorSlot description for Execute Detector +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// detectorName - detector Resource Name +// diagnosticCategory - category Name +// slot - slot Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) ExecuteSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DiagnosticDetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ExecuteSiteDetectorSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ExecuteSiteDetectorSlot", err.Error()) + } + + req, err := client.ExecuteSiteDetectorSlotPreparer(ctx, resourceGroupName, siteName, detectorName, diagnosticCategory, slot, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteDetectorSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ExecuteSiteDetectorSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteDetectorSlot", resp, "Failure sending request") + return + } + + result, err = client.ExecuteSiteDetectorSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ExecuteSiteDetectorSlot", resp, "Failure responding to request") + return + } + + return +} + +// ExecuteSiteDetectorSlotPreparer prepares the ExecuteSiteDetectorSlot request. +func (client DiagnosticsClient) ExecuteSiteDetectorSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}/execute", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExecuteSiteDetectorSlotSender sends the ExecuteSiteDetectorSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ExecuteSiteDetectorSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExecuteSiteDetectorSlotResponder handles the response to the ExecuteSiteDetectorSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ExecuteSiteDetectorSlotResponder(resp *http.Response) (result DiagnosticDetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetHostingEnvironmentDetectorResponse description for Get Hosting Environment Detector Response +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - app Service Environment Name +// detectorName - detector Resource Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) GetHostingEnvironmentDetectorResponse(ctx context.Context, resourceGroupName string, name string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetHostingEnvironmentDetectorResponse") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetHostingEnvironmentDetectorResponse", err.Error()) + } + + req, err := client.GetHostingEnvironmentDetectorResponsePreparer(ctx, resourceGroupName, name, detectorName, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetHostingEnvironmentDetectorResponse", nil, "Failure preparing request") + return + } + + resp, err := client.GetHostingEnvironmentDetectorResponseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetHostingEnvironmentDetectorResponse", resp, "Failure sending request") + return + } + + result, err = client.GetHostingEnvironmentDetectorResponseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetHostingEnvironmentDetectorResponse", resp, "Failure responding to request") + return + } + + return +} + +// GetHostingEnvironmentDetectorResponsePreparer prepares the GetHostingEnvironmentDetectorResponse request. +func (client DiagnosticsClient) GetHostingEnvironmentDetectorResponsePreparer(ctx context.Context, resourceGroupName string, name string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors/{detectorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetHostingEnvironmentDetectorResponseSender sends the GetHostingEnvironmentDetectorResponse request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetHostingEnvironmentDetectorResponseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetHostingEnvironmentDetectorResponseResponder handles the response to the GetHostingEnvironmentDetectorResponse request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetHostingEnvironmentDetectorResponseResponder(resp *http.Response) (result DetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteAnalysis description for Get Site Analysis +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// analysisName - analysis Name +func (client DiagnosticsClient) GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (result AnalysisDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteAnalysis") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteAnalysis", err.Error()) + } + + req, err := client.GetSiteAnalysisPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteAnalysis", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteAnalysisSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteAnalysis", resp, "Failure sending request") + return + } + + result, err = client.GetSiteAnalysisResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteAnalysis", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteAnalysisPreparer prepares the GetSiteAnalysis request. +func (client DiagnosticsClient) GetSiteAnalysisPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "analysisName": autorest.Encode("path", analysisName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses/{analysisName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteAnalysisSender sends the GetSiteAnalysis request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteAnalysisSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteAnalysisResponder handles the response to the GetSiteAnalysis request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteAnalysisResponder(resp *http.Response) (result AnalysisDefinition, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteAnalysisSlot description for Get Site Analysis +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// analysisName - analysis Name +// slot - slot - optional +func (client DiagnosticsClient) GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (result AnalysisDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteAnalysisSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteAnalysisSlot", err.Error()) + } + + req, err := client.GetSiteAnalysisSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, analysisName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteAnalysisSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteAnalysisSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteAnalysisSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSiteAnalysisSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteAnalysisSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteAnalysisSlotPreparer prepares the GetSiteAnalysisSlot request. +func (client DiagnosticsClient) GetSiteAnalysisSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "analysisName": autorest.Encode("path", analysisName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses/{analysisName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteAnalysisSlotSender sends the GetSiteAnalysisSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteAnalysisSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteAnalysisSlotResponder handles the response to the GetSiteAnalysisSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteAnalysisSlotResponder(resp *http.Response) (result AnalysisDefinition, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteDetector description for Get Detector +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// detectorName - detector Name +func (client DiagnosticsClient) GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result DetectorDefinitionResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetector") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetector", err.Error()) + } + + req, err := client.GetSiteDetectorPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetector", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteDetectorSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetector", resp, "Failure sending request") + return + } + + result, err = client.GetSiteDetectorResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetector", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteDetectorPreparer prepares the GetSiteDetector request. +func (client DiagnosticsClient) GetSiteDetectorPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors/{detectorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteDetectorSender sends the GetSiteDetector request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteDetectorSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteDetectorResponder handles the response to the GetSiteDetector request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteDetectorResponder(resp *http.Response) (result DetectorDefinitionResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteDetectorResponse description for Get site detector response +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// detectorName - detector Resource Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) GetSiteDetectorResponse(ctx context.Context, resourceGroupName string, siteName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetectorResponse") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetectorResponse", err.Error()) + } + + req, err := client.GetSiteDetectorResponsePreparer(ctx, resourceGroupName, siteName, detectorName, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorResponse", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteDetectorResponseSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorResponse", resp, "Failure sending request") + return + } + + result, err = client.GetSiteDetectorResponseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorResponse", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteDetectorResponsePreparer prepares the GetSiteDetectorResponse request. +func (client DiagnosticsClient) GetSiteDetectorResponsePreparer(ctx context.Context, resourceGroupName string, siteName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors/{detectorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteDetectorResponseSender sends the GetSiteDetectorResponse request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteDetectorResponseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteDetectorResponseResponder handles the response to the GetSiteDetectorResponse request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteDetectorResponseResponder(resp *http.Response) (result DetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteDetectorResponseSlot description for Get site detector response +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// detectorName - detector Resource Name +// slot - slot Name +// startTime - start Time +// endTime - end Time +// timeGrain - time Grain +func (client DiagnosticsClient) GetSiteDetectorResponseSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result DetectorResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetectorResponseSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: timeGrain, + Constraints: []validation.Constraint{{Target: "timeGrain", Name: validation.Empty, Rule: false, + Chain: []validation.Constraint{{Target: "timeGrain", Name: validation.Pattern, Rule: `PT[1-9][0-9]+[SMH]`, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetectorResponseSlot", err.Error()) + } + + req, err := client.GetSiteDetectorResponseSlotPreparer(ctx, resourceGroupName, siteName, detectorName, slot, startTime, endTime, timeGrain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorResponseSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteDetectorResponseSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorResponseSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSiteDetectorResponseSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorResponseSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteDetectorResponseSlotPreparer prepares the GetSiteDetectorResponseSlot request. +func (client DiagnosticsClient) GetSiteDetectorResponseSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, detectorName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if startTime != nil { + queryParameters["startTime"] = autorest.Encode("query", *startTime) + } + if endTime != nil { + queryParameters["endTime"] = autorest.Encode("query", *endTime) + } + if len(timeGrain) > 0 { + queryParameters["timeGrain"] = autorest.Encode("query", timeGrain) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors/{detectorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteDetectorResponseSlotSender sends the GetSiteDetectorResponseSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteDetectorResponseSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteDetectorResponseSlotResponder handles the response to the GetSiteDetectorResponseSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteDetectorResponseSlotResponder(resp *http.Response) (result DetectorResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteDetectorSlot description for Get Detector +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// detectorName - detector Name +// slot - slot Name +func (client DiagnosticsClient) GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result DetectorDefinitionResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDetectorSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDetectorSlot", err.Error()) + } + + req, err := client.GetSiteDetectorSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, detectorName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteDetectorSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot", resp, "Failure sending request") + return + } + + result, err = client.GetSiteDetectorSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDetectorSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteDetectorSlotPreparer prepares the GetSiteDetectorSlot request. +func (client DiagnosticsClient) GetSiteDetectorSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "detectorName": autorest.Encode("path", detectorName), + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors/{detectorName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteDetectorSlotSender sends the GetSiteDetectorSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteDetectorSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteDetectorSlotResponder handles the response to the GetSiteDetectorSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteDetectorSlotResponder(resp *http.Response) (result DetectorDefinitionResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteDiagnosticCategory description for Get Diagnostics Category +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +func (client DiagnosticsClient) GetSiteDiagnosticCategory(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result DiagnosticCategory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDiagnosticCategory") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDiagnosticCategory", err.Error()) + } + + req, err := client.GetSiteDiagnosticCategoryPreparer(ctx, resourceGroupName, siteName, diagnosticCategory) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategory", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteDiagnosticCategorySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategory", resp, "Failure sending request") + return + } + + result, err = client.GetSiteDiagnosticCategoryResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategory", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteDiagnosticCategoryPreparer prepares the GetSiteDiagnosticCategory request. +func (client DiagnosticsClient) GetSiteDiagnosticCategoryPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteDiagnosticCategorySender sends the GetSiteDiagnosticCategory request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteDiagnosticCategorySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteDiagnosticCategoryResponder handles the response to the GetSiteDiagnosticCategory request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteDiagnosticCategoryResponder(resp *http.Response) (result DiagnosticCategory, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSiteDiagnosticCategorySlot description for Get Diagnostics Category +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// slot - slot Name +func (client DiagnosticsClient) GetSiteDiagnosticCategorySlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result DiagnosticCategory, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.GetSiteDiagnosticCategorySlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "GetSiteDiagnosticCategorySlot", err.Error()) + } + + req, err := client.GetSiteDiagnosticCategorySlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategorySlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetSiteDiagnosticCategorySlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategorySlot", resp, "Failure sending request") + return + } + + result, err = client.GetSiteDiagnosticCategorySlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "GetSiteDiagnosticCategorySlot", resp, "Failure responding to request") + return + } + + return +} + +// GetSiteDiagnosticCategorySlotPreparer prepares the GetSiteDiagnosticCategorySlot request. +func (client DiagnosticsClient) GetSiteDiagnosticCategorySlotPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSiteDiagnosticCategorySlotSender sends the GetSiteDiagnosticCategorySlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) GetSiteDiagnosticCategorySlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSiteDiagnosticCategorySlotResponder handles the response to the GetSiteDiagnosticCategorySlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) GetSiteDiagnosticCategorySlotResponder(resp *http.Response) (result DiagnosticCategory, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListHostingEnvironmentDetectorResponses description for List Hosting Environment Detector Responses +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - site Name +func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponses(ctx context.Context, resourceGroupName string, name string) (result DetectorResponseCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListHostingEnvironmentDetectorResponses") + defer func() { + sc := -1 + if result.drc.Response.Response != nil { + sc = result.drc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListHostingEnvironmentDetectorResponses", err.Error()) + } + + result.fn = client.listHostingEnvironmentDetectorResponsesNextResults + req, err := client.ListHostingEnvironmentDetectorResponsesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListHostingEnvironmentDetectorResponses", nil, "Failure preparing request") + return + } + + resp, err := client.ListHostingEnvironmentDetectorResponsesSender(req) + if err != nil { + result.drc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListHostingEnvironmentDetectorResponses", resp, "Failure sending request") + return + } + + result.drc, err = client.ListHostingEnvironmentDetectorResponsesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListHostingEnvironmentDetectorResponses", resp, "Failure responding to request") + return + } + if result.drc.hasNextLink() && result.drc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListHostingEnvironmentDetectorResponsesPreparer prepares the ListHostingEnvironmentDetectorResponses request. +func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponsesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{name}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHostingEnvironmentDetectorResponsesSender sends the ListHostingEnvironmentDetectorResponses request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponsesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHostingEnvironmentDetectorResponsesResponder handles the response to the ListHostingEnvironmentDetectorResponses request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponsesResponder(resp *http.Response) (result DetectorResponseCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHostingEnvironmentDetectorResponsesNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listHostingEnvironmentDetectorResponsesNextResults(ctx context.Context, lastResults DetectorResponseCollection) (result DetectorResponseCollection, err error) { + req, err := lastResults.detectorResponseCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listHostingEnvironmentDetectorResponsesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHostingEnvironmentDetectorResponsesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listHostingEnvironmentDetectorResponsesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHostingEnvironmentDetectorResponsesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listHostingEnvironmentDetectorResponsesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHostingEnvironmentDetectorResponsesComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListHostingEnvironmentDetectorResponsesComplete(ctx context.Context, resourceGroupName string, name string) (result DetectorResponseCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListHostingEnvironmentDetectorResponses") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListHostingEnvironmentDetectorResponses(ctx, resourceGroupName, name) + return +} + +// ListSiteAnalyses description for Get Site Analyses +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +func (client DiagnosticsClient) ListSiteAnalyses(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result DiagnosticAnalysisCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteAnalyses") + defer func() { + sc := -1 + if result.dac.Response.Response != nil { + sc = result.dac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteAnalyses", err.Error()) + } + + result.fn = client.listSiteAnalysesNextResults + req, err := client.ListSiteAnalysesPreparer(ctx, resourceGroupName, siteName, diagnosticCategory) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteAnalyses", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteAnalysesSender(req) + if err != nil { + result.dac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteAnalyses", resp, "Failure sending request") + return + } + + result.dac, err = client.ListSiteAnalysesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteAnalyses", resp, "Failure responding to request") + return + } + if result.dac.hasNextLink() && result.dac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteAnalysesPreparer prepares the ListSiteAnalyses request. +func (client DiagnosticsClient) ListSiteAnalysesPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/analyses", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteAnalysesSender sends the ListSiteAnalyses request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteAnalysesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteAnalysesResponder handles the response to the ListSiteAnalyses request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteAnalysesResponder(resp *http.Response) (result DiagnosticAnalysisCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteAnalysesNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteAnalysesNextResults(ctx context.Context, lastResults DiagnosticAnalysisCollection) (result DiagnosticAnalysisCollection, err error) { + req, err := lastResults.diagnosticAnalysisCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteAnalysesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteAnalysesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteAnalysesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteAnalysesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteAnalysesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteAnalysesComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteAnalysesComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result DiagnosticAnalysisCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteAnalyses") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteAnalyses(ctx, resourceGroupName, siteName, diagnosticCategory) + return +} + +// ListSiteAnalysesSlot description for Get Site Analyses +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// slot - slot Name +func (client DiagnosticsClient) ListSiteAnalysesSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result DiagnosticAnalysisCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteAnalysesSlot") + defer func() { + sc := -1 + if result.dac.Response.Response != nil { + sc = result.dac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteAnalysesSlot", err.Error()) + } + + result.fn = client.listSiteAnalysesSlotNextResults + req, err := client.ListSiteAnalysesSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteAnalysesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteAnalysesSlotSender(req) + if err != nil { + result.dac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteAnalysesSlot", resp, "Failure sending request") + return + } + + result.dac, err = client.ListSiteAnalysesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteAnalysesSlot", resp, "Failure responding to request") + return + } + if result.dac.hasNextLink() && result.dac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteAnalysesSlotPreparer prepares the ListSiteAnalysesSlot request. +func (client DiagnosticsClient) ListSiteAnalysesSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/analyses", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteAnalysesSlotSender sends the ListSiteAnalysesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteAnalysesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteAnalysesSlotResponder handles the response to the ListSiteAnalysesSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteAnalysesSlotResponder(resp *http.Response) (result DiagnosticAnalysisCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteAnalysesSlotNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteAnalysesSlotNextResults(ctx context.Context, lastResults DiagnosticAnalysisCollection) (result DiagnosticAnalysisCollection, err error) { + req, err := lastResults.diagnosticAnalysisCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteAnalysesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteAnalysesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteAnalysesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteAnalysesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteAnalysesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteAnalysesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteAnalysesSlotComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result DiagnosticAnalysisCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteAnalysesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteAnalysesSlot(ctx, resourceGroupName, siteName, diagnosticCategory, slot) + return +} + +// ListSiteDetectorResponses description for List Site Detector Responses +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +func (client DiagnosticsClient) ListSiteDetectorResponses(ctx context.Context, resourceGroupName string, siteName string) (result DetectorResponseCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectorResponses") + defer func() { + sc := -1 + if result.drc.Response.Response != nil { + sc = result.drc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDetectorResponses", err.Error()) + } + + result.fn = client.listSiteDetectorResponsesNextResults + req, err := client.ListSiteDetectorResponsesPreparer(ctx, resourceGroupName, siteName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorResponses", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteDetectorResponsesSender(req) + if err != nil { + result.drc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorResponses", resp, "Failure sending request") + return + } + + result.drc, err = client.ListSiteDetectorResponsesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorResponses", resp, "Failure responding to request") + return + } + if result.drc.hasNextLink() && result.drc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteDetectorResponsesPreparer prepares the ListSiteDetectorResponses request. +func (client DiagnosticsClient) ListSiteDetectorResponsesPreparer(ctx context.Context, resourceGroupName string, siteName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteDetectorResponsesSender sends the ListSiteDetectorResponses request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteDetectorResponsesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteDetectorResponsesResponder handles the response to the ListSiteDetectorResponses request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteDetectorResponsesResponder(resp *http.Response) (result DetectorResponseCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteDetectorResponsesNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteDetectorResponsesNextResults(ctx context.Context, lastResults DetectorResponseCollection) (result DetectorResponseCollection, err error) { + req, err := lastResults.detectorResponseCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorResponsesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteDetectorResponsesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorResponsesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteDetectorResponsesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorResponsesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteDetectorResponsesComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteDetectorResponsesComplete(ctx context.Context, resourceGroupName string, siteName string) (result DetectorResponseCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectorResponses") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteDetectorResponses(ctx, resourceGroupName, siteName) + return +} + +// ListSiteDetectorResponsesSlot description for List Site Detector Responses +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// slot - slot Name +func (client DiagnosticsClient) ListSiteDetectorResponsesSlot(ctx context.Context, resourceGroupName string, siteName string, slot string) (result DetectorResponseCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectorResponsesSlot") + defer func() { + sc := -1 + if result.drc.Response.Response != nil { + sc = result.drc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDetectorResponsesSlot", err.Error()) + } + + result.fn = client.listSiteDetectorResponsesSlotNextResults + req, err := client.ListSiteDetectorResponsesSlotPreparer(ctx, resourceGroupName, siteName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorResponsesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteDetectorResponsesSlotSender(req) + if err != nil { + result.drc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorResponsesSlot", resp, "Failure sending request") + return + } + + result.drc, err = client.ListSiteDetectorResponsesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorResponsesSlot", resp, "Failure responding to request") + return + } + if result.drc.hasNextLink() && result.drc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteDetectorResponsesSlotPreparer prepares the ListSiteDetectorResponsesSlot request. +func (client DiagnosticsClient) ListSiteDetectorResponsesSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteDetectorResponsesSlotSender sends the ListSiteDetectorResponsesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteDetectorResponsesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteDetectorResponsesSlotResponder handles the response to the ListSiteDetectorResponsesSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteDetectorResponsesSlotResponder(resp *http.Response) (result DetectorResponseCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteDetectorResponsesSlotNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteDetectorResponsesSlotNextResults(ctx context.Context, lastResults DetectorResponseCollection) (result DetectorResponseCollection, err error) { + req, err := lastResults.detectorResponseCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorResponsesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteDetectorResponsesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorResponsesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteDetectorResponsesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorResponsesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteDetectorResponsesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteDetectorResponsesSlotComplete(ctx context.Context, resourceGroupName string, siteName string, slot string) (result DetectorResponseCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectorResponsesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteDetectorResponsesSlot(ctx, resourceGroupName, siteName, slot) + return +} + +// ListSiteDetectors description for Get Detectors +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +func (client DiagnosticsClient) ListSiteDetectors(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result DiagnosticDetectorCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectors") + defer func() { + sc := -1 + if result.ddc.Response.Response != nil { + sc = result.ddc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDetectors", err.Error()) + } + + result.fn = client.listSiteDetectorsNextResults + req, err := client.ListSiteDetectorsPreparer(ctx, resourceGroupName, siteName, diagnosticCategory) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectors", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteDetectorsSender(req) + if err != nil { + result.ddc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectors", resp, "Failure sending request") + return + } + + result.ddc, err = client.ListSiteDetectorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectors", resp, "Failure responding to request") + return + } + if result.ddc.hasNextLink() && result.ddc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteDetectorsPreparer prepares the ListSiteDetectors request. +func (client DiagnosticsClient) ListSiteDetectorsPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics/{diagnosticCategory}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteDetectorsSender sends the ListSiteDetectors request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteDetectorsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteDetectorsResponder handles the response to the ListSiteDetectors request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteDetectorsResponder(resp *http.Response) (result DiagnosticDetectorCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteDetectorsNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteDetectorsNextResults(ctx context.Context, lastResults DiagnosticDetectorCollection) (result DiagnosticDetectorCollection, err error) { + req, err := lastResults.diagnosticDetectorCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteDetectorsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteDetectorsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteDetectorsComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteDetectorsComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result DiagnosticDetectorCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectors") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteDetectors(ctx, resourceGroupName, siteName, diagnosticCategory) + return +} + +// ListSiteDetectorsSlot description for Get Detectors +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// diagnosticCategory - diagnostic Category +// slot - slot Name +func (client DiagnosticsClient) ListSiteDetectorsSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result DiagnosticDetectorCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectorsSlot") + defer func() { + sc := -1 + if result.ddc.Response.Response != nil { + sc = result.ddc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDetectorsSlot", err.Error()) + } + + result.fn = client.listSiteDetectorsSlotNextResults + req, err := client.ListSiteDetectorsSlotPreparer(ctx, resourceGroupName, siteName, diagnosticCategory, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorsSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteDetectorsSlotSender(req) + if err != nil { + result.ddc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorsSlot", resp, "Failure sending request") + return + } + + result.ddc, err = client.ListSiteDetectorsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDetectorsSlot", resp, "Failure responding to request") + return + } + if result.ddc.hasNextLink() && result.ddc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteDetectorsSlotPreparer prepares the ListSiteDetectorsSlot request. +func (client DiagnosticsClient) ListSiteDetectorsSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "diagnosticCategory": autorest.Encode("path", diagnosticCategory), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics/{diagnosticCategory}/detectors", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteDetectorsSlotSender sends the ListSiteDetectorsSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteDetectorsSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteDetectorsSlotResponder handles the response to the ListSiteDetectorsSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteDetectorsSlotResponder(resp *http.Response) (result DiagnosticDetectorCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteDetectorsSlotNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteDetectorsSlotNextResults(ctx context.Context, lastResults DiagnosticDetectorCollection) (result DiagnosticDetectorCollection, err error) { + req, err := lastResults.diagnosticDetectorCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorsSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteDetectorsSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorsSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteDetectorsSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDetectorsSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteDetectorsSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteDetectorsSlotComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result DiagnosticDetectorCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDetectorsSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteDetectorsSlot(ctx, resourceGroupName, siteName, diagnosticCategory, slot) + return +} + +// ListSiteDiagnosticCategories description for Get Diagnostics Categories +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +func (client DiagnosticsClient) ListSiteDiagnosticCategories(ctx context.Context, resourceGroupName string, siteName string) (result DiagnosticCategoryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDiagnosticCategories") + defer func() { + sc := -1 + if result.dcc.Response.Response != nil { + sc = result.dcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDiagnosticCategories", err.Error()) + } + + result.fn = client.listSiteDiagnosticCategoriesNextResults + req, err := client.ListSiteDiagnosticCategoriesPreparer(ctx, resourceGroupName, siteName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategories", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteDiagnosticCategoriesSender(req) + if err != nil { + result.dcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategories", resp, "Failure sending request") + return + } + + result.dcc, err = client.ListSiteDiagnosticCategoriesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategories", resp, "Failure responding to request") + return + } + if result.dcc.hasNextLink() && result.dcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteDiagnosticCategoriesPreparer prepares the ListSiteDiagnosticCategories request. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesPreparer(ctx context.Context, resourceGroupName string, siteName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/diagnostics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteDiagnosticCategoriesSender sends the ListSiteDiagnosticCategories request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteDiagnosticCategoriesResponder handles the response to the ListSiteDiagnosticCategories request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesResponder(resp *http.Response) (result DiagnosticCategoryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteDiagnosticCategoriesNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteDiagnosticCategoriesNextResults(ctx context.Context, lastResults DiagnosticCategoryCollection) (result DiagnosticCategoryCollection, err error) { + req, err := lastResults.diagnosticCategoryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDiagnosticCategoriesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteDiagnosticCategoriesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDiagnosticCategoriesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteDiagnosticCategoriesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDiagnosticCategoriesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteDiagnosticCategoriesComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesComplete(ctx context.Context, resourceGroupName string, siteName string) (result DiagnosticCategoryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDiagnosticCategories") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteDiagnosticCategories(ctx, resourceGroupName, siteName) + return +} + +// ListSiteDiagnosticCategoriesSlot description for Get Diagnostics Categories +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site Name +// slot - slot Name +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlot(ctx context.Context, resourceGroupName string, siteName string, slot string) (result DiagnosticCategoryCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDiagnosticCategoriesSlot") + defer func() { + sc := -1 + if result.dcc.Response.Response != nil { + sc = result.dcc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DiagnosticsClient", "ListSiteDiagnosticCategoriesSlot", err.Error()) + } + + result.fn = client.listSiteDiagnosticCategoriesSlotNextResults + req, err := client.ListSiteDiagnosticCategoriesSlotPreparer(ctx, resourceGroupName, siteName, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategoriesSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListSiteDiagnosticCategoriesSlotSender(req) + if err != nil { + result.dcc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategoriesSlot", resp, "Failure sending request") + return + } + + result.dcc, err = client.ListSiteDiagnosticCategoriesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "ListSiteDiagnosticCategoriesSlot", resp, "Failure responding to request") + return + } + if result.dcc.hasNextLink() && result.dcc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListSiteDiagnosticCategoriesSlotPreparer prepares the ListSiteDiagnosticCategoriesSlot request. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlotPreparer(ctx context.Context, resourceGroupName string, siteName string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slot}/diagnostics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSiteDiagnosticCategoriesSlotSender sends the ListSiteDiagnosticCategoriesSlot request. The method will close the +// http.Response Body if it receives an error. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListSiteDiagnosticCategoriesSlotResponder handles the response to the ListSiteDiagnosticCategoriesSlot request. The method always +// closes the http.Response Body. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlotResponder(resp *http.Response) (result DiagnosticCategoryCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listSiteDiagnosticCategoriesSlotNextResults retrieves the next set of results, if any. +func (client DiagnosticsClient) listSiteDiagnosticCategoriesSlotNextResults(ctx context.Context, lastResults DiagnosticCategoryCollection) (result DiagnosticCategoryCollection, err error) { + req, err := lastResults.diagnosticCategoryCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDiagnosticCategoriesSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSiteDiagnosticCategoriesSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDiagnosticCategoriesSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListSiteDiagnosticCategoriesSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DiagnosticsClient", "listSiteDiagnosticCategoriesSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListSiteDiagnosticCategoriesSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client DiagnosticsClient) ListSiteDiagnosticCategoriesSlotComplete(ctx context.Context, resourceGroupName string, siteName string, slot string) (result DiagnosticCategoryCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticsClient.ListSiteDiagnosticCategoriesSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListSiteDiagnosticCategoriesSlot(ctx, resourceGroupName, siteName, slot) + return +} diff --git a/services/web/mgmt/2021-03-01/web/domainregistrationprovider.go b/services/web/mgmt/2021-03-01/web/domainregistrationprovider.go new file mode 100644 index 000000000000..a04e086e447c --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/domainregistrationprovider.go @@ -0,0 +1,142 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DomainRegistrationProviderClient is the webSite Management Client +type DomainRegistrationProviderClient struct { + BaseClient +} + +// NewDomainRegistrationProviderClient creates an instance of the DomainRegistrationProviderClient client. +func NewDomainRegistrationProviderClient(subscriptionID string) DomainRegistrationProviderClient { + return NewDomainRegistrationProviderClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDomainRegistrationProviderClientWithBaseURI creates an instance of the DomainRegistrationProviderClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewDomainRegistrationProviderClientWithBaseURI(baseURI string, subscriptionID string) DomainRegistrationProviderClient { + return DomainRegistrationProviderClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListOperations description for Implements Csm operations Api to exposes the list of available Csm Apis under the +// resource provider +func (client DomainRegistrationProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainRegistrationProviderClient.ListOperations") + defer func() { + sc := -1 + if result.coc.Response.Response != nil { + sc = result.coc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOperationsNextResults + req, err := client.ListOperationsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainRegistrationProviderClient", "ListOperations", nil, "Failure preparing request") + return + } + + resp, err := client.ListOperationsSender(req) + if err != nil { + result.coc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainRegistrationProviderClient", "ListOperations", resp, "Failure sending request") + return + } + + result.coc, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainRegistrationProviderClient", "ListOperations", resp, "Failure responding to request") + return + } + if result.coc.hasNextLink() && result.coc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOperationsPreparer prepares the ListOperations request. +func (client DomainRegistrationProviderClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.DomainRegistration/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOperationsSender sends the ListOperations request. The method will close the +// http.Response Body if it receives an error. +func (client DomainRegistrationProviderClient) ListOperationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOperationsResponder handles the response to the ListOperations request. The method always +// closes the http.Response Body. +func (client DomainRegistrationProviderClient) ListOperationsResponder(resp *http.Response) (result CsmOperationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOperationsNextResults retrieves the next set of results, if any. +func (client DomainRegistrationProviderClient) listOperationsNextResults(ctx context.Context, lastResults CsmOperationCollection) (result CsmOperationCollection, err error) { + req, err := lastResults.csmOperationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DomainRegistrationProviderClient", "listOperationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DomainRegistrationProviderClient", "listOperationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainRegistrationProviderClient", "listOperationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOperationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client DomainRegistrationProviderClient) ListOperationsComplete(ctx context.Context) (result CsmOperationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainRegistrationProviderClient.ListOperations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOperations(ctx) + return +} diff --git a/services/web/mgmt/2021-03-01/web/domains.go b/services/web/mgmt/2021-03-01/web/domains.go new file mode 100644 index 000000000000..1c9d9b47fe37 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/domains.go @@ -0,0 +1,1585 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// DomainsClient is the webSite Management Client +type DomainsClient struct { + BaseClient +} + +// NewDomainsClient creates an instance of the DomainsClient client. +func NewDomainsClient(subscriptionID string) DomainsClient { + return NewDomainsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewDomainsClientWithBaseURI creates an instance of the DomainsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewDomainsClientWithBaseURI(baseURI string, subscriptionID string) DomainsClient { + return DomainsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckAvailability description for Check if a domain is available for registration. +// Parameters: +// identifier - name of the domain. +func (client DomainsClient) CheckAvailability(ctx context.Context, identifier NameIdentifier) (result DomainAvailabilityCheckResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.CheckAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.CheckAvailabilityPreparer(ctx, identifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CheckAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CheckAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CheckAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckAvailabilityPreparer prepares the CheckAvailability request. +func (client DomainsClient) CheckAvailabilityPreparer(ctx context.Context, identifier NameIdentifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/checkDomainAvailability", pathParameters), + autorest.WithJSON(identifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckAvailabilitySender sends the CheckAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) CheckAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckAvailabilityResponder handles the response to the CheckAvailability request. The method always +// closes the http.Response Body. +func (client DomainsClient) CheckAvailabilityResponder(resp *http.Response) (result DomainAvailabilityCheckResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate description for Creates or updates a domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of the domain. +// domain - domain registration information. +func (client DomainsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain Domain) (result DomainsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: domainName, + Constraints: []validation.Constraint{{Target: "domainName", Name: validation.Pattern, Rule: `[a-zA-Z0-9][a-zA-Z0-9\.-]+`, Chain: nil}}}, + {TargetValue: domain, + Constraints: []validation.Constraint{{Target: "domain.DomainProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactAdmin", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactAdmin.AddressMailing", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactAdmin.AddressMailing.Address1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.AddressMailing.City", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.AddressMailing.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.AddressMailing.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.AddressMailing.State", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactAdmin.Email", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.NameFirst", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.NameLast", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactAdmin.Phone", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactBilling", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactBilling.AddressMailing", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactBilling.AddressMailing.Address1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.AddressMailing.City", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.AddressMailing.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.AddressMailing.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.AddressMailing.State", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactBilling.Email", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.NameFirst", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.NameLast", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactBilling.Phone", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactRegistrant", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactRegistrant.AddressMailing", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactRegistrant.AddressMailing.Address1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.AddressMailing.City", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.AddressMailing.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.AddressMailing.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.AddressMailing.State", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactRegistrant.Email", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.NameFirst", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.NameLast", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactRegistrant.Phone", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactTech", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactTech.AddressMailing", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "domain.DomainProperties.ContactTech.AddressMailing.Address1", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.AddressMailing.City", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.AddressMailing.Country", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.AddressMailing.PostalCode", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.AddressMailing.State", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.ContactTech.Email", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.NameFirst", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.NameLast", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "domain.DomainProperties.ContactTech.Phone", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "domain.DomainProperties.Consent", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, domainName, domain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client DomainsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, domainName string, domain Domain) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters), + autorest.WithJSON(domain), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) CreateOrUpdateSender(req *http.Request) (future DomainsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client DomainsClient) CreateOrUpdateResponder(resp *http.Response) (result Domain, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateOwnershipIdentifier description for Creates an ownership identifier for a domain or updates identifier +// details for an existing identifier +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of domain. +// name - name of identifier. +// domainOwnershipIdentifier - a JSON representation of the domain ownership properties. +func (client DomainsClient) CreateOrUpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier) (result DomainOwnershipIdentifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.CreateOrUpdateOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "CreateOrUpdateOwnershipIdentifier", err.Error()) + } + + req, err := client.CreateOrUpdateOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdateOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateOwnershipIdentifierSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdateOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "CreateOrUpdateOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateOwnershipIdentifierPreparer prepares the CreateOrUpdateOwnershipIdentifier request. +func (client DomainsClient) CreateOrUpdateOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", pathParameters), + autorest.WithJSON(domainOwnershipIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateOwnershipIdentifierSender sends the CreateOrUpdateOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) CreateOrUpdateOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateOwnershipIdentifierResponder handles the response to the CreateOrUpdateOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client DomainsClient) CreateOrUpdateOwnershipIdentifierResponder(resp *http.Response) (result DomainOwnershipIdentifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete a domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of the domain. +// forceHardDeleteDomain - specify true to delete the domain immediately. The default is +// false which deletes the domain after 24 hours. +func (client DomainsClient) Delete(ctx context.Context, resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, domainName, forceHardDeleteDomain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client DomainsClient) DeletePreparer(ctx context.Context, resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if forceHardDeleteDomain != nil { + queryParameters["forceHardDeleteDomain"] = autorest.Encode("query", *forceHardDeleteDomain) + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client DomainsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteOwnershipIdentifier description for Delete ownership identifier for domain +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of domain. +// name - name of identifier. +func (client DomainsClient) DeleteOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.DeleteOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "DeleteOwnershipIdentifier", err.Error()) + } + + req, err := client.DeleteOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "DeleteOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteOwnershipIdentifierSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.DomainsClient", "DeleteOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.DeleteOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "DeleteOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// DeleteOwnershipIdentifierPreparer prepares the DeleteOwnershipIdentifier request. +func (client DomainsClient) DeleteOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, domainName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteOwnershipIdentifierSender sends the DeleteOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) DeleteOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteOwnershipIdentifierResponder handles the response to the DeleteOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client DomainsClient) DeleteOwnershipIdentifierResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get description for Get a domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of the domain. +func (client DomainsClient) Get(ctx context.Context, resourceGroupName string, domainName string) (result Domain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client DomainsClient) GetPreparer(ctx context.Context, resourceGroupName string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client DomainsClient) GetResponder(resp *http.Response) (result Domain, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetControlCenterSsoRequest description for Generate a single sign-on request for the domain management portal. +func (client DomainsClient) GetControlCenterSsoRequest(ctx context.Context) (result DomainControlCenterSsoRequest, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.GetControlCenterSsoRequest") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetControlCenterSsoRequestPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetControlCenterSsoRequest", nil, "Failure preparing request") + return + } + + resp, err := client.GetControlCenterSsoRequestSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetControlCenterSsoRequest", resp, "Failure sending request") + return + } + + result, err = client.GetControlCenterSsoRequestResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetControlCenterSsoRequest", resp, "Failure responding to request") + return + } + + return +} + +// GetControlCenterSsoRequestPreparer prepares the GetControlCenterSsoRequest request. +func (client DomainsClient) GetControlCenterSsoRequestPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/generateSsoRequest", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetControlCenterSsoRequestSender sends the GetControlCenterSsoRequest request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) GetControlCenterSsoRequestSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetControlCenterSsoRequestResponder handles the response to the GetControlCenterSsoRequest request. The method always +// closes the http.Response Body. +func (client DomainsClient) GetControlCenterSsoRequestResponder(resp *http.Response) (result DomainControlCenterSsoRequest, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetOwnershipIdentifier description for Get ownership identifier for domain +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of domain. +// name - name of identifier. +func (client DomainsClient) GetOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string) (result DomainOwnershipIdentifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.GetOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "GetOwnershipIdentifier", err.Error()) + } + + req, err := client.GetOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.GetOwnershipIdentifierSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.GetOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "GetOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// GetOwnershipIdentifierPreparer prepares the GetOwnershipIdentifier request. +func (client DomainsClient) GetOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, domainName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetOwnershipIdentifierSender sends the GetOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) GetOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetOwnershipIdentifierResponder handles the response to the GetOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client DomainsClient) GetOwnershipIdentifierResponder(resp *http.Response) (result DomainOwnershipIdentifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all domains in a subscription. +func (client DomainsClient) List(ctx context.Context) (result DomainCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.List") + defer func() { + sc := -1 + if result.dc.Response.Response != nil { + sc = result.dc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "List", resp, "Failure sending request") + return + } + + result.dc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "List", resp, "Failure responding to request") + return + } + if result.dc.hasNextLink() && result.dc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client DomainsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/domains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client DomainsClient) ListResponder(resp *http.Response) (result DomainCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client DomainsClient) listNextResults(ctx context.Context, lastResults DomainCollection) (result DomainCollection, err error) { + req, err := lastResults.domainCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client DomainsClient) ListComplete(ctx context.Context) (result DomainCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup description for Get all domains in a resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client DomainsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result DomainCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.dc.Response.Response != nil { + sc = result.dc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.dc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.dc, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.dc.hasNextLink() && result.dc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client DomainsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client DomainsClient) ListByResourceGroupResponder(resp *http.Response) (result DomainCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client DomainsClient) listByResourceGroupNextResults(ctx context.Context, lastResults DomainCollection) (result DomainCollection, err error) { + req, err := lastResults.domainCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client DomainsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result DomainCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListOwnershipIdentifiers description for Lists domain ownership identifiers. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of domain. +func (client DomainsClient) ListOwnershipIdentifiers(ctx context.Context, resourceGroupName string, domainName string) (result DomainOwnershipIdentifierCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.ListOwnershipIdentifiers") + defer func() { + sc := -1 + if result.doic.Response.Response != nil { + sc = result.doic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "ListOwnershipIdentifiers", err.Error()) + } + + result.fn = client.listOwnershipIdentifiersNextResults + req, err := client.ListOwnershipIdentifiersPreparer(ctx, resourceGroupName, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListOwnershipIdentifiers", nil, "Failure preparing request") + return + } + + resp, err := client.ListOwnershipIdentifiersSender(req) + if err != nil { + result.doic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListOwnershipIdentifiers", resp, "Failure sending request") + return + } + + result.doic, err = client.ListOwnershipIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListOwnershipIdentifiers", resp, "Failure responding to request") + return + } + if result.doic.hasNextLink() && result.doic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOwnershipIdentifiersPreparer prepares the ListOwnershipIdentifiers request. +func (client DomainsClient) ListOwnershipIdentifiersPreparer(ctx context.Context, resourceGroupName string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOwnershipIdentifiersSender sends the ListOwnershipIdentifiers request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) ListOwnershipIdentifiersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListOwnershipIdentifiersResponder handles the response to the ListOwnershipIdentifiers request. The method always +// closes the http.Response Body. +func (client DomainsClient) ListOwnershipIdentifiersResponder(resp *http.Response) (result DomainOwnershipIdentifierCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOwnershipIdentifiersNextResults retrieves the next set of results, if any. +func (client DomainsClient) listOwnershipIdentifiersNextResults(ctx context.Context, lastResults DomainOwnershipIdentifierCollection) (result DomainOwnershipIdentifierCollection, err error) { + req, err := lastResults.domainOwnershipIdentifierCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listOwnershipIdentifiersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOwnershipIdentifiersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listOwnershipIdentifiersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOwnershipIdentifiersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "listOwnershipIdentifiersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOwnershipIdentifiersComplete enumerates all values, automatically crossing page boundaries as required. +func (client DomainsClient) ListOwnershipIdentifiersComplete(ctx context.Context, resourceGroupName string, domainName string) (result DomainOwnershipIdentifierCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.ListOwnershipIdentifiers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOwnershipIdentifiers(ctx, resourceGroupName, domainName) + return +} + +// ListRecommendations description for Get domain name recommendations based on keywords. +// Parameters: +// parameters - search parameters for domain name recommendations. +func (client DomainsClient) ListRecommendations(ctx context.Context, parameters DomainRecommendationSearchParameters) (result NameIdentifierCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.ListRecommendations") + defer func() { + sc := -1 + if result.nic.Response.Response != nil { + sc = result.nic.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listRecommendationsNextResults + req, err := client.ListRecommendationsPreparer(ctx, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListRecommendations", nil, "Failure preparing request") + return + } + + resp, err := client.ListRecommendationsSender(req) + if err != nil { + result.nic.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListRecommendations", resp, "Failure sending request") + return + } + + result.nic, err = client.ListRecommendationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "ListRecommendations", resp, "Failure responding to request") + return + } + if result.nic.hasNextLink() && result.nic.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListRecommendationsPreparer prepares the ListRecommendations request. +func (client DomainsClient) ListRecommendationsPreparer(ctx context.Context, parameters DomainRecommendationSearchParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/listDomainRecommendations", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRecommendationsSender sends the ListRecommendations request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) ListRecommendationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRecommendationsResponder handles the response to the ListRecommendations request. The method always +// closes the http.Response Body. +func (client DomainsClient) ListRecommendationsResponder(resp *http.Response) (result NameIdentifierCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listRecommendationsNextResults retrieves the next set of results, if any. +func (client DomainsClient) listRecommendationsNextResults(ctx context.Context, lastResults NameIdentifierCollection) (result NameIdentifierCollection, err error) { + req, err := lastResults.nameIdentifierCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listRecommendationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListRecommendationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.DomainsClient", "listRecommendationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListRecommendationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "listRecommendationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListRecommendationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client DomainsClient) ListRecommendationsComplete(ctx context.Context, parameters DomainRecommendationSearchParameters) (result NameIdentifierCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.ListRecommendations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListRecommendations(ctx, parameters) + return +} + +// Renew description for Renew a domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of the domain. +func (client DomainsClient) Renew(ctx context.Context, resourceGroupName string, domainName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.Renew") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "Renew", err.Error()) + } + + req, err := client.RenewPreparer(ctx, resourceGroupName, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Renew", nil, "Failure preparing request") + return + } + + resp, err := client.RenewSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Renew", resp, "Failure sending request") + return + } + + result, err = client.RenewResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Renew", resp, "Failure responding to request") + return + } + + return +} + +// RenewPreparer prepares the Renew request. +func (client DomainsClient) RenewPreparer(ctx context.Context, resourceGroupName string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/renew", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RenewSender sends the Renew request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) RenewSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RenewResponder handles the response to the Renew request. The method always +// closes the http.Response Body. +func (client DomainsClient) RenewResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// TransferOut sends the transfer out request. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of domain. +func (client DomainsClient) TransferOut(ctx context.Context, resourceGroupName string, domainName string) (result Domain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.TransferOut") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "TransferOut", err.Error()) + } + + req, err := client.TransferOutPreparer(ctx, resourceGroupName, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "TransferOut", nil, "Failure preparing request") + return + } + + resp, err := client.TransferOutSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "TransferOut", resp, "Failure sending request") + return + } + + result, err = client.TransferOutResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "TransferOut", resp, "Failure responding to request") + return + } + + return +} + +// TransferOutPreparer prepares the TransferOut request. +func (client DomainsClient) TransferOutPreparer(ctx context.Context, resourceGroupName string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/transferOut", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TransferOutSender sends the TransferOut request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) TransferOutSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// TransferOutResponder handles the response to the TransferOut request. The method always +// closes the http.Response Body. +func (client DomainsClient) TransferOutResponder(resp *http.Response) (result Domain, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update description for Creates or updates a domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of the domain. +// domain - domain registration information. +func (client DomainsClient) Update(ctx context.Context, resourceGroupName string, domainName string, domain DomainPatchResource) (result Domain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}, + {TargetValue: domainName, + Constraints: []validation.Constraint{{Target: "domainName", Name: validation.Pattern, Rule: `[a-zA-Z0-9][a-zA-Z0-9\.-]+`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, domainName, domain) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client DomainsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, domainName string, domain DomainPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}", pathParameters), + autorest.WithJSON(domain), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client DomainsClient) UpdateResponder(resp *http.Response) (result Domain, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateOwnershipIdentifier description for Creates an ownership identifier for a domain or updates identifier details +// for an existing identifier +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// domainName - name of domain. +// name - name of identifier. +// domainOwnershipIdentifier - a JSON representation of the domain ownership properties. +func (client DomainsClient) UpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier) (result DomainOwnershipIdentifier, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainsClient.UpdateOwnershipIdentifier") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.DomainsClient", "UpdateOwnershipIdentifier", err.Error()) + } + + req, err := client.UpdateOwnershipIdentifierPreparer(ctx, resourceGroupName, domainName, name, domainOwnershipIdentifier) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "UpdateOwnershipIdentifier", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateOwnershipIdentifierSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.DomainsClient", "UpdateOwnershipIdentifier", resp, "Failure sending request") + return + } + + result, err = client.UpdateOwnershipIdentifierResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsClient", "UpdateOwnershipIdentifier", resp, "Failure responding to request") + return + } + + return +} + +// UpdateOwnershipIdentifierPreparer prepares the UpdateOwnershipIdentifier request. +func (client DomainsClient) UpdateOwnershipIdentifierPreparer(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier DomainOwnershipIdentifier) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DomainRegistration/domains/{domainName}/domainOwnershipIdentifiers/{name}", pathParameters), + autorest.WithJSON(domainOwnershipIdentifier), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateOwnershipIdentifierSender sends the UpdateOwnershipIdentifier request. The method will close the +// http.Response Body if it receives an error. +func (client DomainsClient) UpdateOwnershipIdentifierSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateOwnershipIdentifierResponder handles the response to the UpdateOwnershipIdentifier request. The method always +// closes the http.Response Body. +func (client DomainsClient) UpdateOwnershipIdentifierResponder(resp *http.Response) (result DomainOwnershipIdentifier, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/enums.go b/services/web/mgmt/2021-03-01/web/enums.go new file mode 100644 index 000000000000..1d61f48637d3 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/enums.go @@ -0,0 +1,1794 @@ +package web + +// 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. + +// ActiveRevisionsMode enumerates the values for active revisions mode. +type ActiveRevisionsMode string + +const ( + // ActiveRevisionsModeMultiple ... + ActiveRevisionsModeMultiple ActiveRevisionsMode = "multiple" + // ActiveRevisionsModeSingle ... + ActiveRevisionsModeSingle ActiveRevisionsMode = "single" +) + +// PossibleActiveRevisionsModeValues returns an array of possible values for the ActiveRevisionsMode const type. +func PossibleActiveRevisionsModeValues() []ActiveRevisionsMode { + return []ActiveRevisionsMode{ActiveRevisionsModeMultiple, ActiveRevisionsModeSingle} +} + +// AppServicePlanRestrictions enumerates the values for app service plan restrictions. +type AppServicePlanRestrictions string + +const ( + // AppServicePlanRestrictionsBasic ... + AppServicePlanRestrictionsBasic AppServicePlanRestrictions = "Basic" + // AppServicePlanRestrictionsFree ... + AppServicePlanRestrictionsFree AppServicePlanRestrictions = "Free" + // AppServicePlanRestrictionsNone ... + AppServicePlanRestrictionsNone AppServicePlanRestrictions = "None" + // AppServicePlanRestrictionsPremium ... + AppServicePlanRestrictionsPremium AppServicePlanRestrictions = "Premium" + // AppServicePlanRestrictionsShared ... + AppServicePlanRestrictionsShared AppServicePlanRestrictions = "Shared" + // AppServicePlanRestrictionsStandard ... + AppServicePlanRestrictionsStandard AppServicePlanRestrictions = "Standard" +) + +// PossibleAppServicePlanRestrictionsValues returns an array of possible values for the AppServicePlanRestrictions const type. +func PossibleAppServicePlanRestrictionsValues() []AppServicePlanRestrictions { + return []AppServicePlanRestrictions{AppServicePlanRestrictionsBasic, AppServicePlanRestrictionsFree, AppServicePlanRestrictionsNone, AppServicePlanRestrictionsPremium, AppServicePlanRestrictionsShared, AppServicePlanRestrictionsStandard} +} + +// AutoHealActionType enumerates the values for auto heal action type. +type AutoHealActionType string + +const ( + // AutoHealActionTypeCustomAction ... + AutoHealActionTypeCustomAction AutoHealActionType = "CustomAction" + // AutoHealActionTypeLogEvent ... + AutoHealActionTypeLogEvent AutoHealActionType = "LogEvent" + // AutoHealActionTypeRecycle ... + AutoHealActionTypeRecycle AutoHealActionType = "Recycle" +) + +// PossibleAutoHealActionTypeValues returns an array of possible values for the AutoHealActionType const type. +func PossibleAutoHealActionTypeValues() []AutoHealActionType { + return []AutoHealActionType{AutoHealActionTypeCustomAction, AutoHealActionTypeLogEvent, AutoHealActionTypeRecycle} +} + +// AzureResourceType enumerates the values for azure resource type. +type AzureResourceType string + +const ( + // AzureResourceTypeTrafficManager ... + AzureResourceTypeTrafficManager AzureResourceType = "TrafficManager" + // AzureResourceTypeWebsite ... + AzureResourceTypeWebsite AzureResourceType = "Website" +) + +// PossibleAzureResourceTypeValues returns an array of possible values for the AzureResourceType const type. +func PossibleAzureResourceTypeValues() []AzureResourceType { + return []AzureResourceType{AzureResourceTypeTrafficManager, AzureResourceTypeWebsite} +} + +// AzureStorageState enumerates the values for azure storage state. +type AzureStorageState string + +const ( + // AzureStorageStateInvalidCredentials ... + AzureStorageStateInvalidCredentials AzureStorageState = "InvalidCredentials" + // AzureStorageStateInvalidShare ... + AzureStorageStateInvalidShare AzureStorageState = "InvalidShare" + // AzureStorageStateNotValidated ... + AzureStorageStateNotValidated AzureStorageState = "NotValidated" + // AzureStorageStateOk ... + AzureStorageStateOk AzureStorageState = "Ok" +) + +// PossibleAzureStorageStateValues returns an array of possible values for the AzureStorageState const type. +func PossibleAzureStorageStateValues() []AzureStorageState { + return []AzureStorageState{AzureStorageStateInvalidCredentials, AzureStorageStateInvalidShare, AzureStorageStateNotValidated, AzureStorageStateOk} +} + +// AzureStorageType enumerates the values for azure storage type. +type AzureStorageType string + +const ( + // AzureStorageTypeAzureBlob ... + AzureStorageTypeAzureBlob AzureStorageType = "AzureBlob" + // AzureStorageTypeAzureFiles ... + AzureStorageTypeAzureFiles AzureStorageType = "AzureFiles" +) + +// PossibleAzureStorageTypeValues returns an array of possible values for the AzureStorageType const type. +func PossibleAzureStorageTypeValues() []AzureStorageType { + return []AzureStorageType{AzureStorageTypeAzureBlob, AzureStorageTypeAzureFiles} +} + +// BackupItemStatus enumerates the values for backup item status. +type BackupItemStatus string + +const ( + // BackupItemStatusCreated ... + BackupItemStatusCreated BackupItemStatus = "Created" + // BackupItemStatusDeleted ... + BackupItemStatusDeleted BackupItemStatus = "Deleted" + // BackupItemStatusDeleteFailed ... + BackupItemStatusDeleteFailed BackupItemStatus = "DeleteFailed" + // BackupItemStatusDeleteInProgress ... + BackupItemStatusDeleteInProgress BackupItemStatus = "DeleteInProgress" + // BackupItemStatusFailed ... + BackupItemStatusFailed BackupItemStatus = "Failed" + // BackupItemStatusInProgress ... + BackupItemStatusInProgress BackupItemStatus = "InProgress" + // BackupItemStatusPartiallySucceeded ... + BackupItemStatusPartiallySucceeded BackupItemStatus = "PartiallySucceeded" + // BackupItemStatusSkipped ... + BackupItemStatusSkipped BackupItemStatus = "Skipped" + // BackupItemStatusSucceeded ... + BackupItemStatusSucceeded BackupItemStatus = "Succeeded" + // BackupItemStatusTimedOut ... + BackupItemStatusTimedOut BackupItemStatus = "TimedOut" +) + +// PossibleBackupItemStatusValues returns an array of possible values for the BackupItemStatus const type. +func PossibleBackupItemStatusValues() []BackupItemStatus { + return []BackupItemStatus{BackupItemStatusCreated, BackupItemStatusDeleted, BackupItemStatusDeleteFailed, BackupItemStatusDeleteInProgress, BackupItemStatusFailed, BackupItemStatusInProgress, BackupItemStatusPartiallySucceeded, BackupItemStatusSkipped, BackupItemStatusSucceeded, BackupItemStatusTimedOut} +} + +// BackupRestoreOperationType enumerates the values for backup restore operation type. +type BackupRestoreOperationType string + +const ( + // BackupRestoreOperationTypeClone ... + BackupRestoreOperationTypeClone BackupRestoreOperationType = "Clone" + // BackupRestoreOperationTypeCloudFS ... + BackupRestoreOperationTypeCloudFS BackupRestoreOperationType = "CloudFS" + // BackupRestoreOperationTypeDefault ... + BackupRestoreOperationTypeDefault BackupRestoreOperationType = "Default" + // BackupRestoreOperationTypeRelocation ... + BackupRestoreOperationTypeRelocation BackupRestoreOperationType = "Relocation" + // BackupRestoreOperationTypeSnapshot ... + BackupRestoreOperationTypeSnapshot BackupRestoreOperationType = "Snapshot" +) + +// PossibleBackupRestoreOperationTypeValues returns an array of possible values for the BackupRestoreOperationType const type. +func PossibleBackupRestoreOperationTypeValues() []BackupRestoreOperationType { + return []BackupRestoreOperationType{BackupRestoreOperationTypeClone, BackupRestoreOperationTypeCloudFS, BackupRestoreOperationTypeDefault, BackupRestoreOperationTypeRelocation, BackupRestoreOperationTypeSnapshot} +} + +// BuildStatus enumerates the values for build status. +type BuildStatus string + +const ( + // BuildStatusDeleting ... + BuildStatusDeleting BuildStatus = "Deleting" + // BuildStatusDeploying ... + BuildStatusDeploying BuildStatus = "Deploying" + // BuildStatusDetached ... + BuildStatusDetached BuildStatus = "Detached" + // BuildStatusFailed ... + BuildStatusFailed BuildStatus = "Failed" + // BuildStatusReady ... + BuildStatusReady BuildStatus = "Ready" + // BuildStatusUploading ... + BuildStatusUploading BuildStatus = "Uploading" + // BuildStatusWaitingForDeployment ... + BuildStatusWaitingForDeployment BuildStatus = "WaitingForDeployment" +) + +// PossibleBuildStatusValues returns an array of possible values for the BuildStatus const type. +func PossibleBuildStatusValues() []BuildStatus { + return []BuildStatus{BuildStatusDeleting, BuildStatusDeploying, BuildStatusDetached, BuildStatusFailed, BuildStatusReady, BuildStatusUploading, BuildStatusWaitingForDeployment} +} + +// BuiltInAuthenticationProvider enumerates the values for built in authentication provider. +type BuiltInAuthenticationProvider string + +const ( + // BuiltInAuthenticationProviderAzureActiveDirectory ... + BuiltInAuthenticationProviderAzureActiveDirectory BuiltInAuthenticationProvider = "AzureActiveDirectory" + // BuiltInAuthenticationProviderFacebook ... + BuiltInAuthenticationProviderFacebook BuiltInAuthenticationProvider = "Facebook" + // BuiltInAuthenticationProviderGithub ... + BuiltInAuthenticationProviderGithub BuiltInAuthenticationProvider = "Github" + // BuiltInAuthenticationProviderGoogle ... + BuiltInAuthenticationProviderGoogle BuiltInAuthenticationProvider = "Google" + // BuiltInAuthenticationProviderMicrosoftAccount ... + BuiltInAuthenticationProviderMicrosoftAccount BuiltInAuthenticationProvider = "MicrosoftAccount" + // BuiltInAuthenticationProviderTwitter ... + BuiltInAuthenticationProviderTwitter BuiltInAuthenticationProvider = "Twitter" +) + +// PossibleBuiltInAuthenticationProviderValues returns an array of possible values for the BuiltInAuthenticationProvider const type. +func PossibleBuiltInAuthenticationProviderValues() []BuiltInAuthenticationProvider { + return []BuiltInAuthenticationProvider{BuiltInAuthenticationProviderAzureActiveDirectory, BuiltInAuthenticationProviderFacebook, BuiltInAuthenticationProviderGithub, BuiltInAuthenticationProviderGoogle, BuiltInAuthenticationProviderMicrosoftAccount, BuiltInAuthenticationProviderTwitter} +} + +// CertificateOrderActionType enumerates the values for certificate order action type. +type CertificateOrderActionType string + +const ( + // CertificateOrderActionTypeCertificateExpirationWarning ... + CertificateOrderActionTypeCertificateExpirationWarning CertificateOrderActionType = "CertificateExpirationWarning" + // CertificateOrderActionTypeCertificateExpired ... + CertificateOrderActionTypeCertificateExpired CertificateOrderActionType = "CertificateExpired" + // CertificateOrderActionTypeCertificateIssued ... + CertificateOrderActionTypeCertificateIssued CertificateOrderActionType = "CertificateIssued" + // CertificateOrderActionTypeCertificateOrderCanceled ... + CertificateOrderActionTypeCertificateOrderCanceled CertificateOrderActionType = "CertificateOrderCanceled" + // CertificateOrderActionTypeCertificateOrderCreated ... + CertificateOrderActionTypeCertificateOrderCreated CertificateOrderActionType = "CertificateOrderCreated" + // CertificateOrderActionTypeCertificateRevoked ... + CertificateOrderActionTypeCertificateRevoked CertificateOrderActionType = "CertificateRevoked" + // CertificateOrderActionTypeDomainValidationComplete ... + CertificateOrderActionTypeDomainValidationComplete CertificateOrderActionType = "DomainValidationComplete" + // CertificateOrderActionTypeFraudCleared ... + CertificateOrderActionTypeFraudCleared CertificateOrderActionType = "FraudCleared" + // CertificateOrderActionTypeFraudDetected ... + CertificateOrderActionTypeFraudDetected CertificateOrderActionType = "FraudDetected" + // CertificateOrderActionTypeFraudDocumentationRequired ... + CertificateOrderActionTypeFraudDocumentationRequired CertificateOrderActionType = "FraudDocumentationRequired" + // CertificateOrderActionTypeOrgNameChange ... + CertificateOrderActionTypeOrgNameChange CertificateOrderActionType = "OrgNameChange" + // CertificateOrderActionTypeOrgValidationComplete ... + CertificateOrderActionTypeOrgValidationComplete CertificateOrderActionType = "OrgValidationComplete" + // CertificateOrderActionTypeSanDrop ... + CertificateOrderActionTypeSanDrop CertificateOrderActionType = "SanDrop" + // CertificateOrderActionTypeUnknown ... + CertificateOrderActionTypeUnknown CertificateOrderActionType = "Unknown" +) + +// PossibleCertificateOrderActionTypeValues returns an array of possible values for the CertificateOrderActionType const type. +func PossibleCertificateOrderActionTypeValues() []CertificateOrderActionType { + return []CertificateOrderActionType{CertificateOrderActionTypeCertificateExpirationWarning, CertificateOrderActionTypeCertificateExpired, CertificateOrderActionTypeCertificateIssued, CertificateOrderActionTypeCertificateOrderCanceled, CertificateOrderActionTypeCertificateOrderCreated, CertificateOrderActionTypeCertificateRevoked, CertificateOrderActionTypeDomainValidationComplete, CertificateOrderActionTypeFraudCleared, CertificateOrderActionTypeFraudDetected, CertificateOrderActionTypeFraudDocumentationRequired, CertificateOrderActionTypeOrgNameChange, CertificateOrderActionTypeOrgValidationComplete, CertificateOrderActionTypeSanDrop, CertificateOrderActionTypeUnknown} +} + +// CertificateOrderStatus enumerates the values for certificate order status. +type CertificateOrderStatus string + +const ( + // CertificateOrderStatusCanceled ... + CertificateOrderStatusCanceled CertificateOrderStatus = "Canceled" + // CertificateOrderStatusDenied ... + CertificateOrderStatusDenied CertificateOrderStatus = "Denied" + // CertificateOrderStatusExpired ... + CertificateOrderStatusExpired CertificateOrderStatus = "Expired" + // CertificateOrderStatusIssued ... + CertificateOrderStatusIssued CertificateOrderStatus = "Issued" + // CertificateOrderStatusNotSubmitted ... + CertificateOrderStatusNotSubmitted CertificateOrderStatus = "NotSubmitted" + // CertificateOrderStatusPendingissuance ... + CertificateOrderStatusPendingissuance CertificateOrderStatus = "Pendingissuance" + // CertificateOrderStatusPendingRekey ... + CertificateOrderStatusPendingRekey CertificateOrderStatus = "PendingRekey" + // CertificateOrderStatusPendingrevocation ... + CertificateOrderStatusPendingrevocation CertificateOrderStatus = "Pendingrevocation" + // CertificateOrderStatusRevoked ... + CertificateOrderStatusRevoked CertificateOrderStatus = "Revoked" + // CertificateOrderStatusUnused ... + CertificateOrderStatusUnused CertificateOrderStatus = "Unused" +) + +// PossibleCertificateOrderStatusValues returns an array of possible values for the CertificateOrderStatus const type. +func PossibleCertificateOrderStatusValues() []CertificateOrderStatus { + return []CertificateOrderStatus{CertificateOrderStatusCanceled, CertificateOrderStatusDenied, CertificateOrderStatusExpired, CertificateOrderStatusIssued, CertificateOrderStatusNotSubmitted, CertificateOrderStatusPendingissuance, CertificateOrderStatusPendingRekey, CertificateOrderStatusPendingrevocation, CertificateOrderStatusRevoked, CertificateOrderStatusUnused} +} + +// CertificateProductType enumerates the values for certificate product type. +type CertificateProductType string + +const ( + // CertificateProductTypeStandardDomainValidatedSsl ... + CertificateProductTypeStandardDomainValidatedSsl CertificateProductType = "StandardDomainValidatedSsl" + // CertificateProductTypeStandardDomainValidatedWildCardSsl ... + CertificateProductTypeStandardDomainValidatedWildCardSsl CertificateProductType = "StandardDomainValidatedWildCardSsl" +) + +// PossibleCertificateProductTypeValues returns an array of possible values for the CertificateProductType const type. +func PossibleCertificateProductTypeValues() []CertificateProductType { + return []CertificateProductType{CertificateProductTypeStandardDomainValidatedSsl, CertificateProductTypeStandardDomainValidatedWildCardSsl} +} + +// Channels enumerates the values for channels. +type Channels string + +const ( + // ChannelsAll ... + ChannelsAll Channels = "All" + // ChannelsAPI ... + ChannelsAPI Channels = "Api" + // ChannelsEmail ... + ChannelsEmail Channels = "Email" + // ChannelsNotification ... + ChannelsNotification Channels = "Notification" + // ChannelsWebhook ... + ChannelsWebhook Channels = "Webhook" +) + +// PossibleChannelsValues returns an array of possible values for the Channels const type. +func PossibleChannelsValues() []Channels { + return []Channels{ChannelsAll, ChannelsAPI, ChannelsEmail, ChannelsNotification, ChannelsWebhook} +} + +// CheckNameResourceTypes enumerates the values for check name resource types. +type CheckNameResourceTypes string + +const ( + // CheckNameResourceTypesHostingEnvironment ... + CheckNameResourceTypesHostingEnvironment CheckNameResourceTypes = "HostingEnvironment" + // CheckNameResourceTypesMicrosoftWebhostingEnvironments ... + CheckNameResourceTypesMicrosoftWebhostingEnvironments CheckNameResourceTypes = "Microsoft.Web/hostingEnvironments" + // CheckNameResourceTypesMicrosoftWebpublishingUsers ... + CheckNameResourceTypesMicrosoftWebpublishingUsers CheckNameResourceTypes = "Microsoft.Web/publishingUsers" + // CheckNameResourceTypesMicrosoftWebsites ... + CheckNameResourceTypesMicrosoftWebsites CheckNameResourceTypes = "Microsoft.Web/sites" + // CheckNameResourceTypesMicrosoftWebsitesslots ... + CheckNameResourceTypesMicrosoftWebsitesslots CheckNameResourceTypes = "Microsoft.Web/sites/slots" + // CheckNameResourceTypesPublishingUser ... + CheckNameResourceTypesPublishingUser CheckNameResourceTypes = "PublishingUser" + // CheckNameResourceTypesSite ... + CheckNameResourceTypesSite CheckNameResourceTypes = "Site" + // CheckNameResourceTypesSlot ... + CheckNameResourceTypesSlot CheckNameResourceTypes = "Slot" +) + +// PossibleCheckNameResourceTypesValues returns an array of possible values for the CheckNameResourceTypes const type. +func PossibleCheckNameResourceTypesValues() []CheckNameResourceTypes { + return []CheckNameResourceTypes{CheckNameResourceTypesHostingEnvironment, CheckNameResourceTypesMicrosoftWebhostingEnvironments, CheckNameResourceTypesMicrosoftWebpublishingUsers, CheckNameResourceTypesMicrosoftWebsites, CheckNameResourceTypesMicrosoftWebsitesslots, CheckNameResourceTypesPublishingUser, CheckNameResourceTypesSite, CheckNameResourceTypesSlot} +} + +// ClientCertMode enumerates the values for client cert mode. +type ClientCertMode string + +const ( + // ClientCertModeOptional ... + ClientCertModeOptional ClientCertMode = "Optional" + // ClientCertModeOptionalInteractiveUser ... + ClientCertModeOptionalInteractiveUser ClientCertMode = "OptionalInteractiveUser" + // ClientCertModeRequired ... + ClientCertModeRequired ClientCertMode = "Required" +) + +// PossibleClientCertModeValues returns an array of possible values for the ClientCertMode const type. +func PossibleClientCertModeValues() []ClientCertMode { + return []ClientCertMode{ClientCertModeOptional, ClientCertModeOptionalInteractiveUser, ClientCertModeRequired} +} + +// ClientCredentialMethod enumerates the values for client credential method. +type ClientCredentialMethod string + +const ( + // ClientCredentialMethodClientSecretPost ... + ClientCredentialMethodClientSecretPost ClientCredentialMethod = "ClientSecretPost" +) + +// PossibleClientCredentialMethodValues returns an array of possible values for the ClientCredentialMethod const type. +func PossibleClientCredentialMethodValues() []ClientCredentialMethod { + return []ClientCredentialMethod{ClientCredentialMethodClientSecretPost} +} + +// CloneAbilityResult enumerates the values for clone ability result. +type CloneAbilityResult string + +const ( + // CloneAbilityResultCloneable ... + CloneAbilityResultCloneable CloneAbilityResult = "Cloneable" + // CloneAbilityResultNotCloneable ... + CloneAbilityResultNotCloneable CloneAbilityResult = "NotCloneable" + // CloneAbilityResultPartiallyCloneable ... + CloneAbilityResultPartiallyCloneable CloneAbilityResult = "PartiallyCloneable" +) + +// PossibleCloneAbilityResultValues returns an array of possible values for the CloneAbilityResult const type. +func PossibleCloneAbilityResultValues() []CloneAbilityResult { + return []CloneAbilityResult{CloneAbilityResultCloneable, CloneAbilityResultNotCloneable, CloneAbilityResultPartiallyCloneable} +} + +// ComputeModeOptions enumerates the values for compute mode options. +type ComputeModeOptions string + +const ( + // ComputeModeOptionsDedicated ... + ComputeModeOptionsDedicated ComputeModeOptions = "Dedicated" + // ComputeModeOptionsDynamic ... + ComputeModeOptionsDynamic ComputeModeOptions = "Dynamic" + // ComputeModeOptionsShared ... + ComputeModeOptionsShared ComputeModeOptions = "Shared" +) + +// PossibleComputeModeOptionsValues returns an array of possible values for the ComputeModeOptions const type. +func PossibleComputeModeOptionsValues() []ComputeModeOptions { + return []ComputeModeOptions{ComputeModeOptionsDedicated, ComputeModeOptionsDynamic, ComputeModeOptionsShared} +} + +// ConfigReferenceSource enumerates the values for config reference source. +type ConfigReferenceSource string + +const ( + // ConfigReferenceSourceKeyVault ... + ConfigReferenceSourceKeyVault ConfigReferenceSource = "KeyVault" +) + +// PossibleConfigReferenceSourceValues returns an array of possible values for the ConfigReferenceSource const type. +func PossibleConfigReferenceSourceValues() []ConfigReferenceSource { + return []ConfigReferenceSource{ConfigReferenceSourceKeyVault} +} + +// ConnectionStringType enumerates the values for connection string type. +type ConnectionStringType string + +const ( + // ConnectionStringTypeAPIHub ... + ConnectionStringTypeAPIHub ConnectionStringType = "ApiHub" + // ConnectionStringTypeCustom ... + ConnectionStringTypeCustom ConnectionStringType = "Custom" + // ConnectionStringTypeDocDb ... + ConnectionStringTypeDocDb ConnectionStringType = "DocDb" + // ConnectionStringTypeEventHub ... + ConnectionStringTypeEventHub ConnectionStringType = "EventHub" + // ConnectionStringTypeMySQL ... + ConnectionStringTypeMySQL ConnectionStringType = "MySql" + // ConnectionStringTypeNotificationHub ... + ConnectionStringTypeNotificationHub ConnectionStringType = "NotificationHub" + // ConnectionStringTypePostgreSQL ... + ConnectionStringTypePostgreSQL ConnectionStringType = "PostgreSQL" + // ConnectionStringTypeRedisCache ... + ConnectionStringTypeRedisCache ConnectionStringType = "RedisCache" + // ConnectionStringTypeServiceBus ... + ConnectionStringTypeServiceBus ConnectionStringType = "ServiceBus" + // ConnectionStringTypeSQLAzure ... + ConnectionStringTypeSQLAzure ConnectionStringType = "SQLAzure" + // ConnectionStringTypeSQLServer ... + ConnectionStringTypeSQLServer ConnectionStringType = "SQLServer" +) + +// PossibleConnectionStringTypeValues returns an array of possible values for the ConnectionStringType const type. +func PossibleConnectionStringTypeValues() []ConnectionStringType { + return []ConnectionStringType{ConnectionStringTypeAPIHub, ConnectionStringTypeCustom, ConnectionStringTypeDocDb, ConnectionStringTypeEventHub, ConnectionStringTypeMySQL, ConnectionStringTypeNotificationHub, ConnectionStringTypePostgreSQL, ConnectionStringTypeRedisCache, ConnectionStringTypeServiceBus, ConnectionStringTypeSQLAzure, ConnectionStringTypeSQLServer} +} + +// ContainerAppProvisioningState enumerates the values for container app provisioning state. +type ContainerAppProvisioningState string + +const ( + // ContainerAppProvisioningStateCanceled ... + ContainerAppProvisioningStateCanceled ContainerAppProvisioningState = "Canceled" + // ContainerAppProvisioningStateFailed ... + ContainerAppProvisioningStateFailed ContainerAppProvisioningState = "Failed" + // ContainerAppProvisioningStateInProgress ... + ContainerAppProvisioningStateInProgress ContainerAppProvisioningState = "InProgress" + // ContainerAppProvisioningStateSucceeded ... + ContainerAppProvisioningStateSucceeded ContainerAppProvisioningState = "Succeeded" +) + +// PossibleContainerAppProvisioningStateValues returns an array of possible values for the ContainerAppProvisioningState const type. +func PossibleContainerAppProvisioningStateValues() []ContainerAppProvisioningState { + return []ContainerAppProvisioningState{ContainerAppProvisioningStateCanceled, ContainerAppProvisioningStateFailed, ContainerAppProvisioningStateInProgress, ContainerAppProvisioningStateSucceeded} +} + +// ContinuousWebJobStatus enumerates the values for continuous web job status. +type ContinuousWebJobStatus string + +const ( + // ContinuousWebJobStatusInitializing ... + ContinuousWebJobStatusInitializing ContinuousWebJobStatus = "Initializing" + // ContinuousWebJobStatusPendingRestart ... + ContinuousWebJobStatusPendingRestart ContinuousWebJobStatus = "PendingRestart" + // ContinuousWebJobStatusRunning ... + ContinuousWebJobStatusRunning ContinuousWebJobStatus = "Running" + // ContinuousWebJobStatusStarting ... + ContinuousWebJobStatusStarting ContinuousWebJobStatus = "Starting" + // ContinuousWebJobStatusStopped ... + ContinuousWebJobStatusStopped ContinuousWebJobStatus = "Stopped" +) + +// PossibleContinuousWebJobStatusValues returns an array of possible values for the ContinuousWebJobStatus const type. +func PossibleContinuousWebJobStatusValues() []ContinuousWebJobStatus { + return []ContinuousWebJobStatus{ContinuousWebJobStatusInitializing, ContinuousWebJobStatusPendingRestart, ContinuousWebJobStatusRunning, ContinuousWebJobStatusStarting, ContinuousWebJobStatusStopped} +} + +// CookieExpirationConvention enumerates the values for cookie expiration convention. +type CookieExpirationConvention string + +const ( + // CookieExpirationConventionFixedTime ... + CookieExpirationConventionFixedTime CookieExpirationConvention = "FixedTime" + // CookieExpirationConventionIdentityProviderDerived ... + CookieExpirationConventionIdentityProviderDerived CookieExpirationConvention = "IdentityProviderDerived" +) + +// PossibleCookieExpirationConventionValues returns an array of possible values for the CookieExpirationConvention const type. +func PossibleCookieExpirationConventionValues() []CookieExpirationConvention { + return []CookieExpirationConvention{CookieExpirationConventionFixedTime, CookieExpirationConventionIdentityProviderDerived} +} + +// CustomDomainStatus enumerates the values for custom domain status. +type CustomDomainStatus string + +const ( + // CustomDomainStatusAdding ... + CustomDomainStatusAdding CustomDomainStatus = "Adding" + // CustomDomainStatusDeleting ... + CustomDomainStatusDeleting CustomDomainStatus = "Deleting" + // CustomDomainStatusFailed ... + CustomDomainStatusFailed CustomDomainStatus = "Failed" + // CustomDomainStatusReady ... + CustomDomainStatusReady CustomDomainStatus = "Ready" + // CustomDomainStatusRetrievingValidationToken ... + CustomDomainStatusRetrievingValidationToken CustomDomainStatus = "RetrievingValidationToken" + // CustomDomainStatusValidating ... + CustomDomainStatusValidating CustomDomainStatus = "Validating" +) + +// PossibleCustomDomainStatusValues returns an array of possible values for the CustomDomainStatus const type. +func PossibleCustomDomainStatusValues() []CustomDomainStatus { + return []CustomDomainStatus{CustomDomainStatusAdding, CustomDomainStatusDeleting, CustomDomainStatusFailed, CustomDomainStatusReady, CustomDomainStatusRetrievingValidationToken, CustomDomainStatusValidating} +} + +// CustomHostNameDNSRecordType enumerates the values for custom host name dns record type. +type CustomHostNameDNSRecordType string + +const ( + // CustomHostNameDNSRecordTypeA ... + CustomHostNameDNSRecordTypeA CustomHostNameDNSRecordType = "A" + // CustomHostNameDNSRecordTypeCName ... + CustomHostNameDNSRecordTypeCName CustomHostNameDNSRecordType = "CName" +) + +// PossibleCustomHostNameDNSRecordTypeValues returns an array of possible values for the CustomHostNameDNSRecordType const type. +func PossibleCustomHostNameDNSRecordTypeValues() []CustomHostNameDNSRecordType { + return []CustomHostNameDNSRecordType{CustomHostNameDNSRecordTypeA, CustomHostNameDNSRecordTypeCName} +} + +// DatabaseType enumerates the values for database type. +type DatabaseType string + +const ( + // DatabaseTypeLocalMySQL ... + DatabaseTypeLocalMySQL DatabaseType = "LocalMySql" + // DatabaseTypeMySQL ... + DatabaseTypeMySQL DatabaseType = "MySql" + // DatabaseTypePostgreSQL ... + DatabaseTypePostgreSQL DatabaseType = "PostgreSql" + // DatabaseTypeSQLAzure ... + DatabaseTypeSQLAzure DatabaseType = "SqlAzure" +) + +// PossibleDatabaseTypeValues returns an array of possible values for the DatabaseType const type. +func PossibleDatabaseTypeValues() []DatabaseType { + return []DatabaseType{DatabaseTypeLocalMySQL, DatabaseTypeMySQL, DatabaseTypePostgreSQL, DatabaseTypeSQLAzure} +} + +// DetectorType enumerates the values for detector type. +type DetectorType string + +const ( + // DetectorTypeAnalysis ... + DetectorTypeAnalysis DetectorType = "Analysis" + // DetectorTypeCategoryOverview ... + DetectorTypeCategoryOverview DetectorType = "CategoryOverview" + // DetectorTypeDetector ... + DetectorTypeDetector DetectorType = "Detector" +) + +// PossibleDetectorTypeValues returns an array of possible values for the DetectorType const type. +func PossibleDetectorTypeValues() []DetectorType { + return []DetectorType{DetectorTypeAnalysis, DetectorTypeCategoryOverview, DetectorTypeDetector} +} + +// DNSType enumerates the values for dns type. +type DNSType string + +const ( + // DNSTypeAzureDNS ... + DNSTypeAzureDNS DNSType = "AzureDns" + // DNSTypeDefaultDomainRegistrarDNS ... + DNSTypeDefaultDomainRegistrarDNS DNSType = "DefaultDomainRegistrarDns" +) + +// PossibleDNSTypeValues returns an array of possible values for the DNSType const type. +func PossibleDNSTypeValues() []DNSType { + return []DNSType{DNSTypeAzureDNS, DNSTypeDefaultDomainRegistrarDNS} +} + +// DNSVerificationTestResult enumerates the values for dns verification test result. +type DNSVerificationTestResult string + +const ( + // DNSVerificationTestResultFailed ... + DNSVerificationTestResultFailed DNSVerificationTestResult = "Failed" + // DNSVerificationTestResultPassed ... + DNSVerificationTestResultPassed DNSVerificationTestResult = "Passed" + // DNSVerificationTestResultSkipped ... + DNSVerificationTestResultSkipped DNSVerificationTestResult = "Skipped" +) + +// PossibleDNSVerificationTestResultValues returns an array of possible values for the DNSVerificationTestResult const type. +func PossibleDNSVerificationTestResultValues() []DNSVerificationTestResult { + return []DNSVerificationTestResult{DNSVerificationTestResultFailed, DNSVerificationTestResultPassed, DNSVerificationTestResultSkipped} +} + +// DomainStatus enumerates the values for domain status. +type DomainStatus string + +const ( + // DomainStatusActive ... + DomainStatusActive DomainStatus = "Active" + // DomainStatusAwaiting ... + DomainStatusAwaiting DomainStatus = "Awaiting" + // DomainStatusCancelled ... + DomainStatusCancelled DomainStatus = "Cancelled" + // DomainStatusConfiscated ... + DomainStatusConfiscated DomainStatus = "Confiscated" + // DomainStatusDisabled ... + DomainStatusDisabled DomainStatus = "Disabled" + // DomainStatusExcluded ... + DomainStatusExcluded DomainStatus = "Excluded" + // DomainStatusExpired ... + DomainStatusExpired DomainStatus = "Expired" + // DomainStatusFailed ... + DomainStatusFailed DomainStatus = "Failed" + // DomainStatusHeld ... + DomainStatusHeld DomainStatus = "Held" + // DomainStatusJSONConverterFailed ... + DomainStatusJSONConverterFailed DomainStatus = "JsonConverterFailed" + // DomainStatusLocked ... + DomainStatusLocked DomainStatus = "Locked" + // DomainStatusParked ... + DomainStatusParked DomainStatus = "Parked" + // DomainStatusPending ... + DomainStatusPending DomainStatus = "Pending" + // DomainStatusReserved ... + DomainStatusReserved DomainStatus = "Reserved" + // DomainStatusReverted ... + DomainStatusReverted DomainStatus = "Reverted" + // DomainStatusSuspended ... + DomainStatusSuspended DomainStatus = "Suspended" + // DomainStatusTransferred ... + DomainStatusTransferred DomainStatus = "Transferred" + // DomainStatusUnknown ... + DomainStatusUnknown DomainStatus = "Unknown" + // DomainStatusUnlocked ... + DomainStatusUnlocked DomainStatus = "Unlocked" + // DomainStatusUnparked ... + DomainStatusUnparked DomainStatus = "Unparked" + // DomainStatusUpdated ... + DomainStatusUpdated DomainStatus = "Updated" +) + +// PossibleDomainStatusValues returns an array of possible values for the DomainStatus const type. +func PossibleDomainStatusValues() []DomainStatus { + return []DomainStatus{DomainStatusActive, DomainStatusAwaiting, DomainStatusCancelled, DomainStatusConfiscated, DomainStatusDisabled, DomainStatusExcluded, DomainStatusExpired, DomainStatusFailed, DomainStatusHeld, DomainStatusJSONConverterFailed, DomainStatusLocked, DomainStatusParked, DomainStatusPending, DomainStatusReserved, DomainStatusReverted, DomainStatusSuspended, DomainStatusTransferred, DomainStatusUnknown, DomainStatusUnlocked, DomainStatusUnparked, DomainStatusUpdated} +} + +// DomainType enumerates the values for domain type. +type DomainType string + +const ( + // DomainTypeRegular ... + DomainTypeRegular DomainType = "Regular" + // DomainTypeSoftDeleted ... + DomainTypeSoftDeleted DomainType = "SoftDeleted" +) + +// PossibleDomainTypeValues returns an array of possible values for the DomainType const type. +func PossibleDomainTypeValues() []DomainType { + return []DomainType{DomainTypeRegular, DomainTypeSoftDeleted} +} + +// EnterpriseGradeCdnStatus enumerates the values for enterprise grade cdn status. +type EnterpriseGradeCdnStatus string + +const ( + // EnterpriseGradeCdnStatusDisabled ... + EnterpriseGradeCdnStatusDisabled EnterpriseGradeCdnStatus = "Disabled" + // EnterpriseGradeCdnStatusDisabling ... + EnterpriseGradeCdnStatusDisabling EnterpriseGradeCdnStatus = "Disabling" + // EnterpriseGradeCdnStatusEnabled ... + EnterpriseGradeCdnStatusEnabled EnterpriseGradeCdnStatus = "Enabled" + // EnterpriseGradeCdnStatusEnabling ... + EnterpriseGradeCdnStatusEnabling EnterpriseGradeCdnStatus = "Enabling" +) + +// PossibleEnterpriseGradeCdnStatusValues returns an array of possible values for the EnterpriseGradeCdnStatus const type. +func PossibleEnterpriseGradeCdnStatusValues() []EnterpriseGradeCdnStatus { + return []EnterpriseGradeCdnStatus{EnterpriseGradeCdnStatusDisabled, EnterpriseGradeCdnStatusDisabling, EnterpriseGradeCdnStatusEnabled, EnterpriseGradeCdnStatusEnabling} +} + +// ForwardProxyConvention enumerates the values for forward proxy convention. +type ForwardProxyConvention string + +const ( + // ForwardProxyConventionCustom ... + ForwardProxyConventionCustom ForwardProxyConvention = "Custom" + // ForwardProxyConventionNoProxy ... + ForwardProxyConventionNoProxy ForwardProxyConvention = "NoProxy" + // ForwardProxyConventionStandard ... + ForwardProxyConventionStandard ForwardProxyConvention = "Standard" +) + +// PossibleForwardProxyConventionValues returns an array of possible values for the ForwardProxyConvention const type. +func PossibleForwardProxyConventionValues() []ForwardProxyConvention { + return []ForwardProxyConvention{ForwardProxyConventionCustom, ForwardProxyConventionNoProxy, ForwardProxyConventionStandard} +} + +// FrequencyUnit enumerates the values for frequency unit. +type FrequencyUnit string + +const ( + // FrequencyUnitDay ... + FrequencyUnitDay FrequencyUnit = "Day" + // FrequencyUnitHour ... + FrequencyUnitHour FrequencyUnit = "Hour" +) + +// PossibleFrequencyUnitValues returns an array of possible values for the FrequencyUnit const type. +func PossibleFrequencyUnitValues() []FrequencyUnit { + return []FrequencyUnit{FrequencyUnitDay, FrequencyUnitHour} +} + +// FrontEndServiceType enumerates the values for front end service type. +type FrontEndServiceType string + +const ( + // FrontEndServiceTypeLoadBalancer ... + FrontEndServiceTypeLoadBalancer FrontEndServiceType = "LoadBalancer" + // FrontEndServiceTypeNodePort ... + FrontEndServiceTypeNodePort FrontEndServiceType = "NodePort" +) + +// PossibleFrontEndServiceTypeValues returns an array of possible values for the FrontEndServiceType const type. +func PossibleFrontEndServiceTypeValues() []FrontEndServiceType { + return []FrontEndServiceType{FrontEndServiceTypeLoadBalancer, FrontEndServiceTypeNodePort} +} + +// FtpsState enumerates the values for ftps state. +type FtpsState string + +const ( + // FtpsStateAllAllowed ... + FtpsStateAllAllowed FtpsState = "AllAllowed" + // FtpsStateDisabled ... + FtpsStateDisabled FtpsState = "Disabled" + // FtpsStateFtpsOnly ... + FtpsStateFtpsOnly FtpsState = "FtpsOnly" +) + +// PossibleFtpsStateValues returns an array of possible values for the FtpsState const type. +func PossibleFtpsStateValues() []FtpsState { + return []FtpsState{FtpsStateAllAllowed, FtpsStateDisabled, FtpsStateFtpsOnly} +} + +// HostingEnvironmentStatus enumerates the values for hosting environment status. +type HostingEnvironmentStatus string + +const ( + // HostingEnvironmentStatusDeleting ... + HostingEnvironmentStatusDeleting HostingEnvironmentStatus = "Deleting" + // HostingEnvironmentStatusPreparing ... + HostingEnvironmentStatusPreparing HostingEnvironmentStatus = "Preparing" + // HostingEnvironmentStatusReady ... + HostingEnvironmentStatusReady HostingEnvironmentStatus = "Ready" + // HostingEnvironmentStatusScaling ... + HostingEnvironmentStatusScaling HostingEnvironmentStatus = "Scaling" +) + +// PossibleHostingEnvironmentStatusValues returns an array of possible values for the HostingEnvironmentStatus const type. +func PossibleHostingEnvironmentStatusValues() []HostingEnvironmentStatus { + return []HostingEnvironmentStatus{HostingEnvironmentStatusDeleting, HostingEnvironmentStatusPreparing, HostingEnvironmentStatusReady, HostingEnvironmentStatusScaling} +} + +// HostNameType enumerates the values for host name type. +type HostNameType string + +const ( + // HostNameTypeManaged ... + HostNameTypeManaged HostNameType = "Managed" + // HostNameTypeVerified ... + HostNameTypeVerified HostNameType = "Verified" +) + +// PossibleHostNameTypeValues returns an array of possible values for the HostNameType const type. +func PossibleHostNameTypeValues() []HostNameType { + return []HostNameType{HostNameTypeManaged, HostNameTypeVerified} +} + +// HostType enumerates the values for host type. +type HostType string + +const ( + // HostTypeRepository ... + HostTypeRepository HostType = "Repository" + // HostTypeStandard ... + HostTypeStandard HostType = "Standard" +) + +// PossibleHostTypeValues returns an array of possible values for the HostType const type. +func PossibleHostTypeValues() []HostType { + return []HostType{HostTypeRepository, HostTypeStandard} +} + +// InAvailabilityReasonType enumerates the values for in availability reason type. +type InAvailabilityReasonType string + +const ( + // InAvailabilityReasonTypeAlreadyExists ... + InAvailabilityReasonTypeAlreadyExists InAvailabilityReasonType = "AlreadyExists" + // InAvailabilityReasonTypeInvalid ... + InAvailabilityReasonTypeInvalid InAvailabilityReasonType = "Invalid" +) + +// PossibleInAvailabilityReasonTypeValues returns an array of possible values for the InAvailabilityReasonType const type. +func PossibleInAvailabilityReasonTypeValues() []InAvailabilityReasonType { + return []InAvailabilityReasonType{InAvailabilityReasonTypeAlreadyExists, InAvailabilityReasonTypeInvalid} +} + +// IngressTransportMethod enumerates the values for ingress transport method. +type IngressTransportMethod string + +const ( + // IngressTransportMethodAuto ... + IngressTransportMethodAuto IngressTransportMethod = "auto" + // IngressTransportMethodHTTP ... + IngressTransportMethodHTTP IngressTransportMethod = "http" + // IngressTransportMethodHTTP2 ... + IngressTransportMethodHTTP2 IngressTransportMethod = "http2" +) + +// PossibleIngressTransportMethodValues returns an array of possible values for the IngressTransportMethod const type. +func PossibleIngressTransportMethodValues() []IngressTransportMethod { + return []IngressTransportMethod{IngressTransportMethodAuto, IngressTransportMethodHTTP, IngressTransportMethodHTTP2} +} + +// InsightStatus enumerates the values for insight status. +type InsightStatus string + +const ( + // InsightStatusCritical ... + InsightStatusCritical InsightStatus = "Critical" + // InsightStatusInfo ... + InsightStatusInfo InsightStatus = "Info" + // InsightStatusNone ... + InsightStatusNone InsightStatus = "None" + // InsightStatusSuccess ... + InsightStatusSuccess InsightStatus = "Success" + // InsightStatusWarning ... + InsightStatusWarning InsightStatus = "Warning" +) + +// PossibleInsightStatusValues returns an array of possible values for the InsightStatus const type. +func PossibleInsightStatusValues() []InsightStatus { + return []InsightStatus{InsightStatusCritical, InsightStatusInfo, InsightStatusNone, InsightStatusSuccess, InsightStatusWarning} +} + +// IPFilterTag enumerates the values for ip filter tag. +type IPFilterTag string + +const ( + // IPFilterTagDefault ... + IPFilterTagDefault IPFilterTag = "Default" + // IPFilterTagServiceTag ... + IPFilterTagServiceTag IPFilterTag = "ServiceTag" + // IPFilterTagXffProxy ... + IPFilterTagXffProxy IPFilterTag = "XffProxy" +) + +// PossibleIPFilterTagValues returns an array of possible values for the IPFilterTag const type. +func PossibleIPFilterTagValues() []IPFilterTag { + return []IPFilterTag{IPFilterTagDefault, IPFilterTagServiceTag, IPFilterTagXffProxy} +} + +// IssueType enumerates the values for issue type. +type IssueType string + +const ( + // IssueTypeAppCrash ... + IssueTypeAppCrash IssueType = "AppCrash" + // IssueTypeAppDeployment ... + IssueTypeAppDeployment IssueType = "AppDeployment" + // IssueTypeAseDeployment ... + IssueTypeAseDeployment IssueType = "AseDeployment" + // IssueTypeOther ... + IssueTypeOther IssueType = "Other" + // IssueTypePlatformIssue ... + IssueTypePlatformIssue IssueType = "PlatformIssue" + // IssueTypeRuntimeIssueDetected ... + IssueTypeRuntimeIssueDetected IssueType = "RuntimeIssueDetected" + // IssueTypeServiceIncident ... + IssueTypeServiceIncident IssueType = "ServiceIncident" + // IssueTypeUserIssue ... + IssueTypeUserIssue IssueType = "UserIssue" +) + +// PossibleIssueTypeValues returns an array of possible values for the IssueType const type. +func PossibleIssueTypeValues() []IssueType { + return []IssueType{IssueTypeAppCrash, IssueTypeAppDeployment, IssueTypeAseDeployment, IssueTypeOther, IssueTypePlatformIssue, IssueTypeRuntimeIssueDetected, IssueTypeServiceIncident, IssueTypeUserIssue} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeContinuous ... + JobTypeContinuous JobType = "Continuous" + // JobTypeTriggered ... + JobTypeTriggered JobType = "Triggered" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeContinuous, JobTypeTriggered} +} + +// KeyVaultSecretStatus enumerates the values for key vault secret status. +type KeyVaultSecretStatus string + +const ( + // KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault ... + KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault KeyVaultSecretStatus = "AzureServiceUnauthorizedToAccessKeyVault" + // KeyVaultSecretStatusCertificateOrderFailed ... + KeyVaultSecretStatusCertificateOrderFailed KeyVaultSecretStatus = "CertificateOrderFailed" + // KeyVaultSecretStatusExternalPrivateKey ... + KeyVaultSecretStatusExternalPrivateKey KeyVaultSecretStatus = "ExternalPrivateKey" + // KeyVaultSecretStatusInitialized ... + KeyVaultSecretStatusInitialized KeyVaultSecretStatus = "Initialized" + // KeyVaultSecretStatusKeyVaultDoesNotExist ... + KeyVaultSecretStatusKeyVaultDoesNotExist KeyVaultSecretStatus = "KeyVaultDoesNotExist" + // KeyVaultSecretStatusKeyVaultSecretDoesNotExist ... + KeyVaultSecretStatusKeyVaultSecretDoesNotExist KeyVaultSecretStatus = "KeyVaultSecretDoesNotExist" + // KeyVaultSecretStatusOperationNotPermittedOnKeyVault ... + KeyVaultSecretStatusOperationNotPermittedOnKeyVault KeyVaultSecretStatus = "OperationNotPermittedOnKeyVault" + // KeyVaultSecretStatusSucceeded ... + KeyVaultSecretStatusSucceeded KeyVaultSecretStatus = "Succeeded" + // KeyVaultSecretStatusUnknown ... + KeyVaultSecretStatusUnknown KeyVaultSecretStatus = "Unknown" + // KeyVaultSecretStatusUnknownError ... + KeyVaultSecretStatusUnknownError KeyVaultSecretStatus = "UnknownError" + // KeyVaultSecretStatusWaitingOnCertificateOrder ... + KeyVaultSecretStatusWaitingOnCertificateOrder KeyVaultSecretStatus = "WaitingOnCertificateOrder" +) + +// PossibleKeyVaultSecretStatusValues returns an array of possible values for the KeyVaultSecretStatus const type. +func PossibleKeyVaultSecretStatusValues() []KeyVaultSecretStatus { + return []KeyVaultSecretStatus{KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault, KeyVaultSecretStatusCertificateOrderFailed, KeyVaultSecretStatusExternalPrivateKey, KeyVaultSecretStatusInitialized, KeyVaultSecretStatusKeyVaultDoesNotExist, KeyVaultSecretStatusKeyVaultSecretDoesNotExist, KeyVaultSecretStatusOperationNotPermittedOnKeyVault, KeyVaultSecretStatusSucceeded, KeyVaultSecretStatusUnknown, KeyVaultSecretStatusUnknownError, KeyVaultSecretStatusWaitingOnCertificateOrder} +} + +// KubeEnvironmentProvisioningState enumerates the values for kube environment provisioning state. +type KubeEnvironmentProvisioningState string + +const ( + // KubeEnvironmentProvisioningStateCanceled ... + KubeEnvironmentProvisioningStateCanceled KubeEnvironmentProvisioningState = "Canceled" + // KubeEnvironmentProvisioningStateFailed ... + KubeEnvironmentProvisioningStateFailed KubeEnvironmentProvisioningState = "Failed" + // KubeEnvironmentProvisioningStateInfrastructureSetupComplete ... + KubeEnvironmentProvisioningStateInfrastructureSetupComplete KubeEnvironmentProvisioningState = "InfrastructureSetupComplete" + // KubeEnvironmentProvisioningStateInfrastructureSetupInProgress ... + KubeEnvironmentProvisioningStateInfrastructureSetupInProgress KubeEnvironmentProvisioningState = "InfrastructureSetupInProgress" + // KubeEnvironmentProvisioningStateInitializationInProgress ... + KubeEnvironmentProvisioningStateInitializationInProgress KubeEnvironmentProvisioningState = "InitializationInProgress" + // KubeEnvironmentProvisioningStateScheduledForDelete ... + KubeEnvironmentProvisioningStateScheduledForDelete KubeEnvironmentProvisioningState = "ScheduledForDelete" + // KubeEnvironmentProvisioningStateSucceeded ... + KubeEnvironmentProvisioningStateSucceeded KubeEnvironmentProvisioningState = "Succeeded" + // KubeEnvironmentProvisioningStateUpgradeFailed ... + KubeEnvironmentProvisioningStateUpgradeFailed KubeEnvironmentProvisioningState = "UpgradeFailed" + // KubeEnvironmentProvisioningStateUpgradeRequested ... + KubeEnvironmentProvisioningStateUpgradeRequested KubeEnvironmentProvisioningState = "UpgradeRequested" + // KubeEnvironmentProvisioningStateWaiting ... + KubeEnvironmentProvisioningStateWaiting KubeEnvironmentProvisioningState = "Waiting" +) + +// PossibleKubeEnvironmentProvisioningStateValues returns an array of possible values for the KubeEnvironmentProvisioningState const type. +func PossibleKubeEnvironmentProvisioningStateValues() []KubeEnvironmentProvisioningState { + return []KubeEnvironmentProvisioningState{KubeEnvironmentProvisioningStateCanceled, KubeEnvironmentProvisioningStateFailed, KubeEnvironmentProvisioningStateInfrastructureSetupComplete, KubeEnvironmentProvisioningStateInfrastructureSetupInProgress, KubeEnvironmentProvisioningStateInitializationInProgress, KubeEnvironmentProvisioningStateScheduledForDelete, KubeEnvironmentProvisioningStateSucceeded, KubeEnvironmentProvisioningStateUpgradeFailed, KubeEnvironmentProvisioningStateUpgradeRequested, KubeEnvironmentProvisioningStateWaiting} +} + +// LoadBalancingMode enumerates the values for load balancing mode. +type LoadBalancingMode string + +const ( + // LoadBalancingModeNone ... + LoadBalancingModeNone LoadBalancingMode = "None" + // LoadBalancingModePublishing ... + LoadBalancingModePublishing LoadBalancingMode = "Publishing" + // LoadBalancingModeWeb ... + LoadBalancingModeWeb LoadBalancingMode = "Web" + // LoadBalancingModeWebPublishing ... + LoadBalancingModeWebPublishing LoadBalancingMode = "Web, Publishing" +) + +// PossibleLoadBalancingModeValues returns an array of possible values for the LoadBalancingMode const type. +func PossibleLoadBalancingModeValues() []LoadBalancingMode { + return []LoadBalancingMode{LoadBalancingModeNone, LoadBalancingModePublishing, LoadBalancingModeWeb, LoadBalancingModeWebPublishing} +} + +// LogLevel enumerates the values for log level. +type LogLevel string + +const ( + // LogLevelError ... + LogLevelError LogLevel = "Error" + // LogLevelInformation ... + LogLevelInformation LogLevel = "Information" + // LogLevelOff ... + LogLevelOff LogLevel = "Off" + // LogLevelVerbose ... + LogLevelVerbose LogLevel = "Verbose" + // LogLevelWarning ... + LogLevelWarning LogLevel = "Warning" +) + +// PossibleLogLevelValues returns an array of possible values for the LogLevel const type. +func PossibleLogLevelValues() []LogLevel { + return []LogLevel{LogLevelError, LogLevelInformation, LogLevelOff, LogLevelVerbose, LogLevelWarning} +} + +// ManagedPipelineMode enumerates the values for managed pipeline mode. +type ManagedPipelineMode string + +const ( + // ManagedPipelineModeClassic ... + ManagedPipelineModeClassic ManagedPipelineMode = "Classic" + // ManagedPipelineModeIntegrated ... + ManagedPipelineModeIntegrated ManagedPipelineMode = "Integrated" +) + +// PossibleManagedPipelineModeValues returns an array of possible values for the ManagedPipelineMode const type. +func PossibleManagedPipelineModeValues() []ManagedPipelineMode { + return []ManagedPipelineMode{ManagedPipelineModeClassic, ManagedPipelineModeIntegrated} +} + +// ManagedServiceIdentityType enumerates the values for managed service identity type. +type ManagedServiceIdentityType string + +const ( + // ManagedServiceIdentityTypeNone ... + ManagedServiceIdentityTypeNone ManagedServiceIdentityType = "None" + // ManagedServiceIdentityTypeSystemAssigned ... + ManagedServiceIdentityTypeSystemAssigned ManagedServiceIdentityType = "SystemAssigned" + // ManagedServiceIdentityTypeSystemAssignedUserAssigned ... + ManagedServiceIdentityTypeSystemAssignedUserAssigned ManagedServiceIdentityType = "SystemAssigned, UserAssigned" + // ManagedServiceIdentityTypeUserAssigned ... + ManagedServiceIdentityTypeUserAssigned ManagedServiceIdentityType = "UserAssigned" +) + +// PossibleManagedServiceIdentityTypeValues returns an array of possible values for the ManagedServiceIdentityType const type. +func PossibleManagedServiceIdentityTypeValues() []ManagedServiceIdentityType { + return []ManagedServiceIdentityType{ManagedServiceIdentityTypeNone, ManagedServiceIdentityTypeSystemAssigned, ManagedServiceIdentityTypeSystemAssignedUserAssigned, ManagedServiceIdentityTypeUserAssigned} +} + +// MSDeployLogEntryType enumerates the values for ms deploy log entry type. +type MSDeployLogEntryType string + +const ( + // MSDeployLogEntryTypeError ... + MSDeployLogEntryTypeError MSDeployLogEntryType = "Error" + // MSDeployLogEntryTypeMessage ... + MSDeployLogEntryTypeMessage MSDeployLogEntryType = "Message" + // MSDeployLogEntryTypeWarning ... + MSDeployLogEntryTypeWarning MSDeployLogEntryType = "Warning" +) + +// PossibleMSDeployLogEntryTypeValues returns an array of possible values for the MSDeployLogEntryType const type. +func PossibleMSDeployLogEntryTypeValues() []MSDeployLogEntryType { + return []MSDeployLogEntryType{MSDeployLogEntryTypeError, MSDeployLogEntryTypeMessage, MSDeployLogEntryTypeWarning} +} + +// MSDeployProvisioningState enumerates the values for ms deploy provisioning state. +type MSDeployProvisioningState string + +const ( + // MSDeployProvisioningStateAccepted ... + MSDeployProvisioningStateAccepted MSDeployProvisioningState = "accepted" + // MSDeployProvisioningStateCanceled ... + MSDeployProvisioningStateCanceled MSDeployProvisioningState = "canceled" + // MSDeployProvisioningStateFailed ... + MSDeployProvisioningStateFailed MSDeployProvisioningState = "failed" + // MSDeployProvisioningStateRunning ... + MSDeployProvisioningStateRunning MSDeployProvisioningState = "running" + // MSDeployProvisioningStateSucceeded ... + MSDeployProvisioningStateSucceeded MSDeployProvisioningState = "succeeded" +) + +// PossibleMSDeployProvisioningStateValues returns an array of possible values for the MSDeployProvisioningState const type. +func PossibleMSDeployProvisioningStateValues() []MSDeployProvisioningState { + return []MSDeployProvisioningState{MSDeployProvisioningStateAccepted, MSDeployProvisioningStateCanceled, MSDeployProvisioningStateFailed, MSDeployProvisioningStateRunning, MSDeployProvisioningStateSucceeded} +} + +// MySQLMigrationType enumerates the values for my sql migration type. +type MySQLMigrationType string + +const ( + // MySQLMigrationTypeLocalToRemote ... + MySQLMigrationTypeLocalToRemote MySQLMigrationType = "LocalToRemote" + // MySQLMigrationTypeRemoteToLocal ... + MySQLMigrationTypeRemoteToLocal MySQLMigrationType = "RemoteToLocal" +) + +// PossibleMySQLMigrationTypeValues returns an array of possible values for the MySQLMigrationType const type. +func PossibleMySQLMigrationTypeValues() []MySQLMigrationType { + return []MySQLMigrationType{MySQLMigrationTypeLocalToRemote, MySQLMigrationTypeRemoteToLocal} +} + +// NotificationLevel enumerates the values for notification level. +type NotificationLevel string + +const ( + // NotificationLevelCritical ... + NotificationLevelCritical NotificationLevel = "Critical" + // NotificationLevelInformation ... + NotificationLevelInformation NotificationLevel = "Information" + // NotificationLevelNonUrgentSuggestion ... + NotificationLevelNonUrgentSuggestion NotificationLevel = "NonUrgentSuggestion" + // NotificationLevelWarning ... + NotificationLevelWarning NotificationLevel = "Warning" +) + +// PossibleNotificationLevelValues returns an array of possible values for the NotificationLevel const type. +func PossibleNotificationLevelValues() []NotificationLevel { + return []NotificationLevel{NotificationLevelCritical, NotificationLevelInformation, NotificationLevelNonUrgentSuggestion, NotificationLevelWarning} +} + +// OperationStatus enumerates the values for operation status. +type OperationStatus string + +const ( + // OperationStatusCreated ... + OperationStatusCreated OperationStatus = "Created" + // OperationStatusFailed ... + OperationStatusFailed OperationStatus = "Failed" + // OperationStatusInProgress ... + OperationStatusInProgress OperationStatus = "InProgress" + // OperationStatusSucceeded ... + OperationStatusSucceeded OperationStatus = "Succeeded" + // OperationStatusTimedOut ... + OperationStatusTimedOut OperationStatus = "TimedOut" +) + +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{OperationStatusCreated, OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded, OperationStatusTimedOut} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateInProgress ... + ProvisioningStateInProgress ProvisioningState = "InProgress" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateInProgress, ProvisioningStateSucceeded} +} + +// PublicCertificateLocation enumerates the values for public certificate location. +type PublicCertificateLocation string + +const ( + // PublicCertificateLocationCurrentUserMy ... + PublicCertificateLocationCurrentUserMy PublicCertificateLocation = "CurrentUserMy" + // PublicCertificateLocationLocalMachineMy ... + PublicCertificateLocationLocalMachineMy PublicCertificateLocation = "LocalMachineMy" + // PublicCertificateLocationUnknown ... + PublicCertificateLocationUnknown PublicCertificateLocation = "Unknown" +) + +// PossiblePublicCertificateLocationValues returns an array of possible values for the PublicCertificateLocation const type. +func PossiblePublicCertificateLocationValues() []PublicCertificateLocation { + return []PublicCertificateLocation{PublicCertificateLocationCurrentUserMy, PublicCertificateLocationLocalMachineMy, PublicCertificateLocationUnknown} +} + +// PublishingProfileFormat enumerates the values for publishing profile format. +type PublishingProfileFormat string + +const ( + // PublishingProfileFormatFileZilla3 ... + PublishingProfileFormatFileZilla3 PublishingProfileFormat = "FileZilla3" + // PublishingProfileFormatFtp ... + PublishingProfileFormatFtp PublishingProfileFormat = "Ftp" + // PublishingProfileFormatWebDeploy ... + PublishingProfileFormatWebDeploy PublishingProfileFormat = "WebDeploy" +) + +// PossiblePublishingProfileFormatValues returns an array of possible values for the PublishingProfileFormat const type. +func PossiblePublishingProfileFormatValues() []PublishingProfileFormat { + return []PublishingProfileFormat{PublishingProfileFormatFileZilla3, PublishingProfileFormatFtp, PublishingProfileFormatWebDeploy} +} + +// RedundancyMode enumerates the values for redundancy mode. +type RedundancyMode string + +const ( + // RedundancyModeActiveActive ... + RedundancyModeActiveActive RedundancyMode = "ActiveActive" + // RedundancyModeFailover ... + RedundancyModeFailover RedundancyMode = "Failover" + // RedundancyModeGeoRedundant ... + RedundancyModeGeoRedundant RedundancyMode = "GeoRedundant" + // RedundancyModeManual ... + RedundancyModeManual RedundancyMode = "Manual" + // RedundancyModeNone ... + RedundancyModeNone RedundancyMode = "None" +) + +// PossibleRedundancyModeValues returns an array of possible values for the RedundancyMode const type. +func PossibleRedundancyModeValues() []RedundancyMode { + return []RedundancyMode{RedundancyModeActiveActive, RedundancyModeFailover, RedundancyModeGeoRedundant, RedundancyModeManual, RedundancyModeNone} +} + +// RenderingType enumerates the values for rendering type. +type RenderingType string + +const ( + // RenderingTypeAppInsight ... + RenderingTypeAppInsight RenderingType = "AppInsight" + // RenderingTypeAppInsightEnablement ... + RenderingTypeAppInsightEnablement RenderingType = "AppInsightEnablement" + // RenderingTypeCard ... + RenderingTypeCard RenderingType = "Card" + // RenderingTypeChangeAnalysisOnboarding ... + RenderingTypeChangeAnalysisOnboarding RenderingType = "ChangeAnalysisOnboarding" + // RenderingTypeChangeSets ... + RenderingTypeChangeSets RenderingType = "ChangeSets" + // RenderingTypeChangesView ... + RenderingTypeChangesView RenderingType = "ChangesView" + // RenderingTypeDataSummary ... + RenderingTypeDataSummary RenderingType = "DataSummary" + // RenderingTypeDependencyGraph ... + RenderingTypeDependencyGraph RenderingType = "DependencyGraph" + // RenderingTypeDetector ... + RenderingTypeDetector RenderingType = "Detector" + // RenderingTypeDownTime ... + RenderingTypeDownTime RenderingType = "DownTime" + // RenderingTypeDropDown ... + RenderingTypeDropDown RenderingType = "DropDown" + // RenderingTypeDynamicInsight ... + RenderingTypeDynamicInsight RenderingType = "DynamicInsight" + // RenderingTypeEmail ... + RenderingTypeEmail RenderingType = "Email" + // RenderingTypeForm ... + RenderingTypeForm RenderingType = "Form" + // RenderingTypeGuage ... + RenderingTypeGuage RenderingType = "Guage" + // RenderingTypeInsights ... + RenderingTypeInsights RenderingType = "Insights" + // RenderingTypeMarkdown ... + RenderingTypeMarkdown RenderingType = "Markdown" + // RenderingTypeNoGraph ... + RenderingTypeNoGraph RenderingType = "NoGraph" + // RenderingTypePieChart ... + RenderingTypePieChart RenderingType = "PieChart" + // RenderingTypeSearchComponent ... + RenderingTypeSearchComponent RenderingType = "SearchComponent" + // RenderingTypeSolution ... + RenderingTypeSolution RenderingType = "Solution" + // RenderingTypeSummaryCard ... + RenderingTypeSummaryCard RenderingType = "SummaryCard" + // RenderingTypeTable ... + RenderingTypeTable RenderingType = "Table" + // RenderingTypeTimeSeries ... + RenderingTypeTimeSeries RenderingType = "TimeSeries" + // RenderingTypeTimeSeriesPerInstance ... + RenderingTypeTimeSeriesPerInstance RenderingType = "TimeSeriesPerInstance" +) + +// PossibleRenderingTypeValues returns an array of possible values for the RenderingType const type. +func PossibleRenderingTypeValues() []RenderingType { + return []RenderingType{RenderingTypeAppInsight, RenderingTypeAppInsightEnablement, RenderingTypeCard, RenderingTypeChangeAnalysisOnboarding, RenderingTypeChangeSets, RenderingTypeChangesView, RenderingTypeDataSummary, RenderingTypeDependencyGraph, RenderingTypeDetector, RenderingTypeDownTime, RenderingTypeDropDown, RenderingTypeDynamicInsight, RenderingTypeEmail, RenderingTypeForm, RenderingTypeGuage, RenderingTypeInsights, RenderingTypeMarkdown, RenderingTypeNoGraph, RenderingTypePieChart, RenderingTypeSearchComponent, RenderingTypeSolution, RenderingTypeSummaryCard, RenderingTypeTable, RenderingTypeTimeSeries, RenderingTypeTimeSeriesPerInstance} +} + +// ResolveStatus enumerates the values for resolve status. +type ResolveStatus string + +const ( + // ResolveStatusAccessToKeyVaultDenied ... + ResolveStatusAccessToKeyVaultDenied ResolveStatus = "AccessToKeyVaultDenied" + // ResolveStatusFetchTimedOut ... + ResolveStatusFetchTimedOut ResolveStatus = "FetchTimedOut" + // ResolveStatusInitialized ... + ResolveStatusInitialized ResolveStatus = "Initialized" + // ResolveStatusInvalidSyntax ... + ResolveStatusInvalidSyntax ResolveStatus = "InvalidSyntax" + // ResolveStatusMSINotEnabled ... + ResolveStatusMSINotEnabled ResolveStatus = "MSINotEnabled" + // ResolveStatusOtherReasons ... + ResolveStatusOtherReasons ResolveStatus = "OtherReasons" + // ResolveStatusResolved ... + ResolveStatusResolved ResolveStatus = "Resolved" + // ResolveStatusSecretNotFound ... + ResolveStatusSecretNotFound ResolveStatus = "SecretNotFound" + // ResolveStatusSecretVersionNotFound ... + ResolveStatusSecretVersionNotFound ResolveStatus = "SecretVersionNotFound" + // ResolveStatusUnauthorizedClient ... + ResolveStatusUnauthorizedClient ResolveStatus = "UnauthorizedClient" + // ResolveStatusVaultNotFound ... + ResolveStatusVaultNotFound ResolveStatus = "VaultNotFound" +) + +// PossibleResolveStatusValues returns an array of possible values for the ResolveStatus const type. +func PossibleResolveStatusValues() []ResolveStatus { + return []ResolveStatus{ResolveStatusAccessToKeyVaultDenied, ResolveStatusFetchTimedOut, ResolveStatusInitialized, ResolveStatusInvalidSyntax, ResolveStatusMSINotEnabled, ResolveStatusOtherReasons, ResolveStatusResolved, ResolveStatusSecretNotFound, ResolveStatusSecretVersionNotFound, ResolveStatusUnauthorizedClient, ResolveStatusVaultNotFound} +} + +// ResourceScopeType enumerates the values for resource scope type. +type ResourceScopeType string + +const ( + // ResourceScopeTypeServerFarm ... + ResourceScopeTypeServerFarm ResourceScopeType = "ServerFarm" + // ResourceScopeTypeSubscription ... + ResourceScopeTypeSubscription ResourceScopeType = "Subscription" + // ResourceScopeTypeWebSite ... + ResourceScopeTypeWebSite ResourceScopeType = "WebSite" +) + +// PossibleResourceScopeTypeValues returns an array of possible values for the ResourceScopeType const type. +func PossibleResourceScopeTypeValues() []ResourceScopeType { + return []ResourceScopeType{ResourceScopeTypeServerFarm, ResourceScopeTypeSubscription, ResourceScopeTypeWebSite} +} + +// RevisionHealthState enumerates the values for revision health state. +type RevisionHealthState string + +const ( + // RevisionHealthStateHealthy ... + RevisionHealthStateHealthy RevisionHealthState = "Healthy" + // RevisionHealthStateNone ... + RevisionHealthStateNone RevisionHealthState = "None" + // RevisionHealthStateUnhealthy ... + RevisionHealthStateUnhealthy RevisionHealthState = "Unhealthy" +) + +// PossibleRevisionHealthStateValues returns an array of possible values for the RevisionHealthState const type. +func PossibleRevisionHealthStateValues() []RevisionHealthState { + return []RevisionHealthState{RevisionHealthStateHealthy, RevisionHealthStateNone, RevisionHealthStateUnhealthy} +} + +// RevisionProvisioningState enumerates the values for revision provisioning state. +type RevisionProvisioningState string + +const ( + // RevisionProvisioningStateDeprovisioned ... + RevisionProvisioningStateDeprovisioned RevisionProvisioningState = "Deprovisioned" + // RevisionProvisioningStateDeprovisioning ... + RevisionProvisioningStateDeprovisioning RevisionProvisioningState = "Deprovisioning" + // RevisionProvisioningStateFailed ... + RevisionProvisioningStateFailed RevisionProvisioningState = "Failed" + // RevisionProvisioningStateProvisioned ... + RevisionProvisioningStateProvisioned RevisionProvisioningState = "Provisioned" + // RevisionProvisioningStateProvisioning ... + RevisionProvisioningStateProvisioning RevisionProvisioningState = "Provisioning" +) + +// PossibleRevisionProvisioningStateValues returns an array of possible values for the RevisionProvisioningState const type. +func PossibleRevisionProvisioningStateValues() []RevisionProvisioningState { + return []RevisionProvisioningState{RevisionProvisioningStateDeprovisioned, RevisionProvisioningStateDeprovisioning, RevisionProvisioningStateFailed, RevisionProvisioningStateProvisioned, RevisionProvisioningStateProvisioning} +} + +// RouteType enumerates the values for route type. +type RouteType string + +const ( + // RouteTypeDEFAULT ... + RouteTypeDEFAULT RouteType = "DEFAULT" + // RouteTypeINHERITED ... + RouteTypeINHERITED RouteType = "INHERITED" + // RouteTypeSTATIC ... + RouteTypeSTATIC RouteType = "STATIC" +) + +// PossibleRouteTypeValues returns an array of possible values for the RouteType const type. +func PossibleRouteTypeValues() []RouteType { + return []RouteType{RouteTypeDEFAULT, RouteTypeINHERITED, RouteTypeSTATIC} +} + +// ScmType enumerates the values for scm type. +type ScmType string + +const ( + // ScmTypeBitbucketGit ... + ScmTypeBitbucketGit ScmType = "BitbucketGit" + // ScmTypeBitbucketHg ... + ScmTypeBitbucketHg ScmType = "BitbucketHg" + // ScmTypeCodePlexGit ... + ScmTypeCodePlexGit ScmType = "CodePlexGit" + // ScmTypeCodePlexHg ... + ScmTypeCodePlexHg ScmType = "CodePlexHg" + // ScmTypeDropbox ... + ScmTypeDropbox ScmType = "Dropbox" + // ScmTypeExternalGit ... + ScmTypeExternalGit ScmType = "ExternalGit" + // ScmTypeExternalHg ... + ScmTypeExternalHg ScmType = "ExternalHg" + // ScmTypeGitHub ... + ScmTypeGitHub ScmType = "GitHub" + // ScmTypeLocalGit ... + ScmTypeLocalGit ScmType = "LocalGit" + // ScmTypeNone ... + ScmTypeNone ScmType = "None" + // ScmTypeOneDrive ... + ScmTypeOneDrive ScmType = "OneDrive" + // ScmTypeTfs ... + ScmTypeTfs ScmType = "Tfs" + // ScmTypeVSO ... + ScmTypeVSO ScmType = "VSO" + // ScmTypeVSTSRM ... + ScmTypeVSTSRM ScmType = "VSTSRM" +) + +// PossibleScmTypeValues returns an array of possible values for the ScmType const type. +func PossibleScmTypeValues() []ScmType { + return []ScmType{ScmTypeBitbucketGit, ScmTypeBitbucketHg, ScmTypeCodePlexGit, ScmTypeCodePlexHg, ScmTypeDropbox, ScmTypeExternalGit, ScmTypeExternalHg, ScmTypeGitHub, ScmTypeLocalGit, ScmTypeNone, ScmTypeOneDrive, ScmTypeTfs, ScmTypeVSO, ScmTypeVSTSRM} +} + +// SiteAvailabilityState enumerates the values for site availability state. +type SiteAvailabilityState string + +const ( + // SiteAvailabilityStateDisasterRecoveryMode ... + SiteAvailabilityStateDisasterRecoveryMode SiteAvailabilityState = "DisasterRecoveryMode" + // SiteAvailabilityStateLimited ... + SiteAvailabilityStateLimited SiteAvailabilityState = "Limited" + // SiteAvailabilityStateNormal ... + SiteAvailabilityStateNormal SiteAvailabilityState = "Normal" +) + +// PossibleSiteAvailabilityStateValues returns an array of possible values for the SiteAvailabilityState const type. +func PossibleSiteAvailabilityStateValues() []SiteAvailabilityState { + return []SiteAvailabilityState{SiteAvailabilityStateDisasterRecoveryMode, SiteAvailabilityStateLimited, SiteAvailabilityStateNormal} +} + +// SiteExtensionType enumerates the values for site extension type. +type SiteExtensionType string + +const ( + // SiteExtensionTypeGallery ... + SiteExtensionTypeGallery SiteExtensionType = "Gallery" + // SiteExtensionTypeWebRoot ... + SiteExtensionTypeWebRoot SiteExtensionType = "WebRoot" +) + +// PossibleSiteExtensionTypeValues returns an array of possible values for the SiteExtensionType const type. +func PossibleSiteExtensionTypeValues() []SiteExtensionType { + return []SiteExtensionType{SiteExtensionTypeGallery, SiteExtensionTypeWebRoot} +} + +// SiteLoadBalancing enumerates the values for site load balancing. +type SiteLoadBalancing string + +const ( + // SiteLoadBalancingLeastRequests ... + SiteLoadBalancingLeastRequests SiteLoadBalancing = "LeastRequests" + // SiteLoadBalancingLeastResponseTime ... + SiteLoadBalancingLeastResponseTime SiteLoadBalancing = "LeastResponseTime" + // SiteLoadBalancingPerSiteRoundRobin ... + SiteLoadBalancingPerSiteRoundRobin SiteLoadBalancing = "PerSiteRoundRobin" + // SiteLoadBalancingRequestHash ... + SiteLoadBalancingRequestHash SiteLoadBalancing = "RequestHash" + // SiteLoadBalancingWeightedRoundRobin ... + SiteLoadBalancingWeightedRoundRobin SiteLoadBalancing = "WeightedRoundRobin" + // SiteLoadBalancingWeightedTotalTraffic ... + SiteLoadBalancingWeightedTotalTraffic SiteLoadBalancing = "WeightedTotalTraffic" +) + +// PossibleSiteLoadBalancingValues returns an array of possible values for the SiteLoadBalancing const type. +func PossibleSiteLoadBalancingValues() []SiteLoadBalancing { + return []SiteLoadBalancing{SiteLoadBalancingLeastRequests, SiteLoadBalancingLeastResponseTime, SiteLoadBalancingPerSiteRoundRobin, SiteLoadBalancingRequestHash, SiteLoadBalancingWeightedRoundRobin, SiteLoadBalancingWeightedTotalTraffic} +} + +// SiteRuntimeState enumerates the values for site runtime state. +type SiteRuntimeState string + +const ( + // SiteRuntimeStateREADY ... + SiteRuntimeStateREADY SiteRuntimeState = "READY" + // SiteRuntimeStateSTOPPED ... + SiteRuntimeStateSTOPPED SiteRuntimeState = "STOPPED" + // SiteRuntimeStateUNKNOWN ... + SiteRuntimeStateUNKNOWN SiteRuntimeState = "UNKNOWN" +) + +// PossibleSiteRuntimeStateValues returns an array of possible values for the SiteRuntimeState const type. +func PossibleSiteRuntimeStateValues() []SiteRuntimeState { + return []SiteRuntimeState{SiteRuntimeStateREADY, SiteRuntimeStateSTOPPED, SiteRuntimeStateUNKNOWN} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // SkuNameBasic ... + SkuNameBasic SkuName = "Basic" + // SkuNameDynamic ... + SkuNameDynamic SkuName = "Dynamic" + // SkuNameElasticIsolated ... + SkuNameElasticIsolated SkuName = "ElasticIsolated" + // SkuNameElasticPremium ... + SkuNameElasticPremium SkuName = "ElasticPremium" + // SkuNameFree ... + SkuNameFree SkuName = "Free" + // SkuNameIsolated ... + SkuNameIsolated SkuName = "Isolated" + // SkuNameIsolatedV2 ... + SkuNameIsolatedV2 SkuName = "IsolatedV2" + // SkuNamePremium ... + SkuNamePremium SkuName = "Premium" + // SkuNamePremiumContainer ... + SkuNamePremiumContainer SkuName = "PremiumContainer" + // SkuNamePremiumV2 ... + SkuNamePremiumV2 SkuName = "PremiumV2" + // SkuNamePremiumV3 ... + SkuNamePremiumV3 SkuName = "PremiumV3" + // SkuNameShared ... + SkuNameShared SkuName = "Shared" + // SkuNameStandard ... + SkuNameStandard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{SkuNameBasic, SkuNameDynamic, SkuNameElasticIsolated, SkuNameElasticPremium, SkuNameFree, SkuNameIsolated, SkuNameIsolatedV2, SkuNamePremium, SkuNamePremiumContainer, SkuNamePremiumV2, SkuNamePremiumV3, SkuNameShared, SkuNameStandard} +} + +// SolutionType enumerates the values for solution type. +type SolutionType string + +const ( + // SolutionTypeBestPractices ... + SolutionTypeBestPractices SolutionType = "BestPractices" + // SolutionTypeDeepInvestigation ... + SolutionTypeDeepInvestigation SolutionType = "DeepInvestigation" + // SolutionTypeQuickSolution ... + SolutionTypeQuickSolution SolutionType = "QuickSolution" +) + +// PossibleSolutionTypeValues returns an array of possible values for the SolutionType const type. +func PossibleSolutionTypeValues() []SolutionType { + return []SolutionType{SolutionTypeBestPractices, SolutionTypeDeepInvestigation, SolutionTypeQuickSolution} +} + +// SslState enumerates the values for ssl state. +type SslState string + +const ( + // SslStateDisabled ... + SslStateDisabled SslState = "Disabled" + // SslStateIPBasedEnabled ... + SslStateIPBasedEnabled SslState = "IpBasedEnabled" + // SslStateSniEnabled ... + SslStateSniEnabled SslState = "SniEnabled" +) + +// PossibleSslStateValues returns an array of possible values for the SslState const type. +func PossibleSslStateValues() []SslState { + return []SslState{SslStateDisabled, SslStateIPBasedEnabled, SslStateSniEnabled} +} + +// StackPreferredOs enumerates the values for stack preferred os. +type StackPreferredOs string + +const ( + // StackPreferredOsLinux ... + StackPreferredOsLinux StackPreferredOs = "Linux" + // StackPreferredOsWindows ... + StackPreferredOsWindows StackPreferredOs = "Windows" +) + +// PossibleStackPreferredOsValues returns an array of possible values for the StackPreferredOs const type. +func PossibleStackPreferredOsValues() []StackPreferredOs { + return []StackPreferredOs{StackPreferredOsLinux, StackPreferredOsWindows} +} + +// StagingEnvironmentPolicy enumerates the values for staging environment policy. +type StagingEnvironmentPolicy string + +const ( + // StagingEnvironmentPolicyDisabled ... + StagingEnvironmentPolicyDisabled StagingEnvironmentPolicy = "Disabled" + // StagingEnvironmentPolicyEnabled ... + StagingEnvironmentPolicyEnabled StagingEnvironmentPolicy = "Enabled" +) + +// PossibleStagingEnvironmentPolicyValues returns an array of possible values for the StagingEnvironmentPolicy const type. +func PossibleStagingEnvironmentPolicyValues() []StagingEnvironmentPolicy { + return []StagingEnvironmentPolicy{StagingEnvironmentPolicyDisabled, StagingEnvironmentPolicyEnabled} +} + +// StatusOptions enumerates the values for status options. +type StatusOptions string + +const ( + // StatusOptionsCreating ... + StatusOptionsCreating StatusOptions = "Creating" + // StatusOptionsPending ... + StatusOptionsPending StatusOptions = "Pending" + // StatusOptionsReady ... + StatusOptionsReady StatusOptions = "Ready" +) + +// PossibleStatusOptionsValues returns an array of possible values for the StatusOptions const type. +func PossibleStatusOptionsValues() []StatusOptions { + return []StatusOptions{StatusOptionsCreating, StatusOptionsPending, StatusOptionsReady} +} + +// StorageType enumerates the values for storage type. +type StorageType string + +const ( + // StorageTypeLocalNode ... + StorageTypeLocalNode StorageType = "LocalNode" + // StorageTypeNetworkFileSystem ... + StorageTypeNetworkFileSystem StorageType = "NetworkFileSystem" +) + +// PossibleStorageTypeValues returns an array of possible values for the StorageType const type. +func PossibleStorageTypeValues() []StorageType { + return []StorageType{StorageTypeLocalNode, StorageTypeNetworkFileSystem} +} + +// SupportedTLSVersions enumerates the values for supported tls versions. +type SupportedTLSVersions string + +const ( + // SupportedTLSVersionsOneFullStopOne ... + SupportedTLSVersionsOneFullStopOne SupportedTLSVersions = "1.1" + // SupportedTLSVersionsOneFullStopTwo ... + SupportedTLSVersionsOneFullStopTwo SupportedTLSVersions = "1.2" + // SupportedTLSVersionsOneFullStopZero ... + SupportedTLSVersionsOneFullStopZero SupportedTLSVersions = "1.0" +) + +// PossibleSupportedTLSVersionsValues returns an array of possible values for the SupportedTLSVersions const type. +func PossibleSupportedTLSVersionsValues() []SupportedTLSVersions { + return []SupportedTLSVersions{SupportedTLSVersionsOneFullStopOne, SupportedTLSVersionsOneFullStopTwo, SupportedTLSVersionsOneFullStopZero} +} + +// TriggeredWebJobStatus enumerates the values for triggered web job status. +type TriggeredWebJobStatus string + +const ( + // TriggeredWebJobStatusError ... + TriggeredWebJobStatusError TriggeredWebJobStatus = "Error" + // TriggeredWebJobStatusFailed ... + TriggeredWebJobStatusFailed TriggeredWebJobStatus = "Failed" + // TriggeredWebJobStatusSuccess ... + TriggeredWebJobStatusSuccess TriggeredWebJobStatus = "Success" +) + +// PossibleTriggeredWebJobStatusValues returns an array of possible values for the TriggeredWebJobStatus const type. +func PossibleTriggeredWebJobStatusValues() []TriggeredWebJobStatus { + return []TriggeredWebJobStatus{TriggeredWebJobStatusError, TriggeredWebJobStatusFailed, TriggeredWebJobStatusSuccess} +} + +// TriggerTypes enumerates the values for trigger types. +type TriggerTypes string + +const ( + // TriggerTypesHTTPTrigger ... + TriggerTypesHTTPTrigger TriggerTypes = "HttpTrigger" + // TriggerTypesUnknown ... + TriggerTypesUnknown TriggerTypes = "Unknown" +) + +// PossibleTriggerTypesValues returns an array of possible values for the TriggerTypes const type. +func PossibleTriggerTypesValues() []TriggerTypes { + return []TriggerTypes{TriggerTypesHTTPTrigger, TriggerTypesUnknown} +} + +// UnauthenticatedClientAction enumerates the values for unauthenticated client action. +type UnauthenticatedClientAction string + +const ( + // UnauthenticatedClientActionAllowAnonymous ... + UnauthenticatedClientActionAllowAnonymous UnauthenticatedClientAction = "AllowAnonymous" + // UnauthenticatedClientActionRedirectToLoginPage ... + UnauthenticatedClientActionRedirectToLoginPage UnauthenticatedClientAction = "RedirectToLoginPage" +) + +// PossibleUnauthenticatedClientActionValues returns an array of possible values for the UnauthenticatedClientAction const type. +func PossibleUnauthenticatedClientActionValues() []UnauthenticatedClientAction { + return []UnauthenticatedClientAction{UnauthenticatedClientActionAllowAnonymous, UnauthenticatedClientActionRedirectToLoginPage} +} + +// UnauthenticatedClientActionV2 enumerates the values for unauthenticated client action v2. +type UnauthenticatedClientActionV2 string + +const ( + // UnauthenticatedClientActionV2AllowAnonymous ... + UnauthenticatedClientActionV2AllowAnonymous UnauthenticatedClientActionV2 = "AllowAnonymous" + // UnauthenticatedClientActionV2RedirectToLoginPage ... + UnauthenticatedClientActionV2RedirectToLoginPage UnauthenticatedClientActionV2 = "RedirectToLoginPage" + // UnauthenticatedClientActionV2Return401 ... + UnauthenticatedClientActionV2Return401 UnauthenticatedClientActionV2 = "Return401" + // UnauthenticatedClientActionV2Return403 ... + UnauthenticatedClientActionV2Return403 UnauthenticatedClientActionV2 = "Return403" +) + +// PossibleUnauthenticatedClientActionV2Values returns an array of possible values for the UnauthenticatedClientActionV2 const type. +func PossibleUnauthenticatedClientActionV2Values() []UnauthenticatedClientActionV2 { + return []UnauthenticatedClientActionV2{UnauthenticatedClientActionV2AllowAnonymous, UnauthenticatedClientActionV2RedirectToLoginPage, UnauthenticatedClientActionV2Return401, UnauthenticatedClientActionV2Return403} +} + +// UsageState enumerates the values for usage state. +type UsageState string + +const ( + // UsageStateExceeded ... + UsageStateExceeded UsageState = "Exceeded" + // UsageStateNormal ... + UsageStateNormal UsageState = "Normal" +) + +// PossibleUsageStateValues returns an array of possible values for the UsageState const type. +func PossibleUsageStateValues() []UsageState { + return []UsageState{UsageStateExceeded, UsageStateNormal} +} + +// ValidateResourceTypes enumerates the values for validate resource types. +type ValidateResourceTypes string + +const ( + // ValidateResourceTypesMicrosoftWebhostingEnvironments ... + ValidateResourceTypesMicrosoftWebhostingEnvironments ValidateResourceTypes = "Microsoft.Web/hostingEnvironments" + // ValidateResourceTypesServerFarm ... + ValidateResourceTypesServerFarm ValidateResourceTypes = "ServerFarm" + // ValidateResourceTypesSite ... + ValidateResourceTypesSite ValidateResourceTypes = "Site" +) + +// PossibleValidateResourceTypesValues returns an array of possible values for the ValidateResourceTypes const type. +func PossibleValidateResourceTypesValues() []ValidateResourceTypes { + return []ValidateResourceTypes{ValidateResourceTypesMicrosoftWebhostingEnvironments, ValidateResourceTypesServerFarm, ValidateResourceTypesSite} +} + +// WorkerSizeOptions enumerates the values for worker size options. +type WorkerSizeOptions string + +const ( + // WorkerSizeOptionsD1 ... + WorkerSizeOptionsD1 WorkerSizeOptions = "D1" + // WorkerSizeOptionsD2 ... + WorkerSizeOptionsD2 WorkerSizeOptions = "D2" + // WorkerSizeOptionsD3 ... + WorkerSizeOptionsD3 WorkerSizeOptions = "D3" + // WorkerSizeOptionsDefault ... + WorkerSizeOptionsDefault WorkerSizeOptions = "Default" + // WorkerSizeOptionsLarge ... + WorkerSizeOptionsLarge WorkerSizeOptions = "Large" + // WorkerSizeOptionsLargeV3 ... + WorkerSizeOptionsLargeV3 WorkerSizeOptions = "LargeV3" + // WorkerSizeOptionsMedium ... + WorkerSizeOptionsMedium WorkerSizeOptions = "Medium" + // WorkerSizeOptionsMediumV3 ... + WorkerSizeOptionsMediumV3 WorkerSizeOptions = "MediumV3" + // WorkerSizeOptionsNestedSmall ... + WorkerSizeOptionsNestedSmall WorkerSizeOptions = "NestedSmall" + // WorkerSizeOptionsNestedSmallLinux ... + WorkerSizeOptionsNestedSmallLinux WorkerSizeOptions = "NestedSmallLinux" + // WorkerSizeOptionsSmall ... + WorkerSizeOptionsSmall WorkerSizeOptions = "Small" + // WorkerSizeOptionsSmallV3 ... + WorkerSizeOptionsSmallV3 WorkerSizeOptions = "SmallV3" +) + +// PossibleWorkerSizeOptionsValues returns an array of possible values for the WorkerSizeOptions const type. +func PossibleWorkerSizeOptionsValues() []WorkerSizeOptions { + return []WorkerSizeOptions{WorkerSizeOptionsD1, WorkerSizeOptionsD2, WorkerSizeOptionsD3, WorkerSizeOptionsDefault, WorkerSizeOptionsLarge, WorkerSizeOptionsLargeV3, WorkerSizeOptionsMedium, WorkerSizeOptionsMediumV3, WorkerSizeOptionsNestedSmall, WorkerSizeOptionsNestedSmallLinux, WorkerSizeOptionsSmall, WorkerSizeOptionsSmallV3} +} diff --git a/services/web/mgmt/2021-03-01/web/global.go b/services/web/mgmt/2021-03-01/web/global.go new file mode 100644 index 000000000000..3e7d015aea25 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/global.go @@ -0,0 +1,254 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// GlobalClient is the webSite Management Client +type GlobalClient struct { + BaseClient +} + +// NewGlobalClient creates an instance of the GlobalClient client. +func NewGlobalClient(subscriptionID string) GlobalClient { + return NewGlobalClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewGlobalClientWithBaseURI creates an instance of the GlobalClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewGlobalClientWithBaseURI(baseURI string, subscriptionID string) GlobalClient { + return GlobalClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetDeletedWebApp description for Get deleted app for a subscription. +// Parameters: +// deletedSiteID - the numeric ID of the deleted app, e.g. 12345 +func (client GlobalClient) GetDeletedWebApp(ctx context.Context, deletedSiteID string) (result DeletedSite, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GlobalClient.GetDeletedWebApp") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetDeletedWebAppPreparer(ctx, deletedSiteID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetDeletedWebApp", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedWebAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetDeletedWebApp", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetDeletedWebApp", resp, "Failure responding to request") + return + } + + return +} + +// GetDeletedWebAppPreparer prepares the GetDeletedWebApp request. +func (client GlobalClient) GetDeletedWebAppPreparer(ctx context.Context, deletedSiteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deletedSiteId": autorest.Encode("path", deletedSiteID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedWebAppSender sends the GetDeletedWebApp request. The method will close the +// http.Response Body if it receives an error. +func (client GlobalClient) GetDeletedWebAppSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDeletedWebAppResponder handles the response to the GetDeletedWebApp request. The method always +// closes the http.Response Body. +func (client GlobalClient) GetDeletedWebAppResponder(resp *http.Response) (result DeletedSite, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDeletedWebAppSnapshots description for Get all deleted apps for a subscription. +// Parameters: +// deletedSiteID - the numeric ID of the deleted app, e.g. 12345 +func (client GlobalClient) GetDeletedWebAppSnapshots(ctx context.Context, deletedSiteID string) (result ListSnapshot, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GlobalClient.GetDeletedWebAppSnapshots") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetDeletedWebAppSnapshotsPreparer(ctx, deletedSiteID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetDeletedWebAppSnapshots", nil, "Failure preparing request") + return + } + + resp, err := client.GetDeletedWebAppSnapshotsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetDeletedWebAppSnapshots", resp, "Failure sending request") + return + } + + result, err = client.GetDeletedWebAppSnapshotsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetDeletedWebAppSnapshots", resp, "Failure responding to request") + return + } + + return +} + +// GetDeletedWebAppSnapshotsPreparer prepares the GetDeletedWebAppSnapshots request. +func (client GlobalClient) GetDeletedWebAppSnapshotsPreparer(ctx context.Context, deletedSiteID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "deletedSiteId": autorest.Encode("path", deletedSiteID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/deletedSites/{deletedSiteId}/snapshots", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDeletedWebAppSnapshotsSender sends the GetDeletedWebAppSnapshots request. The method will close the +// http.Response Body if it receives an error. +func (client GlobalClient) GetDeletedWebAppSnapshotsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDeletedWebAppSnapshotsResponder handles the response to the GetDeletedWebAppSnapshots request. The method always +// closes the http.Response Body. +func (client GlobalClient) GetDeletedWebAppSnapshotsResponder(resp *http.Response) (result ListSnapshot, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetSubscriptionOperationWithAsyncResponse description for Gets an operation in a subscription and given region +// Parameters: +// location - location name +// operationID - operation Id +func (client GlobalClient) GetSubscriptionOperationWithAsyncResponse(ctx context.Context, location string, operationID string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GlobalClient.GetSubscriptionOperationWithAsyncResponse") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetSubscriptionOperationWithAsyncResponsePreparer(ctx, location, operationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionOperationWithAsyncResponse", nil, "Failure preparing request") + return + } + + resp, err := client.GetSubscriptionOperationWithAsyncResponseSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionOperationWithAsyncResponse", resp, "Failure sending request") + return + } + + result, err = client.GetSubscriptionOperationWithAsyncResponseResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.GlobalClient", "GetSubscriptionOperationWithAsyncResponse", resp, "Failure responding to request") + return + } + + return +} + +// GetSubscriptionOperationWithAsyncResponsePreparer prepares the GetSubscriptionOperationWithAsyncResponse request. +func (client GlobalClient) GetSubscriptionOperationWithAsyncResponsePreparer(ctx context.Context, location string, operationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "operationId": autorest.Encode("path", operationID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/operations/{operationId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSubscriptionOperationWithAsyncResponseSender sends the GetSubscriptionOperationWithAsyncResponse request. The method will close the +// http.Response Body if it receives an error. +func (client GlobalClient) GetSubscriptionOperationWithAsyncResponseSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSubscriptionOperationWithAsyncResponseResponder handles the response to the GetSubscriptionOperationWithAsyncResponse request. The method always +// closes the http.Response Body. +func (client GlobalClient) GetSubscriptionOperationWithAsyncResponseResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/web/mgmt/2021-03-01/web/kubeenvironments.go b/services/web/mgmt/2021-03-01/web/kubeenvironments.go new file mode 100644 index 000000000000..6b8a3cca1e4a --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/kubeenvironments.go @@ -0,0 +1,617 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// KubeEnvironmentsClient is the webSite Management Client +type KubeEnvironmentsClient struct { + BaseClient +} + +// NewKubeEnvironmentsClient creates an instance of the KubeEnvironmentsClient client. +func NewKubeEnvironmentsClient(subscriptionID string) KubeEnvironmentsClient { + return NewKubeEnvironmentsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewKubeEnvironmentsClientWithBaseURI creates an instance of the KubeEnvironmentsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewKubeEnvironmentsClientWithBaseURI(baseURI string, subscriptionID string) KubeEnvironmentsClient { + return KubeEnvironmentsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate description for Creates or updates a Kubernetes Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Kubernetes Environment. +// kubeEnvironmentEnvelope - configuration details of the Kubernetes Environment. +func (client KubeEnvironmentsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironment) (result KubeEnvironmentsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.KubeEnvironmentsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, name, kubeEnvironmentEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client KubeEnvironmentsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironment) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}", pathParameters), + autorest.WithJSON(kubeEnvironmentEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client KubeEnvironmentsClient) CreateOrUpdateSender(req *http.Request) (future KubeEnvironmentsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client KubeEnvironmentsClient) CreateOrUpdateResponder(resp *http.Response) (result KubeEnvironment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete description for Delete a Kubernetes Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Kubernetes Environment. +func (client KubeEnvironmentsClient) Delete(ctx context.Context, resourceGroupName string, name string) (result KubeEnvironmentsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.KubeEnvironmentsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client KubeEnvironmentsClient) DeletePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client KubeEnvironmentsClient) DeleteSender(req *http.Request) (future KubeEnvironmentsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client KubeEnvironmentsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get description for Get the properties of a Kubernetes Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Kubernetes Environment. +func (client KubeEnvironmentsClient) Get(ctx context.Context, resourceGroupName string, name string) (result KubeEnvironment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.KubeEnvironmentsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client KubeEnvironmentsClient) GetPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client KubeEnvironmentsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client KubeEnvironmentsClient) GetResponder(resp *http.Response) (result KubeEnvironment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup description for Get all the Kubernetes Environments in a resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client KubeEnvironmentsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result KubeEnvironmentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.kec.Response.Response != nil { + sc = result.kec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.KubeEnvironmentsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.kec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.kec, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.kec.hasNextLink() && result.kec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client KubeEnvironmentsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client KubeEnvironmentsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client KubeEnvironmentsClient) ListByResourceGroupResponder(resp *http.Response) (result KubeEnvironmentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client KubeEnvironmentsClient) listByResourceGroupNextResults(ctx context.Context, lastResults KubeEnvironmentCollection) (result KubeEnvironmentCollection, err error) { + req, err := lastResults.kubeEnvironmentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client KubeEnvironmentsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result KubeEnvironmentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription description for Get all Kubernetes Environments for a subscription. +func (client KubeEnvironmentsClient) ListBySubscription(ctx context.Context) (result KubeEnvironmentCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.ListBySubscription") + defer func() { + sc := -1 + if result.kec.Response.Response != nil { + sc = result.kec.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.kec.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.kec, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.kec.hasNextLink() && result.kec.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client KubeEnvironmentsClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/kubeEnvironments", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client KubeEnvironmentsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client KubeEnvironmentsClient) ListBySubscriptionResponder(resp *http.Response) (result KubeEnvironmentCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client KubeEnvironmentsClient) listBySubscriptionNextResults(ctx context.Context, lastResults KubeEnvironmentCollection) (result KubeEnvironmentCollection, err error) { + req, err := lastResults.kubeEnvironmentCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client KubeEnvironmentsClient) ListBySubscriptionComplete(ctx context.Context) (result KubeEnvironmentCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// Update description for Creates or updates a Kubernetes Environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the Kubernetes Environment. +// kubeEnvironmentEnvelope - configuration details of the Kubernetes Environment. +func (client KubeEnvironmentsClient) Update(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironmentPatchResource) (result KubeEnvironment, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentsClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.KubeEnvironmentsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, name, kubeEnvironmentEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client KubeEnvironmentsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope KubeEnvironmentPatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/kubeEnvironments/{name}", pathParameters), + autorest.WithJSON(kubeEnvironmentEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client KubeEnvironmentsClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client KubeEnvironmentsClient) UpdateResponder(resp *http.Response) (result KubeEnvironment, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/web/mgmt/2021-03-01/web/models.go b/services/web/mgmt/2021-03-01/web/models.go new file mode 100644 index 000000000000..9867b5dc40e6 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/models.go @@ -0,0 +1,32941 @@ +package web + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "github.com/gofrs/uuid" + "io" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web" + +// AbnormalTimePeriod class representing Abnormal Time Period identified in diagnosis +type AbnormalTimePeriod struct { + // StartTime - Start time of the downtime + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the downtime + EndTime *date.Time `json:"endTime,omitempty"` + // Events - List of Possible Cause of downtime + Events *[]DetectorAbnormalTimePeriod `json:"events,omitempty"` + // Solutions - List of proposed solutions + Solutions *[]Solution `json:"solutions,omitempty"` +} + +// Address address information for domain registration. +type Address struct { + // Address1 - First line of an Address. + Address1 *string `json:"address1,omitempty"` + // Address2 - The second line of the Address. Optional. + Address2 *string `json:"address2,omitempty"` + // City - The city for the address. + City *string `json:"city,omitempty"` + // Country - The country for the address. + Country *string `json:"country,omitempty"` + // PostalCode - The postal code for the address. + PostalCode *string `json:"postalCode,omitempty"` + // State - The state or province for the address. + State *string `json:"state,omitempty"` +} + +// AddressResponse describes main public IP address and any extra virtual IPs. +type AddressResponse struct { + autorest.Response `json:"-"` + // AddressResponseProperties - AddressResponse resource specific properties + *AddressResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AddressResponse. +func (ar AddressResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ar.AddressResponseProperties != nil { + objectMap["properties"] = ar.AddressResponseProperties + } + if ar.Kind != nil { + objectMap["kind"] = ar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AddressResponse struct. +func (ar *AddressResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var addressResponseProperties AddressResponseProperties + err = json.Unmarshal(*v, &addressResponseProperties) + if err != nil { + return err + } + ar.AddressResponseProperties = &addressResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ar.Type = &typeVar + } + } + } + + return nil +} + +// AddressResponseProperties addressResponse resource specific properties +type AddressResponseProperties struct { + // ServiceIPAddress - Main public virtual IP. + ServiceIPAddress *string `json:"serviceIpAddress,omitempty"` + // InternalIPAddress - Virtual Network internal IP address of the App Service Environment if it is in internal load-balancing mode. + InternalIPAddress *string `json:"internalIpAddress,omitempty"` + // OutboundIPAddresses - IP addresses appearing on outbound connections. + OutboundIPAddresses *[]string `json:"outboundIpAddresses,omitempty"` + // VipMappings - Additional virtual IPs. + VipMappings *[]VirtualIPMapping `json:"vipMappings,omitempty"` +} + +// AllowedAudiencesValidation the configuration settings of the Allowed Audiences validation flow. +type AllowedAudiencesValidation struct { + // AllowedAudiences - The configuration settings of the allowed list of audiences from which to validate the JWT token. + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` +} + +// AllowedPrincipals the configuration settings of the Azure Active Directory allowed principals. +type AllowedPrincipals struct { + // Groups - The list of the allowed groups. + Groups *[]string `json:"groups,omitempty"` + // Identities - The list of the allowed identities. + Identities *[]string `json:"identities,omitempty"` +} + +// AnalysisData class Representing Detector Evidence used for analysis +type AnalysisData struct { + // Source - Name of the Detector + Source *string `json:"source,omitempty"` + // DetectorDefinition - Detector Definition + DetectorDefinition *DetectorDefinition `json:"detectorDefinition,omitempty"` + // Metrics - Source Metrics + Metrics *[]DiagnosticMetricSet `json:"metrics,omitempty"` + // Data - Additional Source Data + Data *[][]NameValuePair `json:"data,omitempty"` + // DetectorMetaData - Detector Meta Data + DetectorMetaData *ResponseMetaData `json:"detectorMetaData,omitempty"` +} + +// AnalysisDefinition definition of Analysis +type AnalysisDefinition struct { + autorest.Response `json:"-"` + // AnalysisDefinitionProperties - AnalysisDefinition resource specific properties + *AnalysisDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AnalysisDefinition. +func (ad AnalysisDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ad.AnalysisDefinitionProperties != nil { + objectMap["properties"] = ad.AnalysisDefinitionProperties + } + if ad.Kind != nil { + objectMap["kind"] = ad.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AnalysisDefinition struct. +func (ad *AnalysisDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var analysisDefinitionProperties AnalysisDefinitionProperties + err = json.Unmarshal(*v, &analysisDefinitionProperties) + if err != nil { + return err + } + ad.AnalysisDefinitionProperties = &analysisDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ad.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ad.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ad.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ad.Type = &typeVar + } + } + } + + return nil +} + +// AnalysisDefinitionProperties analysisDefinition resource specific properties +type AnalysisDefinitionProperties struct { + // Description - READ-ONLY; Description of the Analysis + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for AnalysisDefinitionProperties. +func (ad AnalysisDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// APIDefinitionInfo information about the formal API definition for the app. +type APIDefinitionInfo struct { + // URL - The URL of the API definition. + URL *string `json:"url,omitempty"` +} + +// APIKVReference description of site key vault references. +type APIKVReference struct { + autorest.Response `json:"-"` + // APIKVReferenceProperties - ApiKVReference resource specific properties + *APIKVReferenceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIKVReference. +func (akr APIKVReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if akr.APIKVReferenceProperties != nil { + objectMap["properties"] = akr.APIKVReferenceProperties + } + if akr.Kind != nil { + objectMap["kind"] = akr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for APIKVReference struct. +func (akr *APIKVReference) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aPIKVReferenceProperties APIKVReferenceProperties + err = json.Unmarshal(*v, &aPIKVReferenceProperties) + if err != nil { + return err + } + akr.APIKVReferenceProperties = &aPIKVReferenceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + akr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + akr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + akr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + akr.Type = &typeVar + } + } + } + + return nil +} + +// APIKVReferenceCollection ... +type APIKVReferenceCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]APIKVReference `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for APIKVReferenceCollection. +func (akrc APIKVReferenceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if akrc.Value != nil { + objectMap["value"] = akrc.Value + } + return json.Marshal(objectMap) +} + +// APIKVReferenceCollectionIterator provides access to a complete listing of APIKVReference values. +type APIKVReferenceCollectionIterator struct { + i int + page APIKVReferenceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *APIKVReferenceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/APIKVReferenceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *APIKVReferenceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter APIKVReferenceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter APIKVReferenceCollectionIterator) Response() APIKVReferenceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter APIKVReferenceCollectionIterator) Value() APIKVReference { + if !iter.page.NotDone() { + return APIKVReference{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the APIKVReferenceCollectionIterator type. +func NewAPIKVReferenceCollectionIterator(page APIKVReferenceCollectionPage) APIKVReferenceCollectionIterator { + return APIKVReferenceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (akrc APIKVReferenceCollection) IsEmpty() bool { + return akrc.Value == nil || len(*akrc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (akrc APIKVReferenceCollection) hasNextLink() bool { + return akrc.NextLink != nil && len(*akrc.NextLink) != 0 +} + +// aPIKVReferenceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (akrc APIKVReferenceCollection) aPIKVReferenceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !akrc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(akrc.NextLink))) +} + +// APIKVReferenceCollectionPage contains a page of APIKVReference values. +type APIKVReferenceCollectionPage struct { + fn func(context.Context, APIKVReferenceCollection) (APIKVReferenceCollection, error) + arc APIKVReferenceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *APIKVReferenceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/APIKVReferenceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.arc) + if err != nil { + return err + } + page.arc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *APIKVReferenceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page APIKVReferenceCollectionPage) NotDone() bool { + return !page.arc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page APIKVReferenceCollectionPage) Response() APIKVReferenceCollection { + return page.arc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page APIKVReferenceCollectionPage) Values() []APIKVReference { + if page.arc.IsEmpty() { + return nil + } + return *page.arc.Value +} + +// Creates a new instance of the APIKVReferenceCollectionPage type. +func NewAPIKVReferenceCollectionPage(cur APIKVReferenceCollection, getNextPage func(context.Context, APIKVReferenceCollection) (APIKVReferenceCollection, error)) APIKVReferenceCollectionPage { + return APIKVReferenceCollectionPage{ + fn: getNextPage, + arc: cur, + } +} + +// APIKVReferenceProperties apiKVReference resource specific properties +type APIKVReferenceProperties struct { + Reference *string `json:"reference,omitempty"` + // Status - Possible values include: 'ResolveStatusInitialized', 'ResolveStatusResolved', 'ResolveStatusInvalidSyntax', 'ResolveStatusMSINotEnabled', 'ResolveStatusVaultNotFound', 'ResolveStatusSecretNotFound', 'ResolveStatusSecretVersionNotFound', 'ResolveStatusAccessToKeyVaultDenied', 'ResolveStatusOtherReasons', 'ResolveStatusFetchTimedOut', 'ResolveStatusUnauthorizedClient' + Status ResolveStatus `json:"status,omitempty"` + VaultName *string `json:"vaultName,omitempty"` + SecretName *string `json:"secretName,omitempty"` + SecretVersion *string `json:"secretVersion,omitempty"` + IdentityType *ManagedServiceIdentity `json:"identityType,omitempty"` + Details *string `json:"details,omitempty"` + // Source - Possible values include: 'ConfigReferenceSourceKeyVault' + Source ConfigReferenceSource `json:"source,omitempty"` + ActiveVersion *string `json:"activeVersion,omitempty"` +} + +// APIManagementConfig azure API management (APIM) configuration linked to the app. +type APIManagementConfig struct { + // ID - APIM-Api Identifier. + ID *string `json:"id,omitempty"` +} + +// AppCollection collection of App Service apps. +type AppCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Site `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppCollection. +func (ac AppCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ac.Value != nil { + objectMap["value"] = ac.Value + } + return json.Marshal(objectMap) +} + +// AppCollectionIterator provides access to a complete listing of Site values. +type AppCollectionIterator struct { + i int + page AppCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppCollectionIterator) Response() AppCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppCollectionIterator) Value() Site { + if !iter.page.NotDone() { + return Site{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppCollectionIterator type. +func NewAppCollectionIterator(page AppCollectionPage) AppCollectionIterator { + return AppCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ac AppCollection) IsEmpty() bool { + return ac.Value == nil || len(*ac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ac AppCollection) hasNextLink() bool { + return ac.NextLink != nil && len(*ac.NextLink) != 0 +} + +// appCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ac AppCollection) appCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ac.NextLink))) +} + +// AppCollectionPage contains a page of Site values. +type AppCollectionPage struct { + fn func(context.Context, AppCollection) (AppCollection, error) + ac AppCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ac) + if err != nil { + return err + } + page.ac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppCollectionPage) NotDone() bool { + return !page.ac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppCollectionPage) Response() AppCollection { + return page.ac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppCollectionPage) Values() []Site { + if page.ac.IsEmpty() { + return nil + } + return *page.ac.Value +} + +// Creates a new instance of the AppCollectionPage type. +func NewAppCollectionPage(cur AppCollection, getNextPage func(context.Context, AppCollection) (AppCollection, error)) AppCollectionPage { + return AppCollectionPage{ + fn: getNextPage, + ac: cur, + } +} + +// AppInsightsWebAppStackSettings app Insights Web App stack settings. +type AppInsightsWebAppStackSettings struct { + // IsSupported - READ-ONLY; true if remote Application Insights is supported for the stack; otherwise, false. + IsSupported *bool `json:"isSupported,omitempty"` + // IsDefaultOff - READ-ONLY; true if Application Insights is disabled by default for the stack; otherwise, false. + IsDefaultOff *bool `json:"isDefaultOff,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppInsightsWebAppStackSettings. +func (aiwass AppInsightsWebAppStackSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AppInstanceStatusCollection collection of app instances. +type AppInstanceStatusCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SiteInstanceStatus `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppInstanceStatusCollection. +func (aisc AppInstanceStatusCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aisc.Value != nil { + objectMap["value"] = aisc.Value + } + return json.Marshal(objectMap) +} + +// AppInstanceStatusCollectionIterator provides access to a complete listing of SiteInstanceStatus values. +type AppInstanceStatusCollectionIterator struct { + i int + page AppInstanceStatusCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppInstanceStatusCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppInstanceStatusCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppInstanceStatusCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppInstanceStatusCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppInstanceStatusCollectionIterator) Response() AppInstanceStatusCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppInstanceStatusCollectionIterator) Value() SiteInstanceStatus { + if !iter.page.NotDone() { + return SiteInstanceStatus{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppInstanceStatusCollectionIterator type. +func NewAppInstanceStatusCollectionIterator(page AppInstanceStatusCollectionPage) AppInstanceStatusCollectionIterator { + return AppInstanceStatusCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aisc AppInstanceStatusCollection) IsEmpty() bool { + return aisc.Value == nil || len(*aisc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (aisc AppInstanceStatusCollection) hasNextLink() bool { + return aisc.NextLink != nil && len(*aisc.NextLink) != 0 +} + +// appInstanceStatusCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aisc AppInstanceStatusCollection) appInstanceStatusCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !aisc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aisc.NextLink))) +} + +// AppInstanceStatusCollectionPage contains a page of SiteInstanceStatus values. +type AppInstanceStatusCollectionPage struct { + fn func(context.Context, AppInstanceStatusCollection) (AppInstanceStatusCollection, error) + aisc AppInstanceStatusCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppInstanceStatusCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppInstanceStatusCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.aisc) + if err != nil { + return err + } + page.aisc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppInstanceStatusCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppInstanceStatusCollectionPage) NotDone() bool { + return !page.aisc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppInstanceStatusCollectionPage) Response() AppInstanceStatusCollection { + return page.aisc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppInstanceStatusCollectionPage) Values() []SiteInstanceStatus { + if page.aisc.IsEmpty() { + return nil + } + return *page.aisc.Value +} + +// Creates a new instance of the AppInstanceStatusCollectionPage type. +func NewAppInstanceStatusCollectionPage(cur AppInstanceStatusCollection, getNextPage func(context.Context, AppInstanceStatusCollection) (AppInstanceStatusCollection, error)) AppInstanceStatusCollectionPage { + return AppInstanceStatusCollectionPage{ + fn: getNextPage, + aisc: cur, + } +} + +// Apple the configuration settings of the Apple provider. +type Apple struct { + // Enabled - false if the Apple provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the Apple registration. + Registration *AppleRegistration `json:"registration,omitempty"` + // Login - The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` +} + +// AppleRegistration the configuration settings of the registration for the Apple provider +type AppleRegistration struct { + // ClientID - The Client ID of the app used for login. + ClientID *string `json:"clientId,omitempty"` + // ClientSecretSettingName - The app setting name that contains the client secret. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` +} + +// ApplicationLogsConfig application logs configuration. +type ApplicationLogsConfig struct { + // FileSystem - Application logs to file system configuration. + FileSystem *FileSystemApplicationLogsConfig `json:"fileSystem,omitempty"` + // AzureTableStorage - Application logs to azure table storage configuration. + AzureTableStorage *AzureTableStorageApplicationLogsConfig `json:"azureTableStorage,omitempty"` + // AzureBlobStorage - Application logs to blob storage configuration. + AzureBlobStorage *AzureBlobStorageApplicationLogsConfig `json:"azureBlobStorage,omitempty"` +} + +// ApplicationStack application stack. +type ApplicationStack struct { + // Name - Application stack name. + Name *string `json:"name,omitempty"` + // Display - Application stack display name. + Display *string `json:"display,omitempty"` + // Dependency - Application stack dependency. + Dependency *string `json:"dependency,omitempty"` + // MajorVersions - List of major versions available. + MajorVersions *[]StackMajorVersion `json:"majorVersions,omitempty"` + // Frameworks - List of frameworks associated with application stack. + Frameworks *[]ApplicationStack `json:"frameworks,omitempty"` + // IsDeprecated - true if this is the stack is deprecated; otherwise, false. + IsDeprecated *[]ApplicationStack `json:"isDeprecated,omitempty"` +} + +// ApplicationStackCollection collection of Application Stacks +type ApplicationStackCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ApplicationStackResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationStackCollection. +func (asc ApplicationStackCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asc.Value != nil { + objectMap["value"] = asc.Value + } + return json.Marshal(objectMap) +} + +// ApplicationStackCollectionIterator provides access to a complete listing of ApplicationStackResource +// values. +type ApplicationStackCollectionIterator struct { + i int + page ApplicationStackCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ApplicationStackCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationStackCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ApplicationStackCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ApplicationStackCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ApplicationStackCollectionIterator) Response() ApplicationStackCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ApplicationStackCollectionIterator) Value() ApplicationStackResource { + if !iter.page.NotDone() { + return ApplicationStackResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ApplicationStackCollectionIterator type. +func NewApplicationStackCollectionIterator(page ApplicationStackCollectionPage) ApplicationStackCollectionIterator { + return ApplicationStackCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asc ApplicationStackCollection) IsEmpty() bool { + return asc.Value == nil || len(*asc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (asc ApplicationStackCollection) hasNextLink() bool { + return asc.NextLink != nil && len(*asc.NextLink) != 0 +} + +// applicationStackCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asc ApplicationStackCollection) applicationStackCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !asc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asc.NextLink))) +} + +// ApplicationStackCollectionPage contains a page of ApplicationStackResource values. +type ApplicationStackCollectionPage struct { + fn func(context.Context, ApplicationStackCollection) (ApplicationStackCollection, error) + asc ApplicationStackCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ApplicationStackCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ApplicationStackCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.asc) + if err != nil { + return err + } + page.asc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ApplicationStackCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ApplicationStackCollectionPage) NotDone() bool { + return !page.asc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ApplicationStackCollectionPage) Response() ApplicationStackCollection { + return page.asc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ApplicationStackCollectionPage) Values() []ApplicationStackResource { + if page.asc.IsEmpty() { + return nil + } + return *page.asc.Value +} + +// Creates a new instance of the ApplicationStackCollectionPage type. +func NewApplicationStackCollectionPage(cur ApplicationStackCollection, getNextPage func(context.Context, ApplicationStackCollection) (ApplicationStackCollection, error)) ApplicationStackCollectionPage { + return ApplicationStackCollectionPage{ + fn: getNextPage, + asc: cur, + } +} + +// ApplicationStackResource ARM resource for a ApplicationStack. +type ApplicationStackResource struct { + // ApplicationStack - Core resource properties + *ApplicationStack `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ApplicationStackResource. +func (asr ApplicationStackResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asr.ApplicationStack != nil { + objectMap["properties"] = asr.ApplicationStack + } + if asr.Kind != nil { + objectMap["kind"] = asr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ApplicationStackResource struct. +func (asr *ApplicationStackResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var applicationStack ApplicationStack + err = json.Unmarshal(*v, &applicationStack) + if err != nil { + return err + } + asr.ApplicationStack = &applicationStack + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asr.Type = &typeVar + } + } + } + + return nil +} + +// AppLogsConfiguration ... +type AppLogsConfiguration struct { + Destination *string `json:"destination,omitempty"` + LogAnalyticsConfiguration *LogAnalyticsConfiguration `json:"logAnalyticsConfiguration,omitempty"` +} + +// AppMajorVersion web App stack major version. +type AppMajorVersion struct { + // DisplayText - READ-ONLY; Web App stack major version (display only). + DisplayText *string `json:"displayText,omitempty"` + // Value - READ-ONLY; Web App stack major version name. + Value *string `json:"value,omitempty"` + // MinorVersions - READ-ONLY; Minor versions associated with the major version. + MinorVersions *[]AppMinorVersion `json:"minorVersions,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppMajorVersion. +func (amv AppMajorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AppMinorVersion web App stack minor version. +type AppMinorVersion struct { + // DisplayText - READ-ONLY; Web App stack minor version (display only). + DisplayText *string `json:"displayText,omitempty"` + // Value - READ-ONLY; Web App stack major version name. + Value *string `json:"value,omitempty"` + // StackSettings - READ-ONLY; Settings associated with the minor version. + StackSettings *AppRuntimes `json:"stackSettings,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppMinorVersion. +func (amv AppMinorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AppRegistration the configuration settings of the app registration for providers that have app ids and +// app secrets +type AppRegistration struct { + // AppID - The App ID of the app used for login. + AppID *string `json:"appId,omitempty"` + // AppSecretSettingName - The app setting name that contains the app secret. + AppSecretSettingName *string `json:"appSecretSettingName,omitempty"` +} + +// AppRuntimes web App stack runtimes. +type AppRuntimes struct { + // LinuxRuntimeSettings - READ-ONLY; Linux-specific settings associated with the minor version. + LinuxRuntimeSettings *AppRuntimeSettings `json:"linuxRuntimeSettings,omitempty"` + // WindowsRuntimeSettings - READ-ONLY; Windows-specific settings associated with the minor version. + WindowsRuntimeSettings *AppRuntimeSettings `json:"windowsRuntimeSettings,omitempty"` + // LinuxContainerSettings - READ-ONLY; Linux-specific settings associated with the Java container minor version. + LinuxContainerSettings *LinuxJavaContainerSettings `json:"linuxContainerSettings,omitempty"` + // WindowsContainerSettings - READ-ONLY; Windows-specific settings associated with the Java container minor version. + WindowsContainerSettings *WindowsJavaContainerSettings `json:"windowsContainerSettings,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppRuntimes. +func (ar AppRuntimes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AppRuntimeSettings web App runtime settings. +type AppRuntimeSettings struct { + // RuntimeVersion - READ-ONLY; Web App stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // RemoteDebuggingSupported - READ-ONLY; true if remote debugging is supported for the stack; otherwise, false. + RemoteDebuggingSupported *bool `json:"remoteDebuggingSupported,omitempty"` + // AppInsightsSettings - READ-ONLY; Application Insights settings associated with the minor version. + AppInsightsSettings *AppInsightsWebAppStackSettings `json:"appInsightsSettings,omitempty"` + // GitHubActionSettings - READ-ONLY; GitHub Actions settings associated with the minor version. + GitHubActionSettings *GitHubActionWebAppStackSettings `json:"gitHubActionSettings,omitempty"` + // IsPreview - READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty"` + // IsDeprecated - READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + // IsHidden - READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty"` + // EndOfLifeDate - READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // IsAutoUpdate - READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty"` + // IsEarlyAccess - READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppRuntimeSettings. +func (ars AppRuntimeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// AppsApproveOrRejectPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AppsApproveOrRejectPrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (RemotePrivateEndpointConnectionARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsApproveOrRejectPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsApproveOrRejectPrivateEndpointConnectionFuture.Result. +func (future *AppsApproveOrRejectPrivateEndpointConnectionFuture) result(client AppsClient) (rpecar RemotePrivateEndpointConnectionARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsApproveOrRejectPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpecar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsApproveOrRejectPrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpecar.Response.Response, err = future.GetResult(sender); err == nil && rpecar.Response.Response.StatusCode != http.StatusNoContent { + rpecar, err = client.ApproveOrRejectPrivateEndpointConnectionResponder(rpecar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsApproveOrRejectPrivateEndpointConnectionFuture", "Result", rpecar.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsApproveOrRejectPrivateEndpointConnectionSlotFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AppsApproveOrRejectPrivateEndpointConnectionSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (RemotePrivateEndpointConnectionARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsApproveOrRejectPrivateEndpointConnectionSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsApproveOrRejectPrivateEndpointConnectionSlotFuture.Result. +func (future *AppsApproveOrRejectPrivateEndpointConnectionSlotFuture) result(client AppsClient) (rpecar RemotePrivateEndpointConnectionARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsApproveOrRejectPrivateEndpointConnectionSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpecar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsApproveOrRejectPrivateEndpointConnectionSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpecar.Response.Response, err = future.GetResult(sender); err == nil && rpecar.Response.Response.StatusCode != http.StatusNoContent { + rpecar, err = client.ApproveOrRejectPrivateEndpointConnectionSlotResponder(rpecar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsApproveOrRejectPrivateEndpointConnectionSlotFuture", "Result", rpecar.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateFunctionFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsCreateFunctionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (FunctionEnvelope, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateFunctionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateFunctionFuture.Result. +func (future *AppsCreateFunctionFuture) result(client AppsClient) (fe FunctionEnvelope, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateFunctionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + fe.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateFunctionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fe.Response.Response, err = future.GetResult(sender); err == nil && fe.Response.Response.StatusCode != http.StatusNoContent { + fe, err = client.CreateFunctionResponder(fe.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateFunctionFuture", "Result", fe.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateInstanceFunctionSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsCreateInstanceFunctionSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (FunctionEnvelope, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateInstanceFunctionSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateInstanceFunctionSlotFuture.Result. +func (future *AppsCreateInstanceFunctionSlotFuture) result(client AppsClient) (fe FunctionEnvelope, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceFunctionSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + fe.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateInstanceFunctionSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if fe.Response.Response, err = future.GetResult(sender); err == nil && fe.Response.Response.StatusCode != http.StatusNoContent { + fe, err = client.CreateInstanceFunctionSlotResponder(fe.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceFunctionSlotFuture", "Result", fe.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateInstanceMSDeployOperationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsCreateInstanceMSDeployOperationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (MSDeployStatus, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateInstanceMSDeployOperationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateInstanceMSDeployOperationFuture.Result. +func (future *AppsCreateInstanceMSDeployOperationFuture) result(client AppsClient) (mds MSDeployStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mds.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateInstanceMSDeployOperationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mds.Response.Response, err = future.GetResult(sender); err == nil && mds.Response.Response.StatusCode != http.StatusNoContent { + mds, err = client.CreateInstanceMSDeployOperationResponder(mds.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationFuture", "Result", mds.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateInstanceMSDeployOperationSlotFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type AppsCreateInstanceMSDeployOperationSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (MSDeployStatus, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateInstanceMSDeployOperationSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateInstanceMSDeployOperationSlotFuture.Result. +func (future *AppsCreateInstanceMSDeployOperationSlotFuture) result(client AppsClient) (mds MSDeployStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mds.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateInstanceMSDeployOperationSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mds.Response.Response, err = future.GetResult(sender); err == nil && mds.Response.Response.StatusCode != http.StatusNoContent { + mds, err = client.CreateInstanceMSDeployOperationSlotResponder(mds.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateInstanceMSDeployOperationSlotFuture", "Result", mds.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateMSDeployOperationFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsCreateMSDeployOperationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (MSDeployStatus, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateMSDeployOperationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateMSDeployOperationFuture.Result. +func (future *AppsCreateMSDeployOperationFuture) result(client AppsClient) (mds MSDeployStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mds.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateMSDeployOperationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mds.Response.Response, err = future.GetResult(sender); err == nil && mds.Response.Response.StatusCode != http.StatusNoContent { + mds, err = client.CreateMSDeployOperationResponder(mds.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationFuture", "Result", mds.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateMSDeployOperationSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsCreateMSDeployOperationSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (MSDeployStatus, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateMSDeployOperationSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateMSDeployOperationSlotFuture.Result. +func (future *AppsCreateMSDeployOperationSlotFuture) result(client AppsClient) (mds MSDeployStatus, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + mds.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateMSDeployOperationSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if mds.Response.Response, err = future.GetResult(sender); err == nil && mds.Response.Response.StatusCode != http.StatusNoContent { + mds, err = client.CreateMSDeployOperationSlotResponder(mds.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateMSDeployOperationSlotFuture", "Result", mds.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (Site, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateOrUpdateFuture.Result. +func (future *AppsCreateOrUpdateFuture) result(client AppsClient) (s Site, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateOrUpdateSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsCreateOrUpdateSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (Site, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateOrUpdateSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateOrUpdateSlotFuture.Result. +func (future *AppsCreateOrUpdateSlotFuture) result(client AppsClient) (s Site, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + s.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if s.Response.Response, err = future.GetResult(sender); err == nil && s.Response.Response.StatusCode != http.StatusNoContent { + s, err = client.CreateOrUpdateSlotResponder(s.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSlotFuture", "Result", s.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateOrUpdateSourceControlFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsCreateOrUpdateSourceControlFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (SiteSourceControl, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateOrUpdateSourceControlFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateOrUpdateSourceControlFuture.Result. +func (future *AppsCreateOrUpdateSourceControlFuture) result(client AppsClient) (ssc SiteSourceControl, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ssc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateSourceControlFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssc.Response.Response, err = future.GetResult(sender); err == nil && ssc.Response.Response.StatusCode != http.StatusNoContent { + ssc, err = client.CreateOrUpdateSourceControlResponder(ssc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlFuture", "Result", ssc.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsCreateOrUpdateSourceControlSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsCreateOrUpdateSourceControlSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (SiteSourceControl, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsCreateOrUpdateSourceControlSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsCreateOrUpdateSourceControlSlotFuture.Result. +func (future *AppsCreateOrUpdateSourceControlSlotFuture) result(client AppsClient) (ssc SiteSourceControl, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ssc.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsCreateOrUpdateSourceControlSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssc.Response.Response, err = future.GetResult(sender); err == nil && ssc.Response.Response.StatusCode != http.StatusNoContent { + ssc, err = client.CreateOrUpdateSourceControlSlotResponder(ssc.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsCreateOrUpdateSourceControlSlotFuture", "Result", ssc.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsDeletePrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (SetObject, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsDeletePrivateEndpointConnectionFuture.Result. +func (future *AppsDeletePrivateEndpointConnectionFuture) result(client AppsClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + so.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsDeletePrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeletePrivateEndpointConnectionResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsDeletePrivateEndpointConnectionFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsDeletePrivateEndpointConnectionSlotFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type AppsDeletePrivateEndpointConnectionSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (SetObject, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsDeletePrivateEndpointConnectionSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsDeletePrivateEndpointConnectionSlotFuture.Result. +func (future *AppsDeletePrivateEndpointConnectionSlotFuture) result(client AppsClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsDeletePrivateEndpointConnectionSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + so.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsDeletePrivateEndpointConnectionSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeletePrivateEndpointConnectionSlotResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsDeletePrivateEndpointConnectionSlotFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceCertificate key Vault container for a certificate that is purchased through Azure. +type AppServiceCertificate struct { + // KeyVaultID - Key Vault resource Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultSecretName - Key Vault secret name. + KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"` + // ProvisioningState - READ-ONLY; Status of the Key Vault secret. Possible values include: 'KeyVaultSecretStatusInitialized', 'KeyVaultSecretStatusWaitingOnCertificateOrder', 'KeyVaultSecretStatusSucceeded', 'KeyVaultSecretStatusCertificateOrderFailed', 'KeyVaultSecretStatusOperationNotPermittedOnKeyVault', 'KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultSecretStatusKeyVaultDoesNotExist', 'KeyVaultSecretStatusKeyVaultSecretDoesNotExist', 'KeyVaultSecretStatusUnknownError', 'KeyVaultSecretStatusExternalPrivateKey', 'KeyVaultSecretStatusUnknown' + ProvisioningState KeyVaultSecretStatus `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificate. +func (asc AppServiceCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asc.KeyVaultID != nil { + objectMap["keyVaultId"] = asc.KeyVaultID + } + if asc.KeyVaultSecretName != nil { + objectMap["keyVaultSecretName"] = asc.KeyVaultSecretName + } + return json.Marshal(objectMap) +} + +// AppServiceCertificateCollection collection of certificate order certificates. +type AppServiceCertificateCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]AppServiceCertificateResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateCollection. +func (ascc AppServiceCertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascc.Value != nil { + objectMap["value"] = ascc.Value + } + return json.Marshal(objectMap) +} + +// AppServiceCertificateCollectionIterator provides access to a complete listing of +// AppServiceCertificateResource values. +type AppServiceCertificateCollectionIterator struct { + i int + page AppServiceCertificateCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppServiceCertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppServiceCertificateCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppServiceCertificateCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppServiceCertificateCollectionIterator) Response() AppServiceCertificateCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppServiceCertificateCollectionIterator) Value() AppServiceCertificateResource { + if !iter.page.NotDone() { + return AppServiceCertificateResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppServiceCertificateCollectionIterator type. +func NewAppServiceCertificateCollectionIterator(page AppServiceCertificateCollectionPage) AppServiceCertificateCollectionIterator { + return AppServiceCertificateCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ascc AppServiceCertificateCollection) IsEmpty() bool { + return ascc.Value == nil || len(*ascc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ascc AppServiceCertificateCollection) hasNextLink() bool { + return ascc.NextLink != nil && len(*ascc.NextLink) != 0 +} + +// appServiceCertificateCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ascc AppServiceCertificateCollection) appServiceCertificateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ascc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ascc.NextLink))) +} + +// AppServiceCertificateCollectionPage contains a page of AppServiceCertificateResource values. +type AppServiceCertificateCollectionPage struct { + fn func(context.Context, AppServiceCertificateCollection) (AppServiceCertificateCollection, error) + ascc AppServiceCertificateCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppServiceCertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ascc) + if err != nil { + return err + } + page.ascc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppServiceCertificateCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppServiceCertificateCollectionPage) NotDone() bool { + return !page.ascc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppServiceCertificateCollectionPage) Response() AppServiceCertificateCollection { + return page.ascc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppServiceCertificateCollectionPage) Values() []AppServiceCertificateResource { + if page.ascc.IsEmpty() { + return nil + } + return *page.ascc.Value +} + +// Creates a new instance of the AppServiceCertificateCollectionPage type. +func NewAppServiceCertificateCollectionPage(cur AppServiceCertificateCollection, getNextPage func(context.Context, AppServiceCertificateCollection) (AppServiceCertificateCollection, error)) AppServiceCertificateCollectionPage { + return AppServiceCertificateCollectionPage{ + fn: getNextPage, + ascc: cur, + } +} + +// AppServiceCertificateOrder SSL certificate purchase order. +type AppServiceCertificateOrder struct { + autorest.Response `json:"-"` + // AppServiceCertificateOrderProperties - AppServiceCertificateOrder resource specific properties + *AppServiceCertificateOrderProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateOrder. +func (asco AppServiceCertificateOrder) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asco.AppServiceCertificateOrderProperties != nil { + objectMap["properties"] = asco.AppServiceCertificateOrderProperties + } + if asco.Kind != nil { + objectMap["kind"] = asco.Kind + } + if asco.Location != nil { + objectMap["location"] = asco.Location + } + if asco.Tags != nil { + objectMap["tags"] = asco.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServiceCertificateOrder struct. +func (asco *AppServiceCertificateOrder) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificateOrderProperties AppServiceCertificateOrderProperties + err = json.Unmarshal(*v, &appServiceCertificateOrderProperties) + if err != nil { + return err + } + asco.AppServiceCertificateOrderProperties = &appServiceCertificateOrderProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asco.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asco.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asco.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asco.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asco.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asco.Tags = tags + } + } + } + + return nil +} + +// AppServiceCertificateOrderCollection collection of certificate orders. +type AppServiceCertificateOrderCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]AppServiceCertificateOrder `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderCollection. +func (ascoc AppServiceCertificateOrderCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascoc.Value != nil { + objectMap["value"] = ascoc.Value + } + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrderCollectionIterator provides access to a complete listing of +// AppServiceCertificateOrder values. +type AppServiceCertificateOrderCollectionIterator struct { + i int + page AppServiceCertificateOrderCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppServiceCertificateOrderCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrderCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppServiceCertificateOrderCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppServiceCertificateOrderCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppServiceCertificateOrderCollectionIterator) Response() AppServiceCertificateOrderCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppServiceCertificateOrderCollectionIterator) Value() AppServiceCertificateOrder { + if !iter.page.NotDone() { + return AppServiceCertificateOrder{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppServiceCertificateOrderCollectionIterator type. +func NewAppServiceCertificateOrderCollectionIterator(page AppServiceCertificateOrderCollectionPage) AppServiceCertificateOrderCollectionIterator { + return AppServiceCertificateOrderCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ascoc AppServiceCertificateOrderCollection) IsEmpty() bool { + return ascoc.Value == nil || len(*ascoc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ascoc AppServiceCertificateOrderCollection) hasNextLink() bool { + return ascoc.NextLink != nil && len(*ascoc.NextLink) != 0 +} + +// appServiceCertificateOrderCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ascoc AppServiceCertificateOrderCollection) appServiceCertificateOrderCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ascoc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ascoc.NextLink))) +} + +// AppServiceCertificateOrderCollectionPage contains a page of AppServiceCertificateOrder values. +type AppServiceCertificateOrderCollectionPage struct { + fn func(context.Context, AppServiceCertificateOrderCollection) (AppServiceCertificateOrderCollection, error) + ascoc AppServiceCertificateOrderCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppServiceCertificateOrderCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceCertificateOrderCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ascoc) + if err != nil { + return err + } + page.ascoc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppServiceCertificateOrderCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppServiceCertificateOrderCollectionPage) NotDone() bool { + return !page.ascoc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppServiceCertificateOrderCollectionPage) Response() AppServiceCertificateOrderCollection { + return page.ascoc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppServiceCertificateOrderCollectionPage) Values() []AppServiceCertificateOrder { + if page.ascoc.IsEmpty() { + return nil + } + return *page.ascoc.Value +} + +// Creates a new instance of the AppServiceCertificateOrderCollectionPage type. +func NewAppServiceCertificateOrderCollectionPage(cur AppServiceCertificateOrderCollection, getNextPage func(context.Context, AppServiceCertificateOrderCollection) (AppServiceCertificateOrderCollection, error)) AppServiceCertificateOrderCollectionPage { + return AppServiceCertificateOrderCollectionPage{ + fn: getNextPage, + ascoc: cur, + } +} + +// AppServiceCertificateOrderPatchResource ARM resource for a certificate order that is purchased through +// Azure. +type AppServiceCertificateOrderPatchResource struct { + // AppServiceCertificateOrderPatchResourceProperties - AppServiceCertificateOrderPatchResource resource specific properties + *AppServiceCertificateOrderPatchResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderPatchResource. +func (ascopr AppServiceCertificateOrderPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascopr.AppServiceCertificateOrderPatchResourceProperties != nil { + objectMap["properties"] = ascopr.AppServiceCertificateOrderPatchResourceProperties + } + if ascopr.Kind != nil { + objectMap["kind"] = ascopr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServiceCertificateOrderPatchResource struct. +func (ascopr *AppServiceCertificateOrderPatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificateOrderPatchResourceProperties AppServiceCertificateOrderPatchResourceProperties + err = json.Unmarshal(*v, &appServiceCertificateOrderPatchResourceProperties) + if err != nil { + return err + } + ascopr.AppServiceCertificateOrderPatchResourceProperties = &appServiceCertificateOrderPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ascopr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ascopr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ascopr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ascopr.Type = &typeVar + } + } + } + + return nil +} + +// AppServiceCertificateOrderPatchResourceProperties appServiceCertificateOrderPatchResource resource +// specific properties +type AppServiceCertificateOrderPatchResourceProperties struct { + // Certificates - State of the Key Vault secret. + Certificates map[string]*AppServiceCertificate `json:"certificates"` + // DistinguishedName - Certificate distinguished name. + DistinguishedName *string `json:"distinguishedName,omitempty"` + // DomainVerificationToken - READ-ONLY; Domain verification token. + DomainVerificationToken *string `json:"domainVerificationToken,omitempty"` + // ValidityInYears - Duration in years (must be 1). + ValidityInYears *int32 `json:"validityInYears,omitempty"` + // KeySize - Certificate key size. + KeySize *int32 `json:"keySize,omitempty"` + // ProductType - Certificate product type. Possible values include: 'CertificateProductTypeStandardDomainValidatedSsl', 'CertificateProductTypeStandardDomainValidatedWildCardSsl' + ProductType CertificateProductType `json:"productType,omitempty"` + // AutoRenew - true if the certificate should be automatically renewed when it expires; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + // ProvisioningState - READ-ONLY; Status of certificate order. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; Current order status. Possible values include: 'CertificateOrderStatusPendingissuance', 'CertificateOrderStatusIssued', 'CertificateOrderStatusRevoked', 'CertificateOrderStatusCanceled', 'CertificateOrderStatusDenied', 'CertificateOrderStatusPendingrevocation', 'CertificateOrderStatusPendingRekey', 'CertificateOrderStatusUnused', 'CertificateOrderStatusExpired', 'CertificateOrderStatusNotSubmitted' + Status CertificateOrderStatus `json:"status,omitempty"` + // SignedCertificate - READ-ONLY; Signed certificate. + SignedCertificate *CertificateDetails `json:"signedCertificate,omitempty"` + // Csr - Last CSR that was created for this order. + Csr *string `json:"csr,omitempty"` + // Intermediate - READ-ONLY; Intermediate certificate. + Intermediate *CertificateDetails `json:"intermediate,omitempty"` + // Root - READ-ONLY; Root certificate. + Root *CertificateDetails `json:"root,omitempty"` + // SerialNumber - READ-ONLY; Current serial number of the certificate. + SerialNumber *string `json:"serialNumber,omitempty"` + // LastCertificateIssuanceTime - READ-ONLY; Certificate last issuance time. + LastCertificateIssuanceTime *date.Time `json:"lastCertificateIssuanceTime,omitempty"` + // ExpirationTime - READ-ONLY; Certificate expiration time. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // IsPrivateKeyExternal - READ-ONLY; true if private key is external; otherwise, false. + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty"` + // AppServiceCertificateNotRenewableReasons - READ-ONLY; Reasons why App Service Certificate is not renewable at the current moment. + AppServiceCertificateNotRenewableReasons *[]string `json:"appServiceCertificateNotRenewableReasons,omitempty"` + // NextAutoRenewalTimeStamp - READ-ONLY; Time stamp when the certificate would be auto renewed next + NextAutoRenewalTimeStamp *date.Time `json:"nextAutoRenewalTimeStamp,omitempty"` + // Contact - READ-ONLY; Contact info + Contact *CertificateOrderContact `json:"contact,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderPatchResourceProperties. +func (ascopr AppServiceCertificateOrderPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascopr.Certificates != nil { + objectMap["certificates"] = ascopr.Certificates + } + if ascopr.DistinguishedName != nil { + objectMap["distinguishedName"] = ascopr.DistinguishedName + } + if ascopr.ValidityInYears != nil { + objectMap["validityInYears"] = ascopr.ValidityInYears + } + if ascopr.KeySize != nil { + objectMap["keySize"] = ascopr.KeySize + } + if ascopr.ProductType != "" { + objectMap["productType"] = ascopr.ProductType + } + if ascopr.AutoRenew != nil { + objectMap["autoRenew"] = ascopr.AutoRenew + } + if ascopr.Csr != nil { + objectMap["csr"] = ascopr.Csr + } + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrderProperties appServiceCertificateOrder resource specific properties +type AppServiceCertificateOrderProperties struct { + // Certificates - State of the Key Vault secret. + Certificates map[string]*AppServiceCertificate `json:"certificates"` + // DistinguishedName - Certificate distinguished name. + DistinguishedName *string `json:"distinguishedName,omitempty"` + // DomainVerificationToken - READ-ONLY; Domain verification token. + DomainVerificationToken *string `json:"domainVerificationToken,omitempty"` + // ValidityInYears - Duration in years (must be 1). + ValidityInYears *int32 `json:"validityInYears,omitempty"` + // KeySize - Certificate key size. + KeySize *int32 `json:"keySize,omitempty"` + // ProductType - Certificate product type. Possible values include: 'CertificateProductTypeStandardDomainValidatedSsl', 'CertificateProductTypeStandardDomainValidatedWildCardSsl' + ProductType CertificateProductType `json:"productType,omitempty"` + // AutoRenew - true if the certificate should be automatically renewed when it expires; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + // ProvisioningState - READ-ONLY; Status of certificate order. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; Current order status. Possible values include: 'CertificateOrderStatusPendingissuance', 'CertificateOrderStatusIssued', 'CertificateOrderStatusRevoked', 'CertificateOrderStatusCanceled', 'CertificateOrderStatusDenied', 'CertificateOrderStatusPendingrevocation', 'CertificateOrderStatusPendingRekey', 'CertificateOrderStatusUnused', 'CertificateOrderStatusExpired', 'CertificateOrderStatusNotSubmitted' + Status CertificateOrderStatus `json:"status,omitempty"` + // SignedCertificate - READ-ONLY; Signed certificate. + SignedCertificate *CertificateDetails `json:"signedCertificate,omitempty"` + // Csr - Last CSR that was created for this order. + Csr *string `json:"csr,omitempty"` + // Intermediate - READ-ONLY; Intermediate certificate. + Intermediate *CertificateDetails `json:"intermediate,omitempty"` + // Root - READ-ONLY; Root certificate. + Root *CertificateDetails `json:"root,omitempty"` + // SerialNumber - READ-ONLY; Current serial number of the certificate. + SerialNumber *string `json:"serialNumber,omitempty"` + // LastCertificateIssuanceTime - READ-ONLY; Certificate last issuance time. + LastCertificateIssuanceTime *date.Time `json:"lastCertificateIssuanceTime,omitempty"` + // ExpirationTime - READ-ONLY; Certificate expiration time. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // IsPrivateKeyExternal - READ-ONLY; true if private key is external; otherwise, false. + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty"` + // AppServiceCertificateNotRenewableReasons - READ-ONLY; Reasons why App Service Certificate is not renewable at the current moment. + AppServiceCertificateNotRenewableReasons *[]string `json:"appServiceCertificateNotRenewableReasons,omitempty"` + // NextAutoRenewalTimeStamp - READ-ONLY; Time stamp when the certificate would be auto renewed next + NextAutoRenewalTimeStamp *date.Time `json:"nextAutoRenewalTimeStamp,omitempty"` + // Contact - READ-ONLY; Contact info + Contact *CertificateOrderContact `json:"contact,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateOrderProperties. +func (asco AppServiceCertificateOrderProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asco.Certificates != nil { + objectMap["certificates"] = asco.Certificates + } + if asco.DistinguishedName != nil { + objectMap["distinguishedName"] = asco.DistinguishedName + } + if asco.ValidityInYears != nil { + objectMap["validityInYears"] = asco.ValidityInYears + } + if asco.KeySize != nil { + objectMap["keySize"] = asco.KeySize + } + if asco.ProductType != "" { + objectMap["productType"] = asco.ProductType + } + if asco.AutoRenew != nil { + objectMap["autoRenew"] = asco.AutoRenew + } + if asco.Csr != nil { + objectMap["csr"] = asco.Csr + } + return json.Marshal(objectMap) +} + +// AppServiceCertificateOrdersCreateOrUpdateCertificateFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type AppServiceCertificateOrdersCreateOrUpdateCertificateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceCertificateOrdersClient) (AppServiceCertificateResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceCertificateOrdersCreateOrUpdateCertificateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceCertificateOrdersCreateOrUpdateCertificateFuture.Result. +func (future *AppServiceCertificateOrdersCreateOrUpdateCertificateFuture) result(client AppServiceCertificateOrdersClient) (ascr AppServiceCertificateResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ascr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ascr.Response.Response, err = future.GetResult(sender); err == nil && ascr.Response.Response.StatusCode != http.StatusNoContent { + ascr, err = client.CreateOrUpdateCertificateResponder(ascr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture", "Result", ascr.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceCertificateOrdersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type AppServiceCertificateOrdersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceCertificateOrdersClient) (AppServiceCertificateOrder, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceCertificateOrdersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceCertificateOrdersCreateOrUpdateFuture.Result. +func (future *AppServiceCertificateOrdersCreateOrUpdateFuture) result(client AppServiceCertificateOrdersClient) (asco AppServiceCertificateOrder, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + asco.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceCertificateOrdersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if asco.Response.Response, err = future.GetResult(sender); err == nil && asco.Response.Response.StatusCode != http.StatusNoContent { + asco, err = client.CreateOrUpdateResponder(asco.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceCertificateOrdersCreateOrUpdateFuture", "Result", asco.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceCertificatePatchResource key Vault container ARM resource for a certificate that is purchased +// through Azure. +type AppServiceCertificatePatchResource struct { + // AppServiceCertificate - Core resource properties + *AppServiceCertificate `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificatePatchResource. +func (ascpr AppServiceCertificatePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascpr.AppServiceCertificate != nil { + objectMap["properties"] = ascpr.AppServiceCertificate + } + if ascpr.Kind != nil { + objectMap["kind"] = ascpr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServiceCertificatePatchResource struct. +func (ascpr *AppServiceCertificatePatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificate AppServiceCertificate + err = json.Unmarshal(*v, &appServiceCertificate) + if err != nil { + return err + } + ascpr.AppServiceCertificate = &appServiceCertificate + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ascpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ascpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ascpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ascpr.Type = &typeVar + } + } + } + + return nil +} + +// AppServiceCertificateResource key Vault container ARM resource for a certificate that is purchased +// through Azure. +type AppServiceCertificateResource struct { + autorest.Response `json:"-"` + // AppServiceCertificate - Core resource properties + *AppServiceCertificate `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AppServiceCertificateResource. +func (ascr AppServiceCertificateResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ascr.AppServiceCertificate != nil { + objectMap["properties"] = ascr.AppServiceCertificate + } + if ascr.Kind != nil { + objectMap["kind"] = ascr.Kind + } + if ascr.Location != nil { + objectMap["location"] = ascr.Location + } + if ascr.Tags != nil { + objectMap["tags"] = ascr.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServiceCertificateResource struct. +func (ascr *AppServiceCertificateResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceCertificate AppServiceCertificate + err = json.Unmarshal(*v, &appServiceCertificate) + if err != nil { + return err + } + ascr.AppServiceCertificate = &appServiceCertificate + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ascr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ascr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ascr.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ascr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ascr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ascr.Tags = tags + } + } + } + + return nil +} + +// AppServiceEnvironment description of an App Service Environment. +type AppServiceEnvironment struct { + // ProvisioningState - READ-ONLY; Provisioning state of the App Service Environment. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; Current status of the App Service Environment. Possible values include: 'HostingEnvironmentStatusPreparing', 'HostingEnvironmentStatusReady', 'HostingEnvironmentStatusScaling', 'HostingEnvironmentStatusDeleting' + Status HostingEnvironmentStatus `json:"status,omitempty"` + // VirtualNetwork - Description of the Virtual Network. + VirtualNetwork *VirtualNetworkProfile `json:"virtualNetwork,omitempty"` + // InternalLoadBalancingMode - Specifies which endpoints to serve internally in the Virtual Network for the App Service Environment. Possible values include: 'LoadBalancingModeNone', 'LoadBalancingModeWeb', 'LoadBalancingModePublishing', 'LoadBalancingModeWebPublishing' + InternalLoadBalancingMode LoadBalancingMode `json:"internalLoadBalancingMode,omitempty"` + // MultiSize - Front-end VM size, e.g. "Medium", "Large". + MultiSize *string `json:"multiSize,omitempty"` + // MultiRoleCount - READ-ONLY; Number of front-end instances. + MultiRoleCount *int32 `json:"multiRoleCount,omitempty"` + // IpsslAddressCount - Number of IP SSL addresses reserved for the App Service Environment. + IpsslAddressCount *int32 `json:"ipsslAddressCount,omitempty"` + // DNSSuffix - DNS suffix of the App Service Environment. + DNSSuffix *string `json:"dnsSuffix,omitempty"` + // MaximumNumberOfMachines - READ-ONLY; Maximum number of VMs in the App Service Environment. + MaximumNumberOfMachines *int32 `json:"maximumNumberOfMachines,omitempty"` + // FrontEndScaleFactor - Scale factor for front-ends. + FrontEndScaleFactor *int32 `json:"frontEndScaleFactor,omitempty"` + // Suspended - READ-ONLY; true if the App Service Environment is suspended; otherwise, false. The environment can be suspended, e.g. when the management endpoint is no longer available + // (most likely because NSG blocked the incoming traffic). + Suspended *bool `json:"suspended,omitempty"` + // ClusterSettings - Custom settings for changing the behavior of the App Service Environment. + ClusterSettings *[]NameValuePair `json:"clusterSettings,omitempty"` + // UserWhitelistedIPRanges - User added ip ranges to whitelist on ASE db + UserWhitelistedIPRanges *[]string `json:"userWhitelistedIpRanges,omitempty"` + // HasLinuxWorkers - READ-ONLY; Flag that displays whether an ASE has linux workers or not + HasLinuxWorkers *bool `json:"hasLinuxWorkers,omitempty"` + // DedicatedHostCount - Dedicated Host Count + DedicatedHostCount *int32 `json:"dedicatedHostCount,omitempty"` + // ZoneRedundant - Whether or not this App Service Environment is zone-redundant. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceEnvironment. +func (ase AppServiceEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ase.VirtualNetwork != nil { + objectMap["virtualNetwork"] = ase.VirtualNetwork + } + if ase.InternalLoadBalancingMode != "" { + objectMap["internalLoadBalancingMode"] = ase.InternalLoadBalancingMode + } + if ase.MultiSize != nil { + objectMap["multiSize"] = ase.MultiSize + } + if ase.IpsslAddressCount != nil { + objectMap["ipsslAddressCount"] = ase.IpsslAddressCount + } + if ase.DNSSuffix != nil { + objectMap["dnsSuffix"] = ase.DNSSuffix + } + if ase.FrontEndScaleFactor != nil { + objectMap["frontEndScaleFactor"] = ase.FrontEndScaleFactor + } + if ase.ClusterSettings != nil { + objectMap["clusterSettings"] = ase.ClusterSettings + } + if ase.UserWhitelistedIPRanges != nil { + objectMap["userWhitelistedIpRanges"] = ase.UserWhitelistedIPRanges + } + if ase.DedicatedHostCount != nil { + objectMap["dedicatedHostCount"] = ase.DedicatedHostCount + } + if ase.ZoneRedundant != nil { + objectMap["zoneRedundant"] = ase.ZoneRedundant + } + return json.Marshal(objectMap) +} + +// AppServiceEnvironmentCollection collection of App Service Environments. +type AppServiceEnvironmentCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]AppServiceEnvironmentResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceEnvironmentCollection. +func (asec AppServiceEnvironmentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asec.Value != nil { + objectMap["value"] = asec.Value + } + return json.Marshal(objectMap) +} + +// AppServiceEnvironmentCollectionIterator provides access to a complete listing of +// AppServiceEnvironmentResource values. +type AppServiceEnvironmentCollectionIterator struct { + i int + page AppServiceEnvironmentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppServiceEnvironmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppServiceEnvironmentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppServiceEnvironmentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppServiceEnvironmentCollectionIterator) Response() AppServiceEnvironmentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppServiceEnvironmentCollectionIterator) Value() AppServiceEnvironmentResource { + if !iter.page.NotDone() { + return AppServiceEnvironmentResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppServiceEnvironmentCollectionIterator type. +func NewAppServiceEnvironmentCollectionIterator(page AppServiceEnvironmentCollectionPage) AppServiceEnvironmentCollectionIterator { + return AppServiceEnvironmentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asec AppServiceEnvironmentCollection) IsEmpty() bool { + return asec.Value == nil || len(*asec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (asec AppServiceEnvironmentCollection) hasNextLink() bool { + return asec.NextLink != nil && len(*asec.NextLink) != 0 +} + +// appServiceEnvironmentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asec AppServiceEnvironmentCollection) appServiceEnvironmentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !asec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asec.NextLink))) +} + +// AppServiceEnvironmentCollectionPage contains a page of AppServiceEnvironmentResource values. +type AppServiceEnvironmentCollectionPage struct { + fn func(context.Context, AppServiceEnvironmentCollection) (AppServiceEnvironmentCollection, error) + asec AppServiceEnvironmentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppServiceEnvironmentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServiceEnvironmentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.asec) + if err != nil { + return err + } + page.asec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppServiceEnvironmentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppServiceEnvironmentCollectionPage) NotDone() bool { + return !page.asec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppServiceEnvironmentCollectionPage) Response() AppServiceEnvironmentCollection { + return page.asec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppServiceEnvironmentCollectionPage) Values() []AppServiceEnvironmentResource { + if page.asec.IsEmpty() { + return nil + } + return *page.asec.Value +} + +// Creates a new instance of the AppServiceEnvironmentCollectionPage type. +func NewAppServiceEnvironmentCollectionPage(cur AppServiceEnvironmentCollection, getNextPage func(context.Context, AppServiceEnvironmentCollection) (AppServiceEnvironmentCollection, error)) AppServiceEnvironmentCollectionPage { + return AppServiceEnvironmentCollectionPage{ + fn: getNextPage, + asec: cur, + } +} + +// AppServiceEnvironmentPatchResource ARM resource for a app service environment. +type AppServiceEnvironmentPatchResource struct { + // AppServiceEnvironment - Core resource properties + *AppServiceEnvironment `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServiceEnvironmentPatchResource. +func (asepr AppServiceEnvironmentPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asepr.AppServiceEnvironment != nil { + objectMap["properties"] = asepr.AppServiceEnvironment + } + if asepr.Kind != nil { + objectMap["kind"] = asepr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServiceEnvironmentPatchResource struct. +func (asepr *AppServiceEnvironmentPatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceEnvironment AppServiceEnvironment + err = json.Unmarshal(*v, &appServiceEnvironment) + if err != nil { + return err + } + asepr.AppServiceEnvironment = &appServiceEnvironment + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asepr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asepr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asepr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asepr.Type = &typeVar + } + } + } + + return nil +} + +// AppServiceEnvironmentResource app Service Environment ARM resource. +type AppServiceEnvironmentResource struct { + autorest.Response `json:"-"` + // AppServiceEnvironment - Core resource properties + *AppServiceEnvironment `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AppServiceEnvironmentResource. +func (aser AppServiceEnvironmentResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aser.AppServiceEnvironment != nil { + objectMap["properties"] = aser.AppServiceEnvironment + } + if aser.Kind != nil { + objectMap["kind"] = aser.Kind + } + if aser.Location != nil { + objectMap["location"] = aser.Location + } + if aser.Tags != nil { + objectMap["tags"] = aser.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServiceEnvironmentResource struct. +func (aser *AppServiceEnvironmentResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServiceEnvironment AppServiceEnvironment + err = json.Unmarshal(*v, &appServiceEnvironment) + if err != nil { + return err + } + aser.AppServiceEnvironment = &appServiceEnvironment + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + aser.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + aser.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + aser.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + aser.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + aser.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + aser.Tags = tags + } + } + } + + return nil +} + +// AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (RemotePrivateEndpointConnectionARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture.Result. +func (future *AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture) result(client AppServiceEnvironmentsClient) (rpecar RemotePrivateEndpointConnectionARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpecar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpecar.Response.Response, err = future.GetResult(sender); err == nil && rpecar.Response.Response.StatusCode != http.StatusNoContent { + rpecar, err = client.ApproveOrRejectPrivateEndpointConnectionResponder(rpecar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture", "Result", rpecar.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsChangeVnetAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsChangeVnetAllFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppCollectionPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsChangeVnetAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsChangeVnetAllFuture.Result. +func (future *AppServiceEnvironmentsChangeVnetAllFuture) result(client AppServiceEnvironmentsClient) (acp AppCollectionPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsChangeVnetAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + acp.ac.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsChangeVnetAllFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if acp.ac.Response.Response, err = future.GetResult(sender); err == nil && acp.ac.Response.Response.StatusCode != http.StatusNoContent { + acp, err = client.ChangeVnetResponder(acp.ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsChangeVnetAllFuture", "Result", acp.ac.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsChangeVnetFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsChangeVnetFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppCollectionPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsChangeVnetFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsChangeVnetFuture.Result. +func (future *AppServiceEnvironmentsChangeVnetFuture) result(client AppServiceEnvironmentsClient) (acp AppCollectionPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsChangeVnetFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + acp.ac.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsChangeVnetFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if acp.ac.Response.Response, err = future.GetResult(sender); err == nil && acp.ac.Response.Response.StatusCode != http.StatusNoContent { + acp, err = client.ChangeVnetResponder(acp.ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsChangeVnetFuture", "Result", acp.ac.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppServiceEnvironmentResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsCreateOrUpdateFuture.Result. +func (future *AppServiceEnvironmentsCreateOrUpdateFuture) result(client AppServiceEnvironmentsClient) (aser AppServiceEnvironmentResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + aser.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if aser.Response.Response, err = future.GetResult(sender); err == nil && aser.Response.Response.StatusCode != http.StatusNoContent { + aser, err = client.CreateOrUpdateResponder(aser.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateFuture", "Result", aser.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (WorkerPoolResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture.Result. +func (future *AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture) result(client AppServiceEnvironmentsClient) (wpr WorkerPoolResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + wpr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wpr.Response.Response, err = future.GetResult(sender); err == nil && wpr.Response.Response.StatusCode != http.StatusNoContent { + wpr, err = client.CreateOrUpdateMultiRolePoolResponder(wpr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture", "Result", wpr.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (WorkerPoolResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture.Result. +func (future *AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture) result(client AppServiceEnvironmentsClient) (wpr WorkerPoolResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + wpr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if wpr.Response.Response, err = future.GetResult(sender); err == nil && wpr.Response.Response.StatusCode != http.StatusNoContent { + wpr, err = client.CreateOrUpdateWorkerPoolResponder(wpr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture", "Result", wpr.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsDeleteFuture.Result. +func (future *AppServiceEnvironmentsDeleteFuture) result(client AppServiceEnvironmentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (SetObject, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture.Result. +func (future *AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture) result(client AppServiceEnvironmentsClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + so.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeletePrivateEndpointConnectionResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsResumeAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsResumeAllFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppCollectionPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsResumeAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsResumeAllFuture.Result. +func (future *AppServiceEnvironmentsResumeAllFuture) result(client AppServiceEnvironmentsClient) (acp AppCollectionPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + acp.ac.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsResumeAllFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if acp.ac.Response.Response, err = future.GetResult(sender); err == nil && acp.ac.Response.Response.StatusCode != http.StatusNoContent { + acp, err = client.ResumeResponder(acp.ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeAllFuture", "Result", acp.ac.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsResumeFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsResumeFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppCollectionPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsResumeFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsResumeFuture.Result. +func (future *AppServiceEnvironmentsResumeFuture) result(client AppServiceEnvironmentsClient) (acp AppCollectionPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + acp.ac.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsResumeFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if acp.ac.Response.Response, err = future.GetResult(sender); err == nil && acp.ac.Response.Response.StatusCode != http.StatusNoContent { + acp, err = client.ResumeResponder(acp.ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsResumeFuture", "Result", acp.ac.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsSuspendAllFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsSuspendAllFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppCollectionPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsSuspendAllFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsSuspendAllFuture.Result. +func (future *AppServiceEnvironmentsSuspendAllFuture) result(client AppServiceEnvironmentsClient) (acp AppCollectionPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendAllFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + acp.ac.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsSuspendAllFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if acp.ac.Response.Response, err = future.GetResult(sender); err == nil && acp.ac.Response.Response.StatusCode != http.StatusNoContent { + acp, err = client.SuspendResponder(acp.ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendAllFuture", "Result", acp.ac.Response.Response, "Failure responding to request") + } + } + return +} + +// AppServiceEnvironmentsSuspendFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServiceEnvironmentsSuspendFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServiceEnvironmentsClient) (AppCollectionPage, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServiceEnvironmentsSuspendFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServiceEnvironmentsSuspendFuture.Result. +func (future *AppServiceEnvironmentsSuspendFuture) result(client AppServiceEnvironmentsClient) (acp AppCollectionPage, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + acp.ac.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServiceEnvironmentsSuspendFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if acp.ac.Response.Response, err = future.GetResult(sender); err == nil && acp.ac.Response.Response.StatusCode != http.StatusNoContent { + acp, err = client.SuspendResponder(acp.ac.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServiceEnvironmentsSuspendFuture", "Result", acp.ac.Response.Response, "Failure responding to request") + } + } + return +} + +// AppserviceGithubToken github access token for Appservice CLI github integration. +type AppserviceGithubToken struct { + // AccessToken - Github access token for Appservice CLI github integration + AccessToken *string `json:"accessToken,omitempty"` + // Scope - Scope of the github access token + Scope *string `json:"scope,omitempty"` + // TokenType - token type + TokenType *string `json:"tokenType,omitempty"` + // GotToken - True if valid github token received, False otherwise + GotToken *bool `json:"gotToken,omitempty"` + // ErrorMessage - Error message if unable to get token + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// AppserviceGithubTokenRequest appservice Github token request content. +type AppserviceGithubTokenRequest struct { + // Code - Code string to exchange for Github Access token + Code *string `json:"code,omitempty"` + // State - State string used for verification. + State *string `json:"state,omitempty"` +} + +// AppServicePlan app Service plan. +type AppServicePlan struct { + autorest.Response `json:"-"` + // AppServicePlanProperties - AppServicePlan resource specific properties + *AppServicePlanProperties `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AppServicePlan. +func (asp AppServicePlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.AppServicePlanProperties != nil { + objectMap["properties"] = asp.AppServicePlanProperties + } + if asp.Sku != nil { + objectMap["sku"] = asp.Sku + } + if asp.ExtendedLocation != nil { + objectMap["extendedLocation"] = asp.ExtendedLocation + } + if asp.Kind != nil { + objectMap["kind"] = asp.Kind + } + if asp.Location != nil { + objectMap["location"] = asp.Location + } + if asp.Tags != nil { + objectMap["tags"] = asp.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServicePlan struct. +func (asp *AppServicePlan) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServicePlanProperties AppServicePlanProperties + err = json.Unmarshal(*v, &appServicePlanProperties) + if err != nil { + return err + } + asp.AppServicePlanProperties = &appServicePlanProperties + } + case "sku": + if v != nil { + var sku SkuDescription + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + asp.Sku = &sku + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + asp.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asp.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asp.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + asp.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asp.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + asp.Tags = tags + } + } + } + + return nil +} + +// AppServicePlanCollection collection of App Service plans. +type AppServicePlanCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]AppServicePlan `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServicePlanCollection. +func (aspc AppServicePlanCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aspc.Value != nil { + objectMap["value"] = aspc.Value + } + return json.Marshal(objectMap) +} + +// AppServicePlanCollectionIterator provides access to a complete listing of AppServicePlan values. +type AppServicePlanCollectionIterator struct { + i int + page AppServicePlanCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppServicePlanCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlanCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppServicePlanCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppServicePlanCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppServicePlanCollectionIterator) Response() AppServicePlanCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppServicePlanCollectionIterator) Value() AppServicePlan { + if !iter.page.NotDone() { + return AppServicePlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppServicePlanCollectionIterator type. +func NewAppServicePlanCollectionIterator(page AppServicePlanCollectionPage) AppServicePlanCollectionIterator { + return AppServicePlanCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aspc AppServicePlanCollection) IsEmpty() bool { + return aspc.Value == nil || len(*aspc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (aspc AppServicePlanCollection) hasNextLink() bool { + return aspc.NextLink != nil && len(*aspc.NextLink) != 0 +} + +// appServicePlanCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aspc AppServicePlanCollection) appServicePlanCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !aspc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aspc.NextLink))) +} + +// AppServicePlanCollectionPage contains a page of AppServicePlan values. +type AppServicePlanCollectionPage struct { + fn func(context.Context, AppServicePlanCollection) (AppServicePlanCollection, error) + aspc AppServicePlanCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppServicePlanCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppServicePlanCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.aspc) + if err != nil { + return err + } + page.aspc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppServicePlanCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppServicePlanCollectionPage) NotDone() bool { + return !page.aspc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppServicePlanCollectionPage) Response() AppServicePlanCollection { + return page.aspc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppServicePlanCollectionPage) Values() []AppServicePlan { + if page.aspc.IsEmpty() { + return nil + } + return *page.aspc.Value +} + +// Creates a new instance of the AppServicePlanCollectionPage type. +func NewAppServicePlanCollectionPage(cur AppServicePlanCollection, getNextPage func(context.Context, AppServicePlanCollection) (AppServicePlanCollection, error)) AppServicePlanCollectionPage { + return AppServicePlanCollectionPage{ + fn: getNextPage, + aspc: cur, + } +} + +// AppServicePlanPatchResource ARM resource for a app service plan. +type AppServicePlanPatchResource struct { + // AppServicePlanPatchResourceProperties - AppServicePlanPatchResource resource specific properties + *AppServicePlanPatchResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServicePlanPatchResource. +func (asppr AppServicePlanPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asppr.AppServicePlanPatchResourceProperties != nil { + objectMap["properties"] = asppr.AppServicePlanPatchResourceProperties + } + if asppr.Kind != nil { + objectMap["kind"] = asppr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppServicePlanPatchResource struct. +func (asppr *AppServicePlanPatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var appServicePlanPatchResourceProperties AppServicePlanPatchResourceProperties + err = json.Unmarshal(*v, &appServicePlanPatchResourceProperties) + if err != nil { + return err + } + asppr.AppServicePlanPatchResourceProperties = &appServicePlanPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + asppr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + asppr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + asppr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + asppr.Type = &typeVar + } + } + } + + return nil +} + +// AppServicePlanPatchResourceProperties appServicePlanPatchResource resource specific properties +type AppServicePlanPatchResourceProperties struct { + // WorkerTierName - Target worker tier assigned to the App Service plan. + WorkerTierName *string `json:"workerTierName,omitempty"` + // Status - READ-ONLY; App Service plan status. Possible values include: 'StatusOptionsReady', 'StatusOptionsPending', 'StatusOptionsCreating' + Status StatusOptions `json:"status,omitempty"` + // Subscription - READ-ONLY; App Service plan subscription. + Subscription *string `json:"subscription,omitempty"` + // HostingEnvironmentProfile - Specification for the App Service Environment to use for the App Service plan. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + // MaximumNumberOfWorkers - READ-ONLY; Maximum number of instances that can be assigned to this App Service plan. + MaximumNumberOfWorkers *int32 `json:"maximumNumberOfWorkers,omitempty"` + // GeoRegion - READ-ONLY; Geographical location for the App Service plan. + GeoRegion *string `json:"geoRegion,omitempty"` + // PerSiteScaling - If true, apps assigned to this App Service plan can be scaled independently. + // If false, apps assigned to this App Service plan will scale to all instances of the plan. + PerSiteScaling *bool `json:"perSiteScaling,omitempty"` + // ElasticScaleEnabled - ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku + ElasticScaleEnabled *bool `json:"elasticScaleEnabled,omitempty"` + // MaximumElasticWorkerCount - Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + MaximumElasticWorkerCount *int32 `json:"maximumElasticWorkerCount,omitempty"` + // NumberOfSites - READ-ONLY; Number of apps assigned to this App Service plan. + NumberOfSites *int32 `json:"numberOfSites,omitempty"` + // IsSpot - If true, this App Service Plan owns spot instances. + IsSpot *bool `json:"isSpot,omitempty"` + // SpotExpirationTime - The time when the server farm expires. Valid only if it is a spot server farm. + SpotExpirationTime *date.Time `json:"spotExpirationTime,omitempty"` + // FreeOfferExpirationTime - The time when the server farm free offer expires. + FreeOfferExpirationTime *date.Time `json:"freeOfferExpirationTime,omitempty"` + // ResourceGroup - READ-ONLY; Resource group of the App Service plan. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // Reserved - If Linux app service plan true, false otherwise. + Reserved *bool `json:"reserved,omitempty"` + // IsXenon - Obsolete: If Hyper-V container app service plan true, false otherwise. + IsXenon *bool `json:"isXenon,omitempty"` + // HyperV - If Hyper-V container app service plan true, false otherwise. + HyperV *bool `json:"hyperV,omitempty"` + // TargetWorkerCount - Scaling worker count. + TargetWorkerCount *int32 `json:"targetWorkerCount,omitempty"` + // TargetWorkerSizeID - Scaling worker size ID. + TargetWorkerSizeID *int32 `json:"targetWorkerSizeId,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the App Service Plan. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // KubeEnvironmentProfile - Specification for the Kubernetes Environment to use for the App Service plan. + KubeEnvironmentProfile *KubeEnvironmentProfile `json:"kubeEnvironmentProfile,omitempty"` + // ZoneRedundant - If true, this App Service Plan will perform availability zone balancing. + // If false, this App Service Plan will not perform availability zone balancing. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServicePlanPatchResourceProperties. +func (asppr AppServicePlanPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asppr.WorkerTierName != nil { + objectMap["workerTierName"] = asppr.WorkerTierName + } + if asppr.HostingEnvironmentProfile != nil { + objectMap["hostingEnvironmentProfile"] = asppr.HostingEnvironmentProfile + } + if asppr.PerSiteScaling != nil { + objectMap["perSiteScaling"] = asppr.PerSiteScaling + } + if asppr.ElasticScaleEnabled != nil { + objectMap["elasticScaleEnabled"] = asppr.ElasticScaleEnabled + } + if asppr.MaximumElasticWorkerCount != nil { + objectMap["maximumElasticWorkerCount"] = asppr.MaximumElasticWorkerCount + } + if asppr.IsSpot != nil { + objectMap["isSpot"] = asppr.IsSpot + } + if asppr.SpotExpirationTime != nil { + objectMap["spotExpirationTime"] = asppr.SpotExpirationTime + } + if asppr.FreeOfferExpirationTime != nil { + objectMap["freeOfferExpirationTime"] = asppr.FreeOfferExpirationTime + } + if asppr.Reserved != nil { + objectMap["reserved"] = asppr.Reserved + } + if asppr.IsXenon != nil { + objectMap["isXenon"] = asppr.IsXenon + } + if asppr.HyperV != nil { + objectMap["hyperV"] = asppr.HyperV + } + if asppr.TargetWorkerCount != nil { + objectMap["targetWorkerCount"] = asppr.TargetWorkerCount + } + if asppr.TargetWorkerSizeID != nil { + objectMap["targetWorkerSizeId"] = asppr.TargetWorkerSizeID + } + if asppr.KubeEnvironmentProfile != nil { + objectMap["kubeEnvironmentProfile"] = asppr.KubeEnvironmentProfile + } + if asppr.ZoneRedundant != nil { + objectMap["zoneRedundant"] = asppr.ZoneRedundant + } + return json.Marshal(objectMap) +} + +// AppServicePlanProperties appServicePlan resource specific properties +type AppServicePlanProperties struct { + // WorkerTierName - Target worker tier assigned to the App Service plan. + WorkerTierName *string `json:"workerTierName,omitempty"` + // Status - READ-ONLY; App Service plan status. Possible values include: 'StatusOptionsReady', 'StatusOptionsPending', 'StatusOptionsCreating' + Status StatusOptions `json:"status,omitempty"` + // Subscription - READ-ONLY; App Service plan subscription. + Subscription *string `json:"subscription,omitempty"` + // HostingEnvironmentProfile - Specification for the App Service Environment to use for the App Service plan. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + // MaximumNumberOfWorkers - READ-ONLY; Maximum number of instances that can be assigned to this App Service plan. + MaximumNumberOfWorkers *int32 `json:"maximumNumberOfWorkers,omitempty"` + // GeoRegion - READ-ONLY; Geographical location for the App Service plan. + GeoRegion *string `json:"geoRegion,omitempty"` + // PerSiteScaling - If true, apps assigned to this App Service plan can be scaled independently. + // If false, apps assigned to this App Service plan will scale to all instances of the plan. + PerSiteScaling *bool `json:"perSiteScaling,omitempty"` + // ElasticScaleEnabled - ServerFarm supports ElasticScale. Apps in this plan will scale as if the ServerFarm was ElasticPremium sku + ElasticScaleEnabled *bool `json:"elasticScaleEnabled,omitempty"` + // MaximumElasticWorkerCount - Maximum number of total workers allowed for this ElasticScaleEnabled App Service Plan + MaximumElasticWorkerCount *int32 `json:"maximumElasticWorkerCount,omitempty"` + // NumberOfSites - READ-ONLY; Number of apps assigned to this App Service plan. + NumberOfSites *int32 `json:"numberOfSites,omitempty"` + // IsSpot - If true, this App Service Plan owns spot instances. + IsSpot *bool `json:"isSpot,omitempty"` + // SpotExpirationTime - The time when the server farm expires. Valid only if it is a spot server farm. + SpotExpirationTime *date.Time `json:"spotExpirationTime,omitempty"` + // FreeOfferExpirationTime - The time when the server farm free offer expires. + FreeOfferExpirationTime *date.Time `json:"freeOfferExpirationTime,omitempty"` + // ResourceGroup - READ-ONLY; Resource group of the App Service plan. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // Reserved - If Linux app service plan true, false otherwise. + Reserved *bool `json:"reserved,omitempty"` + // IsXenon - Obsolete: If Hyper-V container app service plan true, false otherwise. + IsXenon *bool `json:"isXenon,omitempty"` + // HyperV - If Hyper-V container app service plan true, false otherwise. + HyperV *bool `json:"hyperV,omitempty"` + // TargetWorkerCount - Scaling worker count. + TargetWorkerCount *int32 `json:"targetWorkerCount,omitempty"` + // TargetWorkerSizeID - Scaling worker size ID. + TargetWorkerSizeID *int32 `json:"targetWorkerSizeId,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the App Service Plan. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // KubeEnvironmentProfile - Specification for the Kubernetes Environment to use for the App Service plan. + KubeEnvironmentProfile *KubeEnvironmentProfile `json:"kubeEnvironmentProfile,omitempty"` + // ZoneRedundant - If true, this App Service Plan will perform availability zone balancing. + // If false, this App Service Plan will not perform availability zone balancing. + ZoneRedundant *bool `json:"zoneRedundant,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppServicePlanProperties. +func (asp AppServicePlanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asp.WorkerTierName != nil { + objectMap["workerTierName"] = asp.WorkerTierName + } + if asp.HostingEnvironmentProfile != nil { + objectMap["hostingEnvironmentProfile"] = asp.HostingEnvironmentProfile + } + if asp.PerSiteScaling != nil { + objectMap["perSiteScaling"] = asp.PerSiteScaling + } + if asp.ElasticScaleEnabled != nil { + objectMap["elasticScaleEnabled"] = asp.ElasticScaleEnabled + } + if asp.MaximumElasticWorkerCount != nil { + objectMap["maximumElasticWorkerCount"] = asp.MaximumElasticWorkerCount + } + if asp.IsSpot != nil { + objectMap["isSpot"] = asp.IsSpot + } + if asp.SpotExpirationTime != nil { + objectMap["spotExpirationTime"] = asp.SpotExpirationTime + } + if asp.FreeOfferExpirationTime != nil { + objectMap["freeOfferExpirationTime"] = asp.FreeOfferExpirationTime + } + if asp.Reserved != nil { + objectMap["reserved"] = asp.Reserved + } + if asp.IsXenon != nil { + objectMap["isXenon"] = asp.IsXenon + } + if asp.HyperV != nil { + objectMap["hyperV"] = asp.HyperV + } + if asp.TargetWorkerCount != nil { + objectMap["targetWorkerCount"] = asp.TargetWorkerCount + } + if asp.TargetWorkerSizeID != nil { + objectMap["targetWorkerSizeId"] = asp.TargetWorkerSizeID + } + if asp.KubeEnvironmentProfile != nil { + objectMap["kubeEnvironmentProfile"] = asp.KubeEnvironmentProfile + } + if asp.ZoneRedundant != nil { + objectMap["zoneRedundant"] = asp.ZoneRedundant + } + return json.Marshal(objectMap) +} + +// AppServicePlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppServicePlansCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppServicePlansClient) (AppServicePlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppServicePlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppServicePlansCreateOrUpdateFuture.Result. +func (future *AppServicePlansCreateOrUpdateFuture) result(client AppServicePlansClient) (asp AppServicePlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + asp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppServicePlansCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if asp.Response.Response, err = future.GetResult(sender); err == nil && asp.Response.Response.StatusCode != http.StatusNoContent { + asp, err = client.CreateOrUpdateResponder(asp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppServicePlansCreateOrUpdateFuture", "Result", asp.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsInstallSiteExtensionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsInstallSiteExtensionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (SiteExtensionInfo, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsInstallSiteExtensionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsInstallSiteExtensionFuture.Result. +func (future *AppsInstallSiteExtensionFuture) result(client AppsClient) (sei SiteExtensionInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sei.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsInstallSiteExtensionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sei.Response.Response, err = future.GetResult(sender); err == nil && sei.Response.Response.StatusCode != http.StatusNoContent { + sei, err = client.InstallSiteExtensionResponder(sei.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionFuture", "Result", sei.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsInstallSiteExtensionSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsInstallSiteExtensionSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (SiteExtensionInfo, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsInstallSiteExtensionSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsInstallSiteExtensionSlotFuture.Result. +func (future *AppsInstallSiteExtensionSlotFuture) result(client AppsClient) (sei SiteExtensionInfo, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sei.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsInstallSiteExtensionSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sei.Response.Response, err = future.GetResult(sender); err == nil && sei.Response.Response.StatusCode != http.StatusNoContent { + sei, err = client.InstallSiteExtensionSlotResponder(sei.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsInstallSiteExtensionSlotFuture", "Result", sei.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsListPublishingCredentialsFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsListPublishingCredentialsFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (User, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsListPublishingCredentialsFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsListPublishingCredentialsFuture.Result. +func (future *AppsListPublishingCredentialsFuture) result(client AppsClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + u.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsListPublishingCredentialsFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.ListPublishingCredentialsResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsListPublishingCredentialsSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsListPublishingCredentialsSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (User, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsListPublishingCredentialsSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsListPublishingCredentialsSlotFuture.Result. +func (future *AppsListPublishingCredentialsSlotFuture) result(client AppsClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + u.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsListPublishingCredentialsSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.ListPublishingCredentialsSlotResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsListPublishingCredentialsSlotFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsMigrateMySQLFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsMigrateMySQLFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (Operation, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsMigrateMySQLFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsMigrateMySQLFuture.Result. +func (future *AppsMigrateMySQLFuture) result(client AppsClient) (o Operation, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateMySQLFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + o.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsMigrateMySQLFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if o.Response.Response, err = future.GetResult(sender); err == nil && o.Response.Response.StatusCode != http.StatusNoContent { + o, err = client.MigrateMySQLResponder(o.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateMySQLFuture", "Result", o.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsMigrateStorageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsMigrateStorageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (StorageMigrationResponse, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsMigrateStorageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsMigrateStorageFuture.Result. +func (future *AppsMigrateStorageFuture) result(client AppsClient) (smr StorageMigrationResponse, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateStorageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + smr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsMigrateStorageFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if smr.Response.Response, err = future.GetResult(sender); err == nil && smr.Response.Response.StatusCode != http.StatusNoContent { + smr, err = client.MigrateStorageResponder(smr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsMigrateStorageFuture", "Result", smr.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsRestoreFromBackupBlobFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsRestoreFromBackupBlobFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreFromBackupBlobFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreFromBackupBlobFuture.Result. +func (future *AppsRestoreFromBackupBlobFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFromBackupBlobFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreFromBackupBlobFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreFromBackupBlobSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsRestoreFromBackupBlobSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreFromBackupBlobSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreFromBackupBlobSlotFuture.Result. +func (future *AppsRestoreFromBackupBlobSlotFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFromBackupBlobSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreFromBackupBlobSlotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreFromDeletedAppFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsRestoreFromDeletedAppFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreFromDeletedAppFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreFromDeletedAppFuture.Result. +func (future *AppsRestoreFromDeletedAppFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFromDeletedAppFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreFromDeletedAppFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreFromDeletedAppSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsRestoreFromDeletedAppSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreFromDeletedAppSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreFromDeletedAppSlotFuture.Result. +func (future *AppsRestoreFromDeletedAppSlotFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFromDeletedAppSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreFromDeletedAppSlotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type AppsRestoreFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreFuture.Result. +func (future *AppsRestoreFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsRestoreSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreSlotFuture.Result. +func (future *AppsRestoreSlotFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreSlotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreSnapshotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsRestoreSnapshotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreSnapshotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreSnapshotFuture.Result. +func (future *AppsRestoreSnapshotFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSnapshotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreSnapshotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsRestoreSnapshotSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsRestoreSnapshotSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsRestoreSnapshotSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsRestoreSnapshotSlotFuture.Result. +func (future *AppsRestoreSnapshotSlotFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsRestoreSnapshotSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsRestoreSnapshotSlotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsStartNetworkTraceFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsStartNetworkTraceFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (ListNetworkTrace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsStartNetworkTraceFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsStartNetworkTraceFuture.Result. +func (future *AppsStartNetworkTraceFuture) result(client AppsClient) (lnt ListNetworkTrace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartNetworkTraceFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lnt.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsStartNetworkTraceFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lnt.Response.Response, err = future.GetResult(sender); err == nil && lnt.Response.Response.StatusCode != http.StatusNoContent { + lnt, err = client.StartNetworkTraceResponder(lnt.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartNetworkTraceFuture", "Result", lnt.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsStartNetworkTraceSlotFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsStartNetworkTraceSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (ListNetworkTrace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsStartNetworkTraceSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsStartNetworkTraceSlotFuture.Result. +func (future *AppsStartNetworkTraceSlotFuture) result(client AppsClient) (lnt ListNetworkTrace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartNetworkTraceSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lnt.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsStartNetworkTraceSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lnt.Response.Response, err = future.GetResult(sender); err == nil && lnt.Response.Response.StatusCode != http.StatusNoContent { + lnt, err = client.StartNetworkTraceSlotResponder(lnt.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartNetworkTraceSlotFuture", "Result", lnt.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsStartWebSiteNetworkTraceOperationFuture an abstraction for monitoring and retrieving the results of +// a long-running operation. +type AppsStartWebSiteNetworkTraceOperationFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (ListNetworkTrace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsStartWebSiteNetworkTraceOperationFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsStartWebSiteNetworkTraceOperationFuture.Result. +func (future *AppsStartWebSiteNetworkTraceOperationFuture) result(client AppsClient) (lnt ListNetworkTrace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartWebSiteNetworkTraceOperationFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lnt.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsStartWebSiteNetworkTraceOperationFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lnt.Response.Response, err = future.GetResult(sender); err == nil && lnt.Response.Response.StatusCode != http.StatusNoContent { + lnt, err = client.StartWebSiteNetworkTraceOperationResponder(lnt.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartWebSiteNetworkTraceOperationFuture", "Result", lnt.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsStartWebSiteNetworkTraceOperationSlotFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type AppsStartWebSiteNetworkTraceOperationSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (ListNetworkTrace, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsStartWebSiteNetworkTraceOperationSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsStartWebSiteNetworkTraceOperationSlotFuture.Result. +func (future *AppsStartWebSiteNetworkTraceOperationSlotFuture) result(client AppsClient) (lnt ListNetworkTrace, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartWebSiteNetworkTraceOperationSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lnt.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsStartWebSiteNetworkTraceOperationSlotFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lnt.Response.Response, err = future.GetResult(sender); err == nil && lnt.Response.Response.StatusCode != http.StatusNoContent { + lnt, err = client.StartWebSiteNetworkTraceOperationSlotResponder(lnt.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsStartWebSiteNetworkTraceOperationSlotFuture", "Result", lnt.Response.Response, "Failure responding to request") + } + } + return +} + +// AppsSwapSlotSlotFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AppsSwapSlotSlotFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsSwapSlotSlotFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsSwapSlotSlotFuture.Result. +func (future *AppsSwapSlotSlotFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotSlotFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsSwapSlotSlotFuture") + return + } + ar.Response = future.Response() + return +} + +// AppsSwapSlotWithProductionFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type AppsSwapSlotWithProductionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AppsSwapSlotWithProductionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AppsSwapSlotWithProductionFuture.Result. +func (future *AppsSwapSlotWithProductionFuture) result(client AppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.AppsSwapSlotWithProductionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.AppsSwapSlotWithProductionFuture") + return + } + ar.Response = future.Response() + return +} + +// AppStack web App stack. +type AppStack struct { + // Location - READ-ONLY; Web App stack location. + Location *string `json:"location,omitempty"` + // AppStackProperties - WebAppStack resource specific properties + *AppStackProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppStack. +func (as AppStack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if as.AppStackProperties != nil { + objectMap["properties"] = as.AppStackProperties + } + if as.Kind != nil { + objectMap["kind"] = as.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AppStack struct. +func (as *AppStack) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + as.Location = &location + } + case "properties": + if v != nil { + var appStackProperties AppStackProperties + err = json.Unmarshal(*v, &appStackProperties) + if err != nil { + return err + } + as.AppStackProperties = &appStackProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + as.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + as.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + as.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + as.Type = &typeVar + } + } + } + + return nil +} + +// AppStackCollection collection of Web app Stacks +type AppStackCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]AppStack `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppStackCollection. +func (asc AppStackCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asc.Value != nil { + objectMap["value"] = asc.Value + } + return json.Marshal(objectMap) +} + +// AppStackCollectionIterator provides access to a complete listing of AppStack values. +type AppStackCollectionIterator struct { + i int + page AppStackCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AppStackCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppStackCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AppStackCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AppStackCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AppStackCollectionIterator) Response() AppStackCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AppStackCollectionIterator) Value() AppStack { + if !iter.page.NotDone() { + return AppStack{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AppStackCollectionIterator type. +func NewAppStackCollectionIterator(page AppStackCollectionPage) AppStackCollectionIterator { + return AppStackCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (asc AppStackCollection) IsEmpty() bool { + return asc.Value == nil || len(*asc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (asc AppStackCollection) hasNextLink() bool { + return asc.NextLink != nil && len(*asc.NextLink) != 0 +} + +// appStackCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (asc AppStackCollection) appStackCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !asc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(asc.NextLink))) +} + +// AppStackCollectionPage contains a page of AppStack values. +type AppStackCollectionPage struct { + fn func(context.Context, AppStackCollection) (AppStackCollection, error) + asc AppStackCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AppStackCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AppStackCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.asc) + if err != nil { + return err + } + page.asc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AppStackCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AppStackCollectionPage) NotDone() bool { + return !page.asc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AppStackCollectionPage) Response() AppStackCollection { + return page.asc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AppStackCollectionPage) Values() []AppStack { + if page.asc.IsEmpty() { + return nil + } + return *page.asc.Value +} + +// Creates a new instance of the AppStackCollectionPage type. +func NewAppStackCollectionPage(cur AppStackCollection, getNextPage func(context.Context, AppStackCollection) (AppStackCollection, error)) AppStackCollectionPage { + return AppStackCollectionPage{ + fn: getNextPage, + asc: cur, + } +} + +// AppStackProperties webAppStack resource specific properties +type AppStackProperties struct { + // DisplayText - READ-ONLY; Web App stack (display only). + DisplayText *string `json:"displayText,omitempty"` + // Value - READ-ONLY; Web App stack name. + Value *string `json:"value,omitempty"` + // MajorVersions - READ-ONLY; List of major versions available. + MajorVersions *[]AppMajorVersion `json:"majorVersions,omitempty"` + // PreferredOs - READ-ONLY; Web App stack preferred OS. Possible values include: 'StackPreferredOsWindows', 'StackPreferredOsLinux' + PreferredOs StackPreferredOs `json:"preferredOs,omitempty"` +} + +// MarshalJSON is the custom marshaler for AppStackProperties. +func (as AppStackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ArcConfiguration ... +type ArcConfiguration struct { + // ArtifactsStorageType - Possible values include: 'StorageTypeLocalNode', 'StorageTypeNetworkFileSystem' + ArtifactsStorageType StorageType `json:"artifactsStorageType,omitempty"` + ArtifactStorageClassName *string `json:"artifactStorageClassName,omitempty"` + ArtifactStorageMountPath *string `json:"artifactStorageMountPath,omitempty"` + ArtifactStorageNodeName *string `json:"artifactStorageNodeName,omitempty"` + ArtifactStorageAccessMode *string `json:"artifactStorageAccessMode,omitempty"` + FrontEndServiceConfiguration *FrontEndConfiguration `json:"frontEndServiceConfiguration,omitempty"` + KubeConfig *string `json:"kubeConfig,omitempty"` +} + +// ArmIDWrapper a wrapper for an ARM resource id +type ArmIDWrapper struct { + // ID - READ-ONLY + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArmIDWrapper. +func (aiw ArmIDWrapper) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ArmPlan the plan object in Azure Resource Manager, represents a marketplace plan. +type ArmPlan struct { + // Name - The name. + Name *string `json:"name,omitempty"` + // Publisher - The publisher. + Publisher *string `json:"publisher,omitempty"` + // Product - The product. + Product *string `json:"product,omitempty"` + // PromotionCode - The promotion code. + PromotionCode *string `json:"promotionCode,omitempty"` + // Version - Version of product. + Version *string `json:"version,omitempty"` +} + +// AseV3NetworkingConfiguration full view of networking configuration for an ASE. +type AseV3NetworkingConfiguration struct { + autorest.Response `json:"-"` + // AseV3NetworkingConfigurationProperties - AseV3NetworkingConfiguration resource specific properties + *AseV3NetworkingConfigurationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AseV3NetworkingConfiguration. +func (avnc AseV3NetworkingConfiguration) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if avnc.AseV3NetworkingConfigurationProperties != nil { + objectMap["properties"] = avnc.AseV3NetworkingConfigurationProperties + } + if avnc.Kind != nil { + objectMap["kind"] = avnc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AseV3NetworkingConfiguration struct. +func (avnc *AseV3NetworkingConfiguration) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var aseV3NetworkingConfigurationProperties AseV3NetworkingConfigurationProperties + err = json.Unmarshal(*v, &aseV3NetworkingConfigurationProperties) + if err != nil { + return err + } + avnc.AseV3NetworkingConfigurationProperties = &aseV3NetworkingConfigurationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + avnc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + avnc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + avnc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + avnc.Type = &typeVar + } + } + } + + return nil +} + +// AseV3NetworkingConfigurationProperties aseV3NetworkingConfiguration resource specific properties +type AseV3NetworkingConfigurationProperties struct { + // WindowsOutboundIPAddresses - READ-ONLY + WindowsOutboundIPAddresses *[]string `json:"windowsOutboundIpAddresses,omitempty"` + // LinuxOutboundIPAddresses - READ-ONLY + LinuxOutboundIPAddresses *[]string `json:"linuxOutboundIpAddresses,omitempty"` + // ExternalInboundIPAddresses - READ-ONLY + ExternalInboundIPAddresses *[]string `json:"externalInboundIpAddresses,omitempty"` + // InternalInboundIPAddresses - READ-ONLY + InternalInboundIPAddresses *[]string `json:"internalInboundIpAddresses,omitempty"` + // AllowNewPrivateEndpointConnections - Property to enable and disable new private endpoint connection creation on ASE + AllowNewPrivateEndpointConnections *bool `json:"allowNewPrivateEndpointConnections,omitempty"` +} + +// MarshalJSON is the custom marshaler for AseV3NetworkingConfigurationProperties. +func (avnc AseV3NetworkingConfigurationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if avnc.AllowNewPrivateEndpointConnections != nil { + objectMap["allowNewPrivateEndpointConnections"] = avnc.AllowNewPrivateEndpointConnections + } + return json.Marshal(objectMap) +} + +// AuthPlatform the configuration settings of the platform of App Service Authentication/Authorization. +type AuthPlatform struct { + // Enabled - true if the Authentication / Authorization feature is enabled for the current app; otherwise, false. + Enabled *bool `json:"enabled,omitempty"` + // RuntimeVersion - The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + // The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // ConfigFilePath - The path of the config file containing auth settings if they come from a file. + // If the path is relative, base will the site's root directory. + ConfigFilePath *string `json:"configFilePath,omitempty"` +} + +// AutoHealActions actions which to take by the auto-heal module when a rule is triggered. +type AutoHealActions struct { + // ActionType - Predefined action to be taken. Possible values include: 'AutoHealActionTypeRecycle', 'AutoHealActionTypeLogEvent', 'AutoHealActionTypeCustomAction' + ActionType AutoHealActionType `json:"actionType,omitempty"` + // CustomAction - Custom action to be taken. + CustomAction *AutoHealCustomAction `json:"customAction,omitempty"` + // MinProcessExecutionTime - Minimum time the process must execute + // before taking the action + MinProcessExecutionTime *string `json:"minProcessExecutionTime,omitempty"` +} + +// AutoHealCustomAction custom action to be executed +// when an auto heal rule is triggered. +type AutoHealCustomAction struct { + // Exe - Executable to be run. + Exe *string `json:"exe,omitempty"` + // Parameters - Parameters for the executable. + Parameters *string `json:"parameters,omitempty"` +} + +// AutoHealRules rules that can be defined for auto-heal. +type AutoHealRules struct { + // Triggers - Conditions that describe when to execute the auto-heal actions. + Triggers *AutoHealTriggers `json:"triggers,omitempty"` + // Actions - Actions to be executed when a rule is triggered. + Actions *AutoHealActions `json:"actions,omitempty"` +} + +// AutoHealTriggers triggers for auto-heal. +type AutoHealTriggers struct { + // Requests - A rule based on total requests. + Requests *RequestsBasedTrigger `json:"requests,omitempty"` + // PrivateBytesInKB - A rule based on private bytes. + PrivateBytesInKB *int32 `json:"privateBytesInKB,omitempty"` + // StatusCodes - A rule based on status codes. + StatusCodes *[]StatusCodesBasedTrigger `json:"statusCodes,omitempty"` + // SlowRequests - A rule based on request execution time. + SlowRequests *SlowRequestsBasedTrigger `json:"slowRequests,omitempty"` + // SlowRequestsWithPath - A rule based on multiple Slow Requests Rule with path + SlowRequestsWithPath *[]SlowRequestsBasedTrigger `json:"slowRequestsWithPath,omitempty"` + // StatusCodesRange - A rule based on status codes ranges. + StatusCodesRange *[]StatusCodesRangeBasedTrigger `json:"statusCodesRange,omitempty"` +} + +// AzureActiveDirectory the configuration settings of the Azure Active directory provider. +type AzureActiveDirectory struct { + // Enabled - false if the Azure Active Directory provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the Azure Active Directory app registration. + Registration *AzureActiveDirectoryRegistration `json:"registration,omitempty"` + // Login - The configuration settings of the Azure Active Directory login flow. + Login *AzureActiveDirectoryLogin `json:"login,omitempty"` + // Validation - The configuration settings of the Azure Active Directory token validation flow. + Validation *AzureActiveDirectoryValidation `json:"validation,omitempty"` + // IsAutoProvisioned - Gets a value indicating whether the Azure AD configuration was auto-provisioned using 1st party tooling. + // This is an internal flag primarily intended to support the Azure Management Portal. Users should not + // read or write to this property. + IsAutoProvisioned *bool `json:"isAutoProvisioned,omitempty"` +} + +// AzureActiveDirectoryLogin the configuration settings of the Azure Active Directory login flow. +type AzureActiveDirectoryLogin struct { + // LoginParameters - Login parameters to send to the OpenID Connect authorization endpoint when + // a user logs in. Each parameter must be in the form "key=value". + LoginParameters *[]string `json:"loginParameters,omitempty"` + // DisableWWWAuthenticate - true if the www-authenticate provider should be omitted from the request; otherwise, false. + DisableWWWAuthenticate *bool `json:"disableWWWAuthenticate,omitempty"` +} + +// AzureActiveDirectoryRegistration the configuration settings of the Azure Active Directory app +// registration. +type AzureActiveDirectoryRegistration struct { + // OpenIDIssuer - The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + // When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://login.microsoftonline.com/v2.0/{tenant-guid}/. + // This URI is a case-sensitive identifier for the token issuer. + // More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html + OpenIDIssuer *string `json:"openIdIssuer,omitempty"` + // ClientID - The Client ID of this relying party application, known as the client_id. + // This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + // other 3rd party OpenID Connect providers. + // More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html + ClientID *string `json:"clientId,omitempty"` + // ClientSecretSettingName - The app setting name that contains the client secret of the relying party application. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` + // ClientSecretCertificateThumbprint - An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + // a replacement for the Client Secret. It is also optional. + ClientSecretCertificateThumbprint *string `json:"clientSecretCertificateThumbprint,omitempty"` + // ClientSecretCertificateSubjectAlternativeName - An alternative to the client secret thumbprint, that is the subject alternative name of a certificate used for signing purposes. This property acts as + // a replacement for the Client Secret Certificate Thumbprint. It is also optional. + ClientSecretCertificateSubjectAlternativeName *string `json:"clientSecretCertificateSubjectAlternativeName,omitempty"` + // ClientSecretCertificateIssuer - An alternative to the client secret thumbprint, that is the issuer of a certificate used for signing purposes. This property acts as + // a replacement for the Client Secret Certificate Thumbprint. It is also optional. + ClientSecretCertificateIssuer *string `json:"clientSecretCertificateIssuer,omitempty"` +} + +// AzureActiveDirectoryValidation the configuration settings of the Azure Active Directory token validation +// flow. +type AzureActiveDirectoryValidation struct { + // JwtClaimChecks - The configuration settings of the checks that should be made while validating the JWT Claims. + JwtClaimChecks *JwtClaimChecks `json:"jwtClaimChecks,omitempty"` + // AllowedAudiences - The list of audiences that can make successful authentication/authorization requests. + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` + // DefaultAuthorizationPolicy - The configuration settings of the default authorization policy. + DefaultAuthorizationPolicy *DefaultAuthorizationPolicy `json:"defaultAuthorizationPolicy,omitempty"` +} + +// AzureBlobStorageApplicationLogsConfig application logs azure blob storage configuration. +type AzureBlobStorageApplicationLogsConfig struct { + // Level - Log level. Possible values include: 'LogLevelOff', 'LogLevelVerbose', 'LogLevelInformation', 'LogLevelWarning', 'LogLevelError' + Level LogLevel `json:"level,omitempty"` + // SasURL - SAS url to a azure blob container with read/write/list/delete permissions. + SasURL *string `json:"sasUrl,omitempty"` + // RetentionInDays - Retention in days. + // Remove blobs older than X days. + // 0 or lower means no retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` +} + +// AzureBlobStorageHTTPLogsConfig http logs to azure blob storage configuration. +type AzureBlobStorageHTTPLogsConfig struct { + // SasURL - SAS url to a azure blob container with read/write/list/delete permissions. + SasURL *string `json:"sasUrl,omitempty"` + // RetentionInDays - Retention in days. + // Remove blobs older than X days. + // 0 or lower means no retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` + // Enabled - True if configuration is enabled, false if it is disabled and null if configuration is not set. + Enabled *bool `json:"enabled,omitempty"` +} + +// AzureStaticWebApps the configuration settings of the Azure Static Web Apps provider. +type AzureStaticWebApps struct { + // Enabled - false if the Azure Static Web Apps provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the Azure Static Web Apps registration. + Registration *AzureStaticWebAppsRegistration `json:"registration,omitempty"` +} + +// AzureStaticWebAppsRegistration the configuration settings of the registration for the Azure Static Web +// Apps provider +type AzureStaticWebAppsRegistration struct { + // ClientID - The Client ID of the app used for login. + ClientID *string `json:"clientId,omitempty"` +} + +// AzureStorageInfoValue azure Files or Blob Storage access information value for dictionary storage. +type AzureStorageInfoValue struct { + // Type - Type of storage. Possible values include: 'AzureStorageTypeAzureFiles', 'AzureStorageTypeAzureBlob' + Type AzureStorageType `json:"type,omitempty"` + // AccountName - Name of the storage account. + AccountName *string `json:"accountName,omitempty"` + // ShareName - Name of the file share (container name, for Blob storage). + ShareName *string `json:"shareName,omitempty"` + // AccessKey - Access key for the storage account. + AccessKey *string `json:"accessKey,omitempty"` + // MountPath - Path to mount the storage within the site's runtime environment. + MountPath *string `json:"mountPath,omitempty"` + // State - READ-ONLY; State of the storage account. Possible values include: 'AzureStorageStateOk', 'AzureStorageStateInvalidCredentials', 'AzureStorageStateInvalidShare', 'AzureStorageStateNotValidated' + State AzureStorageState `json:"state,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStorageInfoValue. +func (asiv AzureStorageInfoValue) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if asiv.Type != "" { + objectMap["type"] = asiv.Type + } + if asiv.AccountName != nil { + objectMap["accountName"] = asiv.AccountName + } + if asiv.ShareName != nil { + objectMap["shareName"] = asiv.ShareName + } + if asiv.AccessKey != nil { + objectMap["accessKey"] = asiv.AccessKey + } + if asiv.MountPath != nil { + objectMap["mountPath"] = asiv.MountPath + } + return json.Marshal(objectMap) +} + +// AzureStoragePropertyDictionaryResource azureStorageInfo dictionary resource. +type AzureStoragePropertyDictionaryResource struct { + autorest.Response `json:"-"` + // Properties - Azure storage accounts. + Properties map[string]*AzureStorageInfoValue `json:"properties"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureStoragePropertyDictionaryResource. +func (aspdr AzureStoragePropertyDictionaryResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if aspdr.Properties != nil { + objectMap["properties"] = aspdr.Properties + } + if aspdr.Kind != nil { + objectMap["kind"] = aspdr.Kind + } + return json.Marshal(objectMap) +} + +// AzureTableStorageApplicationLogsConfig application logs to Azure table storage configuration. +type AzureTableStorageApplicationLogsConfig struct { + // Level - Log level. Possible values include: 'LogLevelOff', 'LogLevelVerbose', 'LogLevelInformation', 'LogLevelWarning', 'LogLevelError' + Level LogLevel `json:"level,omitempty"` + // SasURL - SAS URL to an Azure table with add/query/delete permissions. + SasURL *string `json:"sasUrl,omitempty"` +} + +// BackupItem backup description. +type BackupItem struct { + autorest.Response `json:"-"` + // BackupItemProperties - BackupItem resource specific properties + *BackupItemProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupItem. +func (bi BackupItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bi.BackupItemProperties != nil { + objectMap["properties"] = bi.BackupItemProperties + } + if bi.Kind != nil { + objectMap["kind"] = bi.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupItem struct. +func (bi *BackupItem) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backupItemProperties BackupItemProperties + err = json.Unmarshal(*v, &backupItemProperties) + if err != nil { + return err + } + bi.BackupItemProperties = &backupItemProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bi.Type = &typeVar + } + } + } + + return nil +} + +// BackupItemCollection collection of backup items. +type BackupItemCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]BackupItem `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupItemCollection. +func (bic BackupItemCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bic.Value != nil { + objectMap["value"] = bic.Value + } + return json.Marshal(objectMap) +} + +// BackupItemCollectionIterator provides access to a complete listing of BackupItem values. +type BackupItemCollectionIterator struct { + i int + page BackupItemCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *BackupItemCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupItemCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *BackupItemCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter BackupItemCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter BackupItemCollectionIterator) Response() BackupItemCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter BackupItemCollectionIterator) Value() BackupItem { + if !iter.page.NotDone() { + return BackupItem{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the BackupItemCollectionIterator type. +func NewBackupItemCollectionIterator(page BackupItemCollectionPage) BackupItemCollectionIterator { + return BackupItemCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (bic BackupItemCollection) IsEmpty() bool { + return bic.Value == nil || len(*bic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (bic BackupItemCollection) hasNextLink() bool { + return bic.NextLink != nil && len(*bic.NextLink) != 0 +} + +// backupItemCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (bic BackupItemCollection) backupItemCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !bic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(bic.NextLink))) +} + +// BackupItemCollectionPage contains a page of BackupItem values. +type BackupItemCollectionPage struct { + fn func(context.Context, BackupItemCollection) (BackupItemCollection, error) + bic BackupItemCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *BackupItemCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BackupItemCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.bic) + if err != nil { + return err + } + page.bic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *BackupItemCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page BackupItemCollectionPage) NotDone() bool { + return !page.bic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page BackupItemCollectionPage) Response() BackupItemCollection { + return page.bic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page BackupItemCollectionPage) Values() []BackupItem { + if page.bic.IsEmpty() { + return nil + } + return *page.bic.Value +} + +// Creates a new instance of the BackupItemCollectionPage type. +func NewBackupItemCollectionPage(cur BackupItemCollection, getNextPage func(context.Context, BackupItemCollection) (BackupItemCollection, error)) BackupItemCollectionPage { + return BackupItemCollectionPage{ + fn: getNextPage, + bic: cur, + } +} + +// BackupItemProperties backupItem resource specific properties +type BackupItemProperties struct { + // BackupID - READ-ONLY; Id of the backup. + BackupID *int32 `json:"id,omitempty"` + // StorageAccountURL - READ-ONLY; SAS URL for the storage account container which contains this backup. + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` + // BlobName - READ-ONLY; Name of the blob which contains data for this backup. + BlobName *string `json:"blobName,omitempty"` + // Name - READ-ONLY; Name of this backup. + Name *string `json:"name,omitempty"` + // Status - READ-ONLY; Backup status. Possible values include: 'BackupItemStatusInProgress', 'BackupItemStatusFailed', 'BackupItemStatusSucceeded', 'BackupItemStatusTimedOut', 'BackupItemStatusCreated', 'BackupItemStatusSkipped', 'BackupItemStatusPartiallySucceeded', 'BackupItemStatusDeleteInProgress', 'BackupItemStatusDeleteFailed', 'BackupItemStatusDeleted' + Status BackupItemStatus `json:"status,omitempty"` + // SizeInBytes - READ-ONLY; Size of the backup in bytes. + SizeInBytes *int64 `json:"sizeInBytes,omitempty"` + // Created - READ-ONLY; Timestamp of the backup creation. + Created *date.Time `json:"created,omitempty"` + // Log - READ-ONLY; Details regarding this backup. Might contain an error message. + Log *string `json:"log,omitempty"` + // Databases - READ-ONLY; List of databases included in the backup. + Databases *[]DatabaseBackupSetting `json:"databases,omitempty"` + // Scheduled - READ-ONLY; True if this backup has been created due to a schedule being triggered. + Scheduled *bool `json:"scheduled,omitempty"` + // LastRestoreTimeStamp - READ-ONLY; Timestamp of a last restore operation which used this backup. + LastRestoreTimeStamp *date.Time `json:"lastRestoreTimeStamp,omitempty"` + // FinishedTimeStamp - READ-ONLY; Timestamp when this backup finished. + FinishedTimeStamp *date.Time `json:"finishedTimeStamp,omitempty"` + // CorrelationID - READ-ONLY; Unique correlation identifier. Please use this along with the timestamp while communicating with Azure support. + CorrelationID *string `json:"correlationId,omitempty"` + // WebsiteSizeInBytes - READ-ONLY; Size of the original web app which has been backed up. + WebsiteSizeInBytes *int64 `json:"websiteSizeInBytes,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupItemProperties. +func (bi BackupItemProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// BackupRequest description of a backup which will be performed. +type BackupRequest struct { + autorest.Response `json:"-"` + // BackupRequestProperties - BackupRequest resource specific properties + *BackupRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupRequest. +func (br BackupRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if br.BackupRequestProperties != nil { + objectMap["properties"] = br.BackupRequestProperties + } + if br.Kind != nil { + objectMap["kind"] = br.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BackupRequest struct. +func (br *BackupRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var backupRequestProperties BackupRequestProperties + err = json.Unmarshal(*v, &backupRequestProperties) + if err != nil { + return err + } + br.BackupRequestProperties = &backupRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + br.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + br.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + br.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + br.Type = &typeVar + } + } + } + + return nil +} + +// BackupRequestProperties backupRequest resource specific properties +type BackupRequestProperties struct { + // BackupName - Name of the backup. + BackupName *string `json:"backupName,omitempty"` + // Enabled - True if the backup schedule is enabled (must be included in that case), false if the backup schedule should be disabled. + Enabled *bool `json:"enabled,omitempty"` + // StorageAccountURL - SAS URL to the container. + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` + // BackupSchedule - Schedule for the backup if it is executed periodically. + BackupSchedule *BackupSchedule `json:"backupSchedule,omitempty"` + // Databases - Databases included in the backup. + Databases *[]DatabaseBackupSetting `json:"databases,omitempty"` +} + +// BackupSchedule description of a backup schedule. Describes how often should be the backup performed and +// what should be the retention policy. +type BackupSchedule struct { + // FrequencyInterval - How often the backup should be executed (e.g. for weekly backup, this should be set to 7 and FrequencyUnit should be set to Day) + FrequencyInterval *int32 `json:"frequencyInterval,omitempty"` + // FrequencyUnit - The unit of time for how often the backup should be executed (e.g. for weekly backup, this should be set to Day and FrequencyInterval should be set to 7). Possible values include: 'FrequencyUnitDay', 'FrequencyUnitHour' + FrequencyUnit FrequencyUnit `json:"frequencyUnit,omitempty"` + // KeepAtLeastOneBackup - True if the retention policy should always keep at least one backup in the storage account, regardless how old it is; false otherwise. + KeepAtLeastOneBackup *bool `json:"keepAtLeastOneBackup,omitempty"` + // RetentionPeriodInDays - After how many days backups should be deleted. + RetentionPeriodInDays *int32 `json:"retentionPeriodInDays,omitempty"` + // StartTime - When the schedule should start working. + StartTime *date.Time `json:"startTime,omitempty"` + // LastExecutionTime - READ-ONLY; Last time when this schedule was triggered. + LastExecutionTime *date.Time `json:"lastExecutionTime,omitempty"` +} + +// MarshalJSON is the custom marshaler for BackupSchedule. +func (bs BackupSchedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bs.FrequencyInterval != nil { + objectMap["frequencyInterval"] = bs.FrequencyInterval + } + if bs.FrequencyUnit != "" { + objectMap["frequencyUnit"] = bs.FrequencyUnit + } + if bs.KeepAtLeastOneBackup != nil { + objectMap["keepAtLeastOneBackup"] = bs.KeepAtLeastOneBackup + } + if bs.RetentionPeriodInDays != nil { + objectMap["retentionPeriodInDays"] = bs.RetentionPeriodInDays + } + if bs.StartTime != nil { + objectMap["startTime"] = bs.StartTime + } + return json.Marshal(objectMap) +} + +// BillingMeter app Service billing entity that contains information about meter which the Azure billing +// system utilizes to charge users for services. +type BillingMeter struct { + // BillingMeterProperties - BillingMeter resource specific properties + *BillingMeterProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for BillingMeter. +func (bm BillingMeter) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bm.BillingMeterProperties != nil { + objectMap["properties"] = bm.BillingMeterProperties + } + if bm.Kind != nil { + objectMap["kind"] = bm.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for BillingMeter struct. +func (bm *BillingMeter) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var billingMeterProperties BillingMeterProperties + err = json.Unmarshal(*v, &billingMeterProperties) + if err != nil { + return err + } + bm.BillingMeterProperties = &billingMeterProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + bm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + bm.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + bm.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + bm.Type = &typeVar + } + } + } + + return nil +} + +// BillingMeterCollection collection of Billing Meters +type BillingMeterCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]BillingMeter `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for BillingMeterCollection. +func (bmc BillingMeterCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if bmc.Value != nil { + objectMap["value"] = bmc.Value + } + return json.Marshal(objectMap) +} + +// BillingMeterCollectionIterator provides access to a complete listing of BillingMeter values. +type BillingMeterCollectionIterator struct { + i int + page BillingMeterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *BillingMeterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BillingMeterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *BillingMeterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter BillingMeterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter BillingMeterCollectionIterator) Response() BillingMeterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter BillingMeterCollectionIterator) Value() BillingMeter { + if !iter.page.NotDone() { + return BillingMeter{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the BillingMeterCollectionIterator type. +func NewBillingMeterCollectionIterator(page BillingMeterCollectionPage) BillingMeterCollectionIterator { + return BillingMeterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (bmc BillingMeterCollection) IsEmpty() bool { + return bmc.Value == nil || len(*bmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (bmc BillingMeterCollection) hasNextLink() bool { + return bmc.NextLink != nil && len(*bmc.NextLink) != 0 +} + +// billingMeterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (bmc BillingMeterCollection) billingMeterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !bmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(bmc.NextLink))) +} + +// BillingMeterCollectionPage contains a page of BillingMeter values. +type BillingMeterCollectionPage struct { + fn func(context.Context, BillingMeterCollection) (BillingMeterCollection, error) + bmc BillingMeterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *BillingMeterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/BillingMeterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.bmc) + if err != nil { + return err + } + page.bmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *BillingMeterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page BillingMeterCollectionPage) NotDone() bool { + return !page.bmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page BillingMeterCollectionPage) Response() BillingMeterCollection { + return page.bmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page BillingMeterCollectionPage) Values() []BillingMeter { + if page.bmc.IsEmpty() { + return nil + } + return *page.bmc.Value +} + +// Creates a new instance of the BillingMeterCollectionPage type. +func NewBillingMeterCollectionPage(cur BillingMeterCollection, getNextPage func(context.Context, BillingMeterCollection) (BillingMeterCollection, error)) BillingMeterCollectionPage { + return BillingMeterCollectionPage{ + fn: getNextPage, + bmc: cur, + } +} + +// BillingMeterProperties billingMeter resource specific properties +type BillingMeterProperties struct { + // MeterID - Meter GUID onboarded in Commerce + MeterID *string `json:"meterId,omitempty"` + // BillingLocation - Azure Location of billable resource + BillingLocation *string `json:"billingLocation,omitempty"` + // ShortName - Short Name from App Service Azure pricing Page + ShortName *string `json:"shortName,omitempty"` + // FriendlyName - Friendly name of the meter + FriendlyName *string `json:"friendlyName,omitempty"` + // ResourceType - App Service ResourceType meter used for + ResourceType *string `json:"resourceType,omitempty"` + // OsType - App Service OS type meter used for + OsType *string `json:"osType,omitempty"` + // Multiplier - Meter Multiplier + Multiplier *float64 `json:"multiplier,omitempty"` +} + +// BlobStorageTokenStore the configuration settings of the storage of the tokens if blob storage is used. +type BlobStorageTokenStore struct { + // SasURLSettingName - The name of the app setting containing the SAS URL of the blob storage containing the tokens. + SasURLSettingName *string `json:"sasUrlSettingName,omitempty"` +} + +// Capability describes the capabilities/features allowed for a specific SKU. +type Capability struct { + // Name - Name of the SKU capability. + Name *string `json:"name,omitempty"` + // Value - Value of the SKU capability. + Value *string `json:"value,omitempty"` + // Reason - Reason of the SKU capability. + Reason *string `json:"reason,omitempty"` +} + +// Certificate SSL certificate for an app. +type Certificate struct { + autorest.Response `json:"-"` + // CertificateProperties - Certificate resource specific properties + *CertificateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Certificate. +func (c Certificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.CertificateProperties != nil { + objectMap["properties"] = c.CertificateProperties + } + if c.Kind != nil { + objectMap["kind"] = c.Kind + } + if c.Location != nil { + objectMap["location"] = c.Location + } + if c.Tags != nil { + objectMap["tags"] = c.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Certificate struct. +func (c *Certificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateProperties CertificateProperties + err = json.Unmarshal(*v, &certificateProperties) + if err != nil { + return err + } + c.CertificateProperties = &certificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + c.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + c.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + c.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + c.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + c.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + c.Tags = tags + } + } + } + + return nil +} + +// CertificateCollection collection of certificates. +type CertificateCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Certificate `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateCollection. +func (cc CertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.Value != nil { + objectMap["value"] = cc.Value + } + return json.Marshal(objectMap) +} + +// CertificateCollectionIterator provides access to a complete listing of Certificate values. +type CertificateCollectionIterator struct { + i int + page CertificateCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CertificateCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CertificateCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CertificateCollectionIterator) Response() CertificateCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CertificateCollectionIterator) Value() Certificate { + if !iter.page.NotDone() { + return Certificate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CertificateCollectionIterator type. +func NewCertificateCollectionIterator(page CertificateCollectionPage) CertificateCollectionIterator { + return CertificateCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cc CertificateCollection) IsEmpty() bool { + return cc.Value == nil || len(*cc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cc CertificateCollection) hasNextLink() bool { + return cc.NextLink != nil && len(*cc.NextLink) != 0 +} + +// certificateCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cc CertificateCollection) certificateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !cc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cc.NextLink))) +} + +// CertificateCollectionPage contains a page of Certificate values. +type CertificateCollectionPage struct { + fn func(context.Context, CertificateCollection) (CertificateCollection, error) + cc CertificateCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificateCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cc) + if err != nil { + return err + } + page.cc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CertificateCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CertificateCollectionPage) NotDone() bool { + return !page.cc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CertificateCollectionPage) Response() CertificateCollection { + return page.cc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CertificateCollectionPage) Values() []Certificate { + if page.cc.IsEmpty() { + return nil + } + return *page.cc.Value +} + +// Creates a new instance of the CertificateCollectionPage type. +func NewCertificateCollectionPage(cur CertificateCollection, getNextPage func(context.Context, CertificateCollection) (CertificateCollection, error)) CertificateCollectionPage { + return CertificateCollectionPage{ + fn: getNextPage, + cc: cur, + } +} + +// CertificateDetails SSL certificate details. +type CertificateDetails struct { + // Version - READ-ONLY; Certificate Version. + Version *int32 `json:"version,omitempty"` + // SerialNumber - READ-ONLY; Certificate Serial Number. + SerialNumber *string `json:"serialNumber,omitempty"` + // Thumbprint - READ-ONLY; Certificate Thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + // Subject - READ-ONLY; Certificate Subject. + Subject *string `json:"subject,omitempty"` + // NotBefore - READ-ONLY; Date Certificate is valid from. + NotBefore *date.Time `json:"notBefore,omitempty"` + // NotAfter - READ-ONLY; Date Certificate is valid to. + NotAfter *date.Time `json:"notAfter,omitempty"` + // SignatureAlgorithm - READ-ONLY; Certificate Signature algorithm. + SignatureAlgorithm *string `json:"signatureAlgorithm,omitempty"` + // Issuer - READ-ONLY; Certificate Issuer. + Issuer *string `json:"issuer,omitempty"` + // RawData - READ-ONLY; Raw certificate data. + RawData *string `json:"rawData,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateDetails. +func (cd CertificateDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CertificateEmail SSL certificate email. +type CertificateEmail struct { + // CertificateEmailProperties - CertificateEmail resource specific properties + *CertificateEmailProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateEmail. +func (ce CertificateEmail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ce.CertificateEmailProperties != nil { + objectMap["properties"] = ce.CertificateEmailProperties + } + if ce.Kind != nil { + objectMap["kind"] = ce.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateEmail struct. +func (ce *CertificateEmail) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateEmailProperties CertificateEmailProperties + err = json.Unmarshal(*v, &certificateEmailProperties) + if err != nil { + return err + } + ce.CertificateEmailProperties = &certificateEmailProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ce.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ce.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ce.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ce.Type = &typeVar + } + } + } + + return nil +} + +// CertificateEmailProperties certificateEmail resource specific properties +type CertificateEmailProperties struct { + // EmailID - Email id. + EmailID *string `json:"emailId,omitempty"` + // TimeStamp - Time stamp. + TimeStamp *date.Time `json:"timeStamp,omitempty"` +} + +// CertificateOrderAction certificate order action. +type CertificateOrderAction struct { + // CertificateOrderActionProperties - CertificateOrderAction resource specific properties + *CertificateOrderActionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateOrderAction. +func (coa CertificateOrderAction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if coa.CertificateOrderActionProperties != nil { + objectMap["properties"] = coa.CertificateOrderActionProperties + } + if coa.Kind != nil { + objectMap["kind"] = coa.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificateOrderAction struct. +func (coa *CertificateOrderAction) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificateOrderActionProperties CertificateOrderActionProperties + err = json.Unmarshal(*v, &certificateOrderActionProperties) + if err != nil { + return err + } + coa.CertificateOrderActionProperties = &certificateOrderActionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + coa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + coa.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + coa.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + coa.Type = &typeVar + } + } + } + + return nil +} + +// CertificateOrderActionProperties certificateOrderAction resource specific properties +type CertificateOrderActionProperties struct { + // ActionType - READ-ONLY; Action type. Possible values include: 'CertificateOrderActionTypeCertificateIssued', 'CertificateOrderActionTypeCertificateOrderCanceled', 'CertificateOrderActionTypeCertificateOrderCreated', 'CertificateOrderActionTypeCertificateRevoked', 'CertificateOrderActionTypeDomainValidationComplete', 'CertificateOrderActionTypeFraudDetected', 'CertificateOrderActionTypeOrgNameChange', 'CertificateOrderActionTypeOrgValidationComplete', 'CertificateOrderActionTypeSanDrop', 'CertificateOrderActionTypeFraudCleared', 'CertificateOrderActionTypeCertificateExpired', 'CertificateOrderActionTypeCertificateExpirationWarning', 'CertificateOrderActionTypeFraudDocumentationRequired', 'CertificateOrderActionTypeUnknown' + ActionType CertificateOrderActionType `json:"actionType,omitempty"` + // CreatedAt - READ-ONLY; Time at which the certificate action was performed. + CreatedAt *date.Time `json:"createdAt,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateOrderActionProperties. +func (coa CertificateOrderActionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CertificateOrderContact ... +type CertificateOrderContact struct { + Email *string `json:"email,omitempty"` + NameFirst *string `json:"nameFirst,omitempty"` + NameLast *string `json:"nameLast,omitempty"` + Phone *string `json:"phone,omitempty"` +} + +// CertificatePatchResource ARM resource for a certificate. +type CertificatePatchResource struct { + // CertificatePatchResourceProperties - CertificatePatchResource resource specific properties + *CertificatePatchResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificatePatchResource. +func (cpr CertificatePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpr.CertificatePatchResourceProperties != nil { + objectMap["properties"] = cpr.CertificatePatchResourceProperties + } + if cpr.Kind != nil { + objectMap["kind"] = cpr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CertificatePatchResource struct. +func (cpr *CertificatePatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var certificatePatchResourceProperties CertificatePatchResourceProperties + err = json.Unmarshal(*v, &certificatePatchResourceProperties) + if err != nil { + return err + } + cpr.CertificatePatchResourceProperties = &certificatePatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpr.Type = &typeVar + } + } + } + + return nil +} + +// CertificatePatchResourceProperties certificatePatchResource resource specific properties +type CertificatePatchResourceProperties struct { + // Password - Certificate password. + Password *string `json:"password,omitempty"` + // FriendlyName - READ-ONLY; Friendly name of the certificate. + FriendlyName *string `json:"friendlyName,omitempty"` + // SubjectName - READ-ONLY; Subject name of the certificate. + SubjectName *string `json:"subjectName,omitempty"` + // HostNames - Host names the certificate applies to. + HostNames *[]string `json:"hostNames,omitempty"` + // PfxBlob - Pfx blob. + PfxBlob *[]byte `json:"pfxBlob,omitempty"` + // SiteName - READ-ONLY; App name. + SiteName *string `json:"siteName,omitempty"` + // SelfLink - READ-ONLY; Self link. + SelfLink *string `json:"selfLink,omitempty"` + // Issuer - READ-ONLY; Certificate issuer. + Issuer *string `json:"issuer,omitempty"` + // IssueDate - READ-ONLY; Certificate issue Date. + IssueDate *date.Time `json:"issueDate,omitempty"` + // ExpirationDate - READ-ONLY; Certificate expiration date. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // Thumbprint - READ-ONLY; Certificate thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + // Valid - READ-ONLY; Is the certificate valid?. + Valid *bool `json:"valid,omitempty"` + // CerBlob - READ-ONLY; Raw bytes of .cer file + CerBlob *[]byte `json:"cerBlob,omitempty"` + // PublicKeyHash - READ-ONLY; Public key hash. + PublicKeyHash *string `json:"publicKeyHash,omitempty"` + // HostingEnvironmentProfile - READ-ONLY; Specification for the App Service Environment to use for the certificate. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + // KeyVaultID - Key Vault Csm resource Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultSecretName - Key Vault secret name. + KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"` + // KeyVaultSecretStatus - READ-ONLY; Status of the Key Vault secret. Possible values include: 'KeyVaultSecretStatusInitialized', 'KeyVaultSecretStatusWaitingOnCertificateOrder', 'KeyVaultSecretStatusSucceeded', 'KeyVaultSecretStatusCertificateOrderFailed', 'KeyVaultSecretStatusOperationNotPermittedOnKeyVault', 'KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultSecretStatusKeyVaultDoesNotExist', 'KeyVaultSecretStatusKeyVaultSecretDoesNotExist', 'KeyVaultSecretStatusUnknownError', 'KeyVaultSecretStatusExternalPrivateKey', 'KeyVaultSecretStatusUnknown' + KeyVaultSecretStatus KeyVaultSecretStatus `json:"keyVaultSecretStatus,omitempty"` + // ServerFarmID - Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + // CanonicalName - CNAME of the certificate to be issued via free certificate + CanonicalName *string `json:"canonicalName,omitempty"` + // DomainValidationMethod - Method of domain validation for free cert + DomainValidationMethod *string `json:"domainValidationMethod,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificatePatchResourceProperties. +func (cpr CertificatePatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpr.Password != nil { + objectMap["password"] = cpr.Password + } + if cpr.HostNames != nil { + objectMap["hostNames"] = cpr.HostNames + } + if cpr.PfxBlob != nil { + objectMap["pfxBlob"] = cpr.PfxBlob + } + if cpr.KeyVaultID != nil { + objectMap["keyVaultId"] = cpr.KeyVaultID + } + if cpr.KeyVaultSecretName != nil { + objectMap["keyVaultSecretName"] = cpr.KeyVaultSecretName + } + if cpr.ServerFarmID != nil { + objectMap["serverFarmId"] = cpr.ServerFarmID + } + if cpr.CanonicalName != nil { + objectMap["canonicalName"] = cpr.CanonicalName + } + if cpr.DomainValidationMethod != nil { + objectMap["domainValidationMethod"] = cpr.DomainValidationMethod + } + return json.Marshal(objectMap) +} + +// CertificateProperties certificate resource specific properties +type CertificateProperties struct { + // Password - Certificate password. + Password *string `json:"password,omitempty"` + // FriendlyName - READ-ONLY; Friendly name of the certificate. + FriendlyName *string `json:"friendlyName,omitempty"` + // SubjectName - READ-ONLY; Subject name of the certificate. + SubjectName *string `json:"subjectName,omitempty"` + // HostNames - Host names the certificate applies to. + HostNames *[]string `json:"hostNames,omitempty"` + // PfxBlob - Pfx blob. + PfxBlob *[]byte `json:"pfxBlob,omitempty"` + // SiteName - READ-ONLY; App name. + SiteName *string `json:"siteName,omitempty"` + // SelfLink - READ-ONLY; Self link. + SelfLink *string `json:"selfLink,omitempty"` + // Issuer - READ-ONLY; Certificate issuer. + Issuer *string `json:"issuer,omitempty"` + // IssueDate - READ-ONLY; Certificate issue Date. + IssueDate *date.Time `json:"issueDate,omitempty"` + // ExpirationDate - READ-ONLY; Certificate expiration date. + ExpirationDate *date.Time `json:"expirationDate,omitempty"` + // Thumbprint - READ-ONLY; Certificate thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + // Valid - READ-ONLY; Is the certificate valid?. + Valid *bool `json:"valid,omitempty"` + // CerBlob - READ-ONLY; Raw bytes of .cer file + CerBlob *[]byte `json:"cerBlob,omitempty"` + // PublicKeyHash - READ-ONLY; Public key hash. + PublicKeyHash *string `json:"publicKeyHash,omitempty"` + // HostingEnvironmentProfile - READ-ONLY; Specification for the App Service Environment to use for the certificate. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + // KeyVaultID - Key Vault Csm resource Id. + KeyVaultID *string `json:"keyVaultId,omitempty"` + // KeyVaultSecretName - Key Vault secret name. + KeyVaultSecretName *string `json:"keyVaultSecretName,omitempty"` + // KeyVaultSecretStatus - READ-ONLY; Status of the Key Vault secret. Possible values include: 'KeyVaultSecretStatusInitialized', 'KeyVaultSecretStatusWaitingOnCertificateOrder', 'KeyVaultSecretStatusSucceeded', 'KeyVaultSecretStatusCertificateOrderFailed', 'KeyVaultSecretStatusOperationNotPermittedOnKeyVault', 'KeyVaultSecretStatusAzureServiceUnauthorizedToAccessKeyVault', 'KeyVaultSecretStatusKeyVaultDoesNotExist', 'KeyVaultSecretStatusKeyVaultSecretDoesNotExist', 'KeyVaultSecretStatusUnknownError', 'KeyVaultSecretStatusExternalPrivateKey', 'KeyVaultSecretStatusUnknown' + KeyVaultSecretStatus KeyVaultSecretStatus `json:"keyVaultSecretStatus,omitempty"` + // ServerFarmID - Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + // CanonicalName - CNAME of the certificate to be issued via free certificate + CanonicalName *string `json:"canonicalName,omitempty"` + // DomainValidationMethod - Method of domain validation for free cert + DomainValidationMethod *string `json:"domainValidationMethod,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateProperties. +func (c CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.Password != nil { + objectMap["password"] = c.Password + } + if c.HostNames != nil { + objectMap["hostNames"] = c.HostNames + } + if c.PfxBlob != nil { + objectMap["pfxBlob"] = c.PfxBlob + } + if c.KeyVaultID != nil { + objectMap["keyVaultId"] = c.KeyVaultID + } + if c.KeyVaultSecretName != nil { + objectMap["keyVaultSecretName"] = c.KeyVaultSecretName + } + if c.ServerFarmID != nil { + objectMap["serverFarmId"] = c.ServerFarmID + } + if c.CanonicalName != nil { + objectMap["canonicalName"] = c.CanonicalName + } + if c.DomainValidationMethod != nil { + objectMap["domainValidationMethod"] = c.DomainValidationMethod + } + return json.Marshal(objectMap) +} + +// ClientRegistration the configuration settings of the app registration for providers that have client ids +// and client secrets +type ClientRegistration struct { + // ClientID - The Client ID of the app used for login. + ClientID *string `json:"clientId,omitempty"` + // ClientSecretSettingName - The app setting name that contains the client secret. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` +} + +// CloningInfo information needed for cloning operation. +type CloningInfo struct { + // CorrelationID - Correlation ID of cloning operation. This ID ties multiple cloning operations + // together to use the same snapshot. + CorrelationID *uuid.UUID `json:"correlationId,omitempty"` + // Overwrite - true to overwrite destination app; otherwise, false. + Overwrite *bool `json:"overwrite,omitempty"` + // CloneCustomHostNames - true to clone custom hostnames from source app; otherwise, false. + CloneCustomHostNames *bool `json:"cloneCustomHostNames,omitempty"` + // CloneSourceControl - true to clone source control from source app; otherwise, false. + CloneSourceControl *bool `json:"cloneSourceControl,omitempty"` + // SourceWebAppID - ARM resource ID of the source app. App resource ID is of the form + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + SourceWebAppID *string `json:"sourceWebAppId,omitempty"` + // SourceWebAppLocation - Location of source app ex: West US or North Europe + SourceWebAppLocation *string `json:"sourceWebAppLocation,omitempty"` + // HostingEnvironment - App Service Environment. + HostingEnvironment *string `json:"hostingEnvironment,omitempty"` + // AppSettingsOverrides - Application setting overrides for cloned app. If specified, these settings override the settings cloned + // from source app. Otherwise, application settings from source app are retained. + AppSettingsOverrides map[string]*string `json:"appSettingsOverrides"` + // ConfigureLoadBalancing - true to configure load balancing for source and destination app. + ConfigureLoadBalancing *bool `json:"configureLoadBalancing,omitempty"` + // TrafficManagerProfileID - ARM resource ID of the Traffic Manager profile to use, if it exists. Traffic Manager resource ID is of the form + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/trafficManagerProfiles/{profileName}. + TrafficManagerProfileID *string `json:"trafficManagerProfileId,omitempty"` + // TrafficManagerProfileName - Name of Traffic Manager profile to create. This is only needed if Traffic Manager profile does not already exist. + TrafficManagerProfileName *string `json:"trafficManagerProfileName,omitempty"` +} + +// MarshalJSON is the custom marshaler for CloningInfo. +func (ci CloningInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ci.CorrelationID != nil { + objectMap["correlationId"] = ci.CorrelationID + } + if ci.Overwrite != nil { + objectMap["overwrite"] = ci.Overwrite + } + if ci.CloneCustomHostNames != nil { + objectMap["cloneCustomHostNames"] = ci.CloneCustomHostNames + } + if ci.CloneSourceControl != nil { + objectMap["cloneSourceControl"] = ci.CloneSourceControl + } + if ci.SourceWebAppID != nil { + objectMap["sourceWebAppId"] = ci.SourceWebAppID + } + if ci.SourceWebAppLocation != nil { + objectMap["sourceWebAppLocation"] = ci.SourceWebAppLocation + } + if ci.HostingEnvironment != nil { + objectMap["hostingEnvironment"] = ci.HostingEnvironment + } + if ci.AppSettingsOverrides != nil { + objectMap["appSettingsOverrides"] = ci.AppSettingsOverrides + } + if ci.ConfigureLoadBalancing != nil { + objectMap["configureLoadBalancing"] = ci.ConfigureLoadBalancing + } + if ci.TrafficManagerProfileID != nil { + objectMap["trafficManagerProfileId"] = ci.TrafficManagerProfileID + } + if ci.TrafficManagerProfileName != nil { + objectMap["trafficManagerProfileName"] = ci.TrafficManagerProfileName + } + return json.Marshal(objectMap) +} + +// Configuration non versioned Container App configuration properties that define the mutable settings of a +// Container app +type Configuration struct { + // Secrets - Collection of secrets used by a Container app + Secrets *[]Secret `json:"secrets,omitempty"` + // ActiveRevisionsMode - ActiveRevisionsMode controls how active revisions are handled for the Container app: + // Multiple: multiple revisions can be active. If no value if provided, this is the defaultSingle: Only one revision can be active at a time. Revision weights can not be used in this mode. Possible values include: 'ActiveRevisionsModeMultiple', 'ActiveRevisionsModeSingle' + ActiveRevisionsMode ActiveRevisionsMode `json:"activeRevisionsMode,omitempty"` + // Ingress - Ingress configurations. + Ingress *Ingress `json:"ingress,omitempty"` + // Registries - Collection of private container registry credentials for containers used by the Container app + Registries *[]RegistryCredentials `json:"registries,omitempty"` +} + +// ConnectionStringDictionary string dictionary resource. +type ConnectionStringDictionary struct { + autorest.Response `json:"-"` + // Properties - Connection strings. + Properties map[string]*ConnStringValueTypePair `json:"properties"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ConnectionStringDictionary. +func (csd ConnectionStringDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csd.Properties != nil { + objectMap["properties"] = csd.Properties + } + if csd.Kind != nil { + objectMap["kind"] = csd.Kind + } + return json.Marshal(objectMap) +} + +// ConnStringInfo database connection string information. +type ConnStringInfo struct { + // Name - Name of connection string. + Name *string `json:"name,omitempty"` + // ConnectionString - Connection string value. + ConnectionString *string `json:"connectionString,omitempty"` + // Type - Type of database. Possible values include: 'ConnectionStringTypeMySQL', 'ConnectionStringTypeSQLServer', 'ConnectionStringTypeSQLAzure', 'ConnectionStringTypeCustom', 'ConnectionStringTypeNotificationHub', 'ConnectionStringTypeServiceBus', 'ConnectionStringTypeEventHub', 'ConnectionStringTypeAPIHub', 'ConnectionStringTypeDocDb', 'ConnectionStringTypeRedisCache', 'ConnectionStringTypePostgreSQL' + Type ConnectionStringType `json:"type,omitempty"` +} + +// ConnStringValueTypePair database connection string value to type pair. +type ConnStringValueTypePair struct { + // Value - Value of pair. + Value *string `json:"value,omitempty"` + // Type - Type of database. Possible values include: 'ConnectionStringTypeMySQL', 'ConnectionStringTypeSQLServer', 'ConnectionStringTypeSQLAzure', 'ConnectionStringTypeCustom', 'ConnectionStringTypeNotificationHub', 'ConnectionStringTypeServiceBus', 'ConnectionStringTypeEventHub', 'ConnectionStringTypeAPIHub', 'ConnectionStringTypeDocDb', 'ConnectionStringTypeRedisCache', 'ConnectionStringTypePostgreSQL' + Type ConnectionStringType `json:"type,omitempty"` +} + +// Contact contact information for domain registration. If 'Domain Privacy' option is not selected then the +// contact information is made publicly available through the Whois +// directories as per ICANN requirements. +type Contact struct { + // AddressMailing - Mailing address. + AddressMailing *Address `json:"addressMailing,omitempty"` + // Email - Email address. + Email *string `json:"email,omitempty"` + // Fax - Fax number. + Fax *string `json:"fax,omitempty"` + // JobTitle - Job title. + JobTitle *string `json:"jobTitle,omitempty"` + // NameFirst - First name. + NameFirst *string `json:"nameFirst,omitempty"` + // NameLast - Last name. + NameLast *string `json:"nameLast,omitempty"` + // NameMiddle - Middle name. + NameMiddle *string `json:"nameMiddle,omitempty"` + // Organization - Organization contact belongs to. + Organization *string `json:"organization,omitempty"` + // Phone - Phone number. + Phone *string `json:"phone,omitempty"` +} + +// Container container App container definition. +type Container struct { + // Image - Container image tag. + Image *string `json:"image,omitempty"` + // Name - Custom container name. + Name *string `json:"name,omitempty"` + // Command - Container start command. + Command *[]string `json:"command,omitempty"` + // Args - Container start command arguments. + Args *[]string `json:"args,omitempty"` + // Env - Container environment variables. + Env *[]EnvironmentVar `json:"env,omitempty"` + // Resources - Container resource requirements. + Resources *ContainerResources `json:"resources,omitempty"` +} + +// ContainerApp container App. +type ContainerApp struct { + autorest.Response `json:"-"` + // ContainerAppProperties - ContainerApp resource specific properties + *ContainerAppProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for ContainerApp. +func (ca ContainerApp) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ca.ContainerAppProperties != nil { + objectMap["properties"] = ca.ContainerAppProperties + } + if ca.Kind != nil { + objectMap["kind"] = ca.Kind + } + if ca.Location != nil { + objectMap["location"] = ca.Location + } + if ca.Tags != nil { + objectMap["tags"] = ca.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContainerApp struct. +func (ca *ContainerApp) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var containerAppProperties ContainerAppProperties + err = json.Unmarshal(*v, &containerAppProperties) + if err != nil { + return err + } + ca.ContainerAppProperties = &containerAppProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ca.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ca.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ca.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ca.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ca.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ca.Tags = tags + } + } + } + + return nil +} + +// ContainerAppCollection container App collection ARM resource. +type ContainerAppCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ContainerApp `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerAppCollection. +func (cac ContainerAppCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cac.Value != nil { + objectMap["value"] = cac.Value + } + return json.Marshal(objectMap) +} + +// ContainerAppCollectionIterator provides access to a complete listing of ContainerApp values. +type ContainerAppCollectionIterator struct { + i int + page ContainerAppCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ContainerAppCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ContainerAppCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ContainerAppCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ContainerAppCollectionIterator) Response() ContainerAppCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ContainerAppCollectionIterator) Value() ContainerApp { + if !iter.page.NotDone() { + return ContainerApp{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ContainerAppCollectionIterator type. +func NewContainerAppCollectionIterator(page ContainerAppCollectionPage) ContainerAppCollectionIterator { + return ContainerAppCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cac ContainerAppCollection) IsEmpty() bool { + return cac.Value == nil || len(*cac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cac ContainerAppCollection) hasNextLink() bool { + return cac.NextLink != nil && len(*cac.NextLink) != 0 +} + +// containerAppCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cac ContainerAppCollection) containerAppCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !cac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cac.NextLink))) +} + +// ContainerAppCollectionPage contains a page of ContainerApp values. +type ContainerAppCollectionPage struct { + fn func(context.Context, ContainerAppCollection) (ContainerAppCollection, error) + cac ContainerAppCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ContainerAppCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContainerAppCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cac) + if err != nil { + return err + } + page.cac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ContainerAppCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ContainerAppCollectionPage) NotDone() bool { + return !page.cac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ContainerAppCollectionPage) Response() ContainerAppCollection { + return page.cac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ContainerAppCollectionPage) Values() []ContainerApp { + if page.cac.IsEmpty() { + return nil + } + return *page.cac.Value +} + +// Creates a new instance of the ContainerAppCollectionPage type. +func NewContainerAppCollectionPage(cur ContainerAppCollection, getNextPage func(context.Context, ContainerAppCollection) (ContainerAppCollection, error)) ContainerAppCollectionPage { + return ContainerAppCollectionPage{ + fn: getNextPage, + cac: cur, + } +} + +// ContainerAppProperties containerApp resource specific properties +type ContainerAppProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the Container App. Possible values include: 'ContainerAppProvisioningStateInProgress', 'ContainerAppProvisioningStateSucceeded', 'ContainerAppProvisioningStateFailed', 'ContainerAppProvisioningStateCanceled' + ProvisioningState ContainerAppProvisioningState `json:"provisioningState,omitempty"` + // KubeEnvironmentID - Resource ID of the Container App's KubeEnvironment. + KubeEnvironmentID *string `json:"kubeEnvironmentId,omitempty"` + // LatestRevisionName - READ-ONLY; Name of the latest revision of the Container App. + LatestRevisionName *string `json:"latestRevisionName,omitempty"` + // LatestRevisionFqdn - READ-ONLY; Fully Qualified Domain Name of the latest revision of the Container App. + LatestRevisionFqdn *string `json:"latestRevisionFqdn,omitempty"` + // Configuration - Non versioned Container App configuration properties. + Configuration *Configuration `json:"configuration,omitempty"` + // Template - Container App versioned application definition. + Template *Template `json:"template,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerAppProperties. +func (ca ContainerAppProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ca.KubeEnvironmentID != nil { + objectMap["kubeEnvironmentId"] = ca.KubeEnvironmentID + } + if ca.Configuration != nil { + objectMap["configuration"] = ca.Configuration + } + if ca.Template != nil { + objectMap["template"] = ca.Template + } + return json.Marshal(objectMap) +} + +// ContainerAppsConfiguration ... +type ContainerAppsConfiguration struct { + // DaprAIInstrumentationKey - Azure Monitor instrumentation key used by Dapr to export Service to Service communication telemetry + DaprAIInstrumentationKey *string `json:"daprAIInstrumentationKey,omitempty"` + // PlatformReservedCidr - IP range in CIDR notation that can be reserved for environment infrastructure IP addresses. It must not overlap with any other Subnet IP ranges. + PlatformReservedCidr *string `json:"platformReservedCidr,omitempty"` + // PlatformReservedDNSIP - An IP address from the IP range defined by platformReservedCidr that will be reserved for the internal DNS server + PlatformReservedDNSIP *string `json:"platformReservedDnsIP,omitempty"` + // ControlPlaneSubnetResourceID - Resource ID of a subnet for control plane infrastructure components. This subnet must be in the same VNET as the subnet defined in appSubnetResourceId. Must not overlap with the IP range defined in platformReservedCidr, if defined. + ControlPlaneSubnetResourceID *string `json:"controlPlaneSubnetResourceId,omitempty"` + // AppSubnetResourceID - Resource ID of a subnet for control plane infrastructure components. This subnet must be in the same VNET as the subnet defined in appSubnetResourceId. Must not overlap with the IP range defined in platformReservedCidr, if defined. + AppSubnetResourceID *string `json:"appSubnetResourceId,omitempty"` + // DockerBridgeCidr - CIDR notation IP range assigned to the Docker bridge network. It must not overlap with any Subnet IP ranges or the IP range defined in platformReservedCidr, if defined. + DockerBridgeCidr *string `json:"dockerBridgeCidr,omitempty"` +} + +// ContainerAppsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type ContainerAppsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerAppsClient) (ContainerApp, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerAppsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ContainerAppsCreateOrUpdateFuture.Result. +func (future *ContainerAppsCreateOrUpdateFuture) result(client ContainerAppsClient) (ca ContainerApp, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ca.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.ContainerAppsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ca.Response.Response, err = future.GetResult(sender); err == nil && ca.Response.Response.StatusCode != http.StatusNoContent { + ca, err = client.CreateOrUpdateResponder(ca.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsCreateOrUpdateFuture", "Result", ca.Response.Response, "Failure responding to request") + } + } + return +} + +// ContainerAppsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ContainerAppsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ContainerAppsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ContainerAppsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ContainerAppsDeleteFuture.Result. +func (future *ContainerAppsDeleteFuture) result(client ContainerAppsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ContainerAppsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.ContainerAppsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ContainerAppSecret container App Secret. +type ContainerAppSecret struct { + // Name - READ-ONLY; Secret Name. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; Secret Value. + Value *string `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContainerAppSecret. +func (cas ContainerAppSecret) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ContainerCPUStatistics ... +type ContainerCPUStatistics struct { + CPUUsage *ContainerCPUUsage `json:"cpuUsage,omitempty"` + SystemCPUUsage *int64 `json:"systemCpuUsage,omitempty"` + OnlineCPUCount *int32 `json:"onlineCpuCount,omitempty"` + ThrottlingData *ContainerThrottlingData `json:"throttlingData,omitempty"` +} + +// ContainerCPUUsage ... +type ContainerCPUUsage struct { + TotalUsage *int64 `json:"totalUsage,omitempty"` + PerCPUUsage *[]int64 `json:"perCpuUsage,omitempty"` + KernelModeUsage *int64 `json:"kernelModeUsage,omitempty"` + UserModeUsage *int64 `json:"userModeUsage,omitempty"` +} + +// ContainerInfo ... +type ContainerInfo struct { + CurrentTimeStamp *date.Time `json:"currentTimeStamp,omitempty"` + PreviousTimeStamp *date.Time `json:"previousTimeStamp,omitempty"` + CurrentCPUStats *ContainerCPUStatistics `json:"currentCpuStats,omitempty"` + PreviousCPUStats *ContainerCPUStatistics `json:"previousCpuStats,omitempty"` + MemoryStats *ContainerMemoryStatistics `json:"memoryStats,omitempty"` + Name *string `json:"name,omitempty"` + ID *string `json:"id,omitempty"` + Eth0 *ContainerNetworkInterfaceStatistics `json:"eth0,omitempty"` +} + +// ContainerMemoryStatistics ... +type ContainerMemoryStatistics struct { + Usage *int64 `json:"usage,omitempty"` + MaxUsage *int64 `json:"maxUsage,omitempty"` + Limit *int64 `json:"limit,omitempty"` +} + +// ContainerNetworkInterfaceStatistics ... +type ContainerNetworkInterfaceStatistics struct { + RxBytes *int64 `json:"rxBytes,omitempty"` + RxPackets *int64 `json:"rxPackets,omitempty"` + RxErrors *int64 `json:"rxErrors,omitempty"` + RxDropped *int64 `json:"rxDropped,omitempty"` + TxBytes *int64 `json:"txBytes,omitempty"` + TxPackets *int64 `json:"txPackets,omitempty"` + TxErrors *int64 `json:"txErrors,omitempty"` + TxDropped *int64 `json:"txDropped,omitempty"` +} + +// ContainerResources container App container resource requirements. +type ContainerResources struct { + // CPU - Required CPU in cores, e.g. 0.5 + CPU *float64 `json:"cpu,omitempty"` + // Memory - Required memory, e.g. "250Mb" + Memory *string `json:"memory,omitempty"` +} + +// ContainerThrottlingData ... +type ContainerThrottlingData struct { + Periods *int32 `json:"periods,omitempty"` + ThrottledPeriods *int32 `json:"throttledPeriods,omitempty"` + ThrottledTime *int32 `json:"throttledTime,omitempty"` +} + +// ContinuousWebJob continuous Web Job Information. +type ContinuousWebJob struct { + autorest.Response `json:"-"` + // ContinuousWebJobProperties - ContinuousWebJob resource specific properties + *ContinuousWebJobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContinuousWebJob. +func (cwj ContinuousWebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cwj.ContinuousWebJobProperties != nil { + objectMap["properties"] = cwj.ContinuousWebJobProperties + } + if cwj.Kind != nil { + objectMap["kind"] = cwj.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ContinuousWebJob struct. +func (cwj *ContinuousWebJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var continuousWebJobProperties ContinuousWebJobProperties + err = json.Unmarshal(*v, &continuousWebJobProperties) + if err != nil { + return err + } + cwj.ContinuousWebJobProperties = &continuousWebJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cwj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cwj.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cwj.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cwj.Type = &typeVar + } + } + } + + return nil +} + +// ContinuousWebJobCollection collection of Kudu continuous web job information elements. +type ContinuousWebJobCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ContinuousWebJob `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ContinuousWebJobCollection. +func (cwjc ContinuousWebJobCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cwjc.Value != nil { + objectMap["value"] = cwjc.Value + } + return json.Marshal(objectMap) +} + +// ContinuousWebJobCollectionIterator provides access to a complete listing of ContinuousWebJob values. +type ContinuousWebJobCollectionIterator struct { + i int + page ContinuousWebJobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ContinuousWebJobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContinuousWebJobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ContinuousWebJobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ContinuousWebJobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ContinuousWebJobCollectionIterator) Response() ContinuousWebJobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ContinuousWebJobCollectionIterator) Value() ContinuousWebJob { + if !iter.page.NotDone() { + return ContinuousWebJob{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ContinuousWebJobCollectionIterator type. +func NewContinuousWebJobCollectionIterator(page ContinuousWebJobCollectionPage) ContinuousWebJobCollectionIterator { + return ContinuousWebJobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cwjc ContinuousWebJobCollection) IsEmpty() bool { + return cwjc.Value == nil || len(*cwjc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cwjc ContinuousWebJobCollection) hasNextLink() bool { + return cwjc.NextLink != nil && len(*cwjc.NextLink) != 0 +} + +// continuousWebJobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cwjc ContinuousWebJobCollection) continuousWebJobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !cwjc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cwjc.NextLink))) +} + +// ContinuousWebJobCollectionPage contains a page of ContinuousWebJob values. +type ContinuousWebJobCollectionPage struct { + fn func(context.Context, ContinuousWebJobCollection) (ContinuousWebJobCollection, error) + cwjc ContinuousWebJobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ContinuousWebJobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ContinuousWebJobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cwjc) + if err != nil { + return err + } + page.cwjc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ContinuousWebJobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ContinuousWebJobCollectionPage) NotDone() bool { + return !page.cwjc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ContinuousWebJobCollectionPage) Response() ContinuousWebJobCollection { + return page.cwjc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ContinuousWebJobCollectionPage) Values() []ContinuousWebJob { + if page.cwjc.IsEmpty() { + return nil + } + return *page.cwjc.Value +} + +// Creates a new instance of the ContinuousWebJobCollectionPage type. +func NewContinuousWebJobCollectionPage(cur ContinuousWebJobCollection, getNextPage func(context.Context, ContinuousWebJobCollection) (ContinuousWebJobCollection, error)) ContinuousWebJobCollectionPage { + return ContinuousWebJobCollectionPage{ + fn: getNextPage, + cwjc: cur, + } +} + +// ContinuousWebJobProperties continuousWebJob resource specific properties +type ContinuousWebJobProperties struct { + // Status - Job status. Possible values include: 'ContinuousWebJobStatusInitializing', 'ContinuousWebJobStatusStarting', 'ContinuousWebJobStatusRunning', 'ContinuousWebJobStatusPendingRestart', 'ContinuousWebJobStatusStopped' + Status ContinuousWebJobStatus `json:"status,omitempty"` + // DetailedStatus - Detailed status. + DetailedStatus *string `json:"detailed_status,omitempty"` + // LogURL - Log URL. + LogURL *string `json:"log_url,omitempty"` + // RunCommand - Run command. + RunCommand *string `json:"run_command,omitempty"` + // URL - Job URL. + URL *string `json:"url,omitempty"` + // ExtraInfoURL - Extra Info URL. + ExtraInfoURL *string `json:"extra_info_url,omitempty"` + // WebJobType - Job type. Possible values include: 'JobTypeContinuous', 'JobTypeTriggered' + WebJobType JobType `json:"web_job_type,omitempty"` + // Error - Error information. + Error *string `json:"error,omitempty"` + // UsingSdk - Using SDK? + UsingSdk *bool `json:"using_sdk,omitempty"` + // Settings - Job settings. + Settings map[string]interface{} `json:"settings"` +} + +// MarshalJSON is the custom marshaler for ContinuousWebJobProperties. +func (cwj ContinuousWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cwj.Status != "" { + objectMap["status"] = cwj.Status + } + if cwj.DetailedStatus != nil { + objectMap["detailed_status"] = cwj.DetailedStatus + } + if cwj.LogURL != nil { + objectMap["log_url"] = cwj.LogURL + } + if cwj.RunCommand != nil { + objectMap["run_command"] = cwj.RunCommand + } + if cwj.URL != nil { + objectMap["url"] = cwj.URL + } + if cwj.ExtraInfoURL != nil { + objectMap["extra_info_url"] = cwj.ExtraInfoURL + } + if cwj.WebJobType != "" { + objectMap["web_job_type"] = cwj.WebJobType + } + if cwj.Error != nil { + objectMap["error"] = cwj.Error + } + if cwj.UsingSdk != nil { + objectMap["using_sdk"] = cwj.UsingSdk + } + if cwj.Settings != nil { + objectMap["settings"] = cwj.Settings + } + return json.Marshal(objectMap) +} + +// CookieExpiration the configuration settings of the session cookie's expiration. +type CookieExpiration struct { + // Convention - The convention used when determining the session cookie's expiration. Possible values include: 'CookieExpirationConventionFixedTime', 'CookieExpirationConventionIdentityProviderDerived' + Convention CookieExpirationConvention `json:"convention,omitempty"` + // TimeToExpiration - The time after the request is made when the session cookie should expire. + TimeToExpiration *string `json:"timeToExpiration,omitempty"` +} + +// CorsSettings cross-Origin Resource Sharing (CORS) settings for the app. +type CorsSettings struct { + // AllowedOrigins - Gets or sets the list of origins that should be allowed to make cross-origin + // calls (for example: http://example.com:12345). Use "*" to allow all. + AllowedOrigins *[]string `json:"allowedOrigins,omitempty"` + // SupportCredentials - Gets or sets whether CORS requests with credentials are allowed. See + // https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Requests_with_credentials + // for more details. + SupportCredentials *bool `json:"supportCredentials,omitempty"` +} + +// CsmMoveResourceEnvelope object with a list of the resources that need to be moved and the resource group +// they should be moved to. +type CsmMoveResourceEnvelope struct { + TargetResourceGroup *string `json:"targetResourceGroup,omitempty"` + Resources *[]string `json:"resources,omitempty"` +} + +// CsmOperationCollection collection of Azure resource manager operation metadata. +type CsmOperationCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]CsmOperationDescription `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for CsmOperationCollection. +func (coc CsmOperationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if coc.Value != nil { + objectMap["value"] = coc.Value + } + return json.Marshal(objectMap) +} + +// CsmOperationCollectionIterator provides access to a complete listing of CsmOperationDescription values. +type CsmOperationCollectionIterator struct { + i int + page CsmOperationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CsmOperationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CsmOperationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CsmOperationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CsmOperationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CsmOperationCollectionIterator) Response() CsmOperationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CsmOperationCollectionIterator) Value() CsmOperationDescription { + if !iter.page.NotDone() { + return CsmOperationDescription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CsmOperationCollectionIterator type. +func NewCsmOperationCollectionIterator(page CsmOperationCollectionPage) CsmOperationCollectionIterator { + return CsmOperationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (coc CsmOperationCollection) IsEmpty() bool { + return coc.Value == nil || len(*coc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (coc CsmOperationCollection) hasNextLink() bool { + return coc.NextLink != nil && len(*coc.NextLink) != 0 +} + +// csmOperationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (coc CsmOperationCollection) csmOperationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !coc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(coc.NextLink))) +} + +// CsmOperationCollectionPage contains a page of CsmOperationDescription values. +type CsmOperationCollectionPage struct { + fn func(context.Context, CsmOperationCollection) (CsmOperationCollection, error) + coc CsmOperationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CsmOperationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CsmOperationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.coc) + if err != nil { + return err + } + page.coc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CsmOperationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CsmOperationCollectionPage) NotDone() bool { + return !page.coc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CsmOperationCollectionPage) Response() CsmOperationCollection { + return page.coc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CsmOperationCollectionPage) Values() []CsmOperationDescription { + if page.coc.IsEmpty() { + return nil + } + return *page.coc.Value +} + +// Creates a new instance of the CsmOperationCollectionPage type. +func NewCsmOperationCollectionPage(cur CsmOperationCollection, getNextPage func(context.Context, CsmOperationCollection) (CsmOperationCollection, error)) CsmOperationCollectionPage { + return CsmOperationCollectionPage{ + fn: getNextPage, + coc: cur, + } +} + +// CsmOperationDescription description of an operation available for Microsoft.Web resource provider. +type CsmOperationDescription struct { + Name *string `json:"name,omitempty"` + IsDataAction *bool `json:"isDataAction,omitempty"` + Display *CsmOperationDisplay `json:"display,omitempty"` + Origin *string `json:"origin,omitempty"` + Properties *CsmOperationDescriptionProperties `json:"properties,omitempty"` +} + +// CsmOperationDescriptionProperties properties available for a Microsoft.Web resource provider operation. +type CsmOperationDescriptionProperties struct { + ServiceSpecification *ServiceSpecification `json:"serviceSpecification,omitempty"` +} + +// CsmOperationDisplay meta data about operation used for display in portal. +type CsmOperationDisplay struct { + Provider *string `json:"provider,omitempty"` + Resource *string `json:"resource,omitempty"` + Operation *string `json:"operation,omitempty"` + Description *string `json:"description,omitempty"` +} + +// CsmPublishingCredentialsPoliciesEntity publishing Credentials Policies parameters. +type CsmPublishingCredentialsPoliciesEntity struct { + autorest.Response `json:"-"` + // CsmPublishingCredentialsPoliciesEntityProperties - CsmPublishingCredentialsPoliciesEntity resource specific properties + *CsmPublishingCredentialsPoliciesEntityProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CsmPublishingCredentialsPoliciesEntity. +func (cpcpe CsmPublishingCredentialsPoliciesEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cpcpe.CsmPublishingCredentialsPoliciesEntityProperties != nil { + objectMap["properties"] = cpcpe.CsmPublishingCredentialsPoliciesEntityProperties + } + if cpcpe.Kind != nil { + objectMap["kind"] = cpcpe.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CsmPublishingCredentialsPoliciesEntity struct. +func (cpcpe *CsmPublishingCredentialsPoliciesEntity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var csmPublishingCredentialsPoliciesEntityProperties CsmPublishingCredentialsPoliciesEntityProperties + err = json.Unmarshal(*v, &csmPublishingCredentialsPoliciesEntityProperties) + if err != nil { + return err + } + cpcpe.CsmPublishingCredentialsPoliciesEntityProperties = &csmPublishingCredentialsPoliciesEntityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + cpcpe.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + cpcpe.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + cpcpe.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + cpcpe.Type = &typeVar + } + } + } + + return nil +} + +// CsmPublishingCredentialsPoliciesEntityProperties csmPublishingCredentialsPoliciesEntity resource +// specific properties +type CsmPublishingCredentialsPoliciesEntityProperties struct { + // Allow - true to allow access to a publishing method; otherwise, false. + Allow *bool `json:"allow,omitempty"` +} + +// CsmPublishingProfileOptions publishing options for requested profile. +type CsmPublishingProfileOptions struct { + // Format - Name of the format. Valid values are: + // FileZilla3 + // WebDeploy -- default + // Ftp. Possible values include: 'PublishingProfileFormatFileZilla3', 'PublishingProfileFormatWebDeploy', 'PublishingProfileFormatFtp' + Format PublishingProfileFormat `json:"format,omitempty"` + // IncludeDisasterRecoveryEndpoints - Include the DisasterRecover endpoint if true + IncludeDisasterRecoveryEndpoints *bool `json:"includeDisasterRecoveryEndpoints,omitempty"` +} + +// CsmSlotEntity deployment slot parameters. +type CsmSlotEntity struct { + // TargetSlot - Destination deployment slot during swap operation. + TargetSlot *string `json:"targetSlot,omitempty"` + // PreserveVnet - true to preserve Virtual Network to the slot during swap; otherwise, false. + PreserveVnet *bool `json:"preserveVnet,omitempty"` +} + +// CsmUsageQuota usage of the quota resource. +type CsmUsageQuota struct { + // Unit - Units of measurement for the quota resource. + Unit *string `json:"unit,omitempty"` + // NextResetTime - Next reset time for the resource counter. + NextResetTime *date.Time `json:"nextResetTime,omitempty"` + // CurrentValue - The current value of the resource counter. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - The resource limit. + Limit *int64 `json:"limit,omitempty"` + // Name - Quota name. + Name *LocalizableString `json:"name,omitempty"` +} + +// CsmUsageQuotaCollection collection of CSM usage quotas. +type CsmUsageQuotaCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]CsmUsageQuota `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for CsmUsageQuotaCollection. +func (cuqc CsmUsageQuotaCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cuqc.Value != nil { + objectMap["value"] = cuqc.Value + } + return json.Marshal(objectMap) +} + +// CsmUsageQuotaCollectionIterator provides access to a complete listing of CsmUsageQuota values. +type CsmUsageQuotaCollectionIterator struct { + i int + page CsmUsageQuotaCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CsmUsageQuotaCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CsmUsageQuotaCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CsmUsageQuotaCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CsmUsageQuotaCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CsmUsageQuotaCollectionIterator) Response() CsmUsageQuotaCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CsmUsageQuotaCollectionIterator) Value() CsmUsageQuota { + if !iter.page.NotDone() { + return CsmUsageQuota{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CsmUsageQuotaCollectionIterator type. +func NewCsmUsageQuotaCollectionIterator(page CsmUsageQuotaCollectionPage) CsmUsageQuotaCollectionIterator { + return CsmUsageQuotaCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (cuqc CsmUsageQuotaCollection) IsEmpty() bool { + return cuqc.Value == nil || len(*cuqc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (cuqc CsmUsageQuotaCollection) hasNextLink() bool { + return cuqc.NextLink != nil && len(*cuqc.NextLink) != 0 +} + +// csmUsageQuotaCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (cuqc CsmUsageQuotaCollection) csmUsageQuotaCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !cuqc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(cuqc.NextLink))) +} + +// CsmUsageQuotaCollectionPage contains a page of CsmUsageQuota values. +type CsmUsageQuotaCollectionPage struct { + fn func(context.Context, CsmUsageQuotaCollection) (CsmUsageQuotaCollection, error) + cuqc CsmUsageQuotaCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CsmUsageQuotaCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CsmUsageQuotaCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.cuqc) + if err != nil { + return err + } + page.cuqc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CsmUsageQuotaCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CsmUsageQuotaCollectionPage) NotDone() bool { + return !page.cuqc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CsmUsageQuotaCollectionPage) Response() CsmUsageQuotaCollection { + return page.cuqc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CsmUsageQuotaCollectionPage) Values() []CsmUsageQuota { + if page.cuqc.IsEmpty() { + return nil + } + return *page.cuqc.Value +} + +// Creates a new instance of the CsmUsageQuotaCollectionPage type. +func NewCsmUsageQuotaCollectionPage(cur CsmUsageQuotaCollection, getNextPage func(context.Context, CsmUsageQuotaCollection) (CsmUsageQuotaCollection, error)) CsmUsageQuotaCollectionPage { + return CsmUsageQuotaCollectionPage{ + fn: getNextPage, + cuqc: cur, + } +} + +// CustomHostnameAnalysisResult custom domain analysis. +type CustomHostnameAnalysisResult struct { + autorest.Response `json:"-"` + // CustomHostnameAnalysisResultProperties - CustomHostnameAnalysisResult resource specific properties + *CustomHostnameAnalysisResultProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomHostnameAnalysisResult. +func (char CustomHostnameAnalysisResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if char.CustomHostnameAnalysisResultProperties != nil { + objectMap["properties"] = char.CustomHostnameAnalysisResultProperties + } + if char.Kind != nil { + objectMap["kind"] = char.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomHostnameAnalysisResult struct. +func (char *CustomHostnameAnalysisResult) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var customHostnameAnalysisResultProperties CustomHostnameAnalysisResultProperties + err = json.Unmarshal(*v, &customHostnameAnalysisResultProperties) + if err != nil { + return err + } + char.CustomHostnameAnalysisResultProperties = &customHostnameAnalysisResultProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + char.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + char.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + char.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + char.Type = &typeVar + } + } + } + + return nil +} + +// CustomHostnameAnalysisResultProperties customHostnameAnalysisResult resource specific properties +type CustomHostnameAnalysisResultProperties struct { + // IsHostnameAlreadyVerified - READ-ONLY; true if hostname is already verified; otherwise, false. + IsHostnameAlreadyVerified *bool `json:"isHostnameAlreadyVerified,omitempty"` + // CustomDomainVerificationTest - READ-ONLY; DNS verification test result. Possible values include: 'DNSVerificationTestResultPassed', 'DNSVerificationTestResultFailed', 'DNSVerificationTestResultSkipped' + CustomDomainVerificationTest DNSVerificationTestResult `json:"customDomainVerificationTest,omitempty"` + // CustomDomainVerificationFailureInfo - READ-ONLY; Raw failure information if DNS verification fails. + CustomDomainVerificationFailureInfo *ErrorEntity `json:"customDomainVerificationFailureInfo,omitempty"` + // HasConflictOnScaleUnit - READ-ONLY; true if there is a conflict on a scale unit; otherwise, false. + HasConflictOnScaleUnit *bool `json:"hasConflictOnScaleUnit,omitempty"` + // HasConflictAcrossSubscription - READ-ONLY; true if there is a conflict across subscriptions; otherwise, false. + HasConflictAcrossSubscription *bool `json:"hasConflictAcrossSubscription,omitempty"` + // ConflictingAppResourceID - READ-ONLY; Name of the conflicting app on scale unit if it's within the same subscription. + ConflictingAppResourceID *string `json:"conflictingAppResourceId,omitempty"` + // CNameRecords - CName records controller can see for this hostname. + CNameRecords *[]string `json:"cNameRecords,omitempty"` + // TxtRecords - TXT records controller can see for this hostname. + TxtRecords *[]string `json:"txtRecords,omitempty"` + // ARecords - A records controller can see for this hostname. + ARecords *[]string `json:"aRecords,omitempty"` + // AlternateCNameRecords - Alternate CName records controller can see for this hostname. + AlternateCNameRecords *[]string `json:"alternateCNameRecords,omitempty"` + // AlternateTxtRecords - Alternate TXT records controller can see for this hostname. + AlternateTxtRecords *[]string `json:"alternateTxtRecords,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomHostnameAnalysisResultProperties. +func (char CustomHostnameAnalysisResultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if char.CNameRecords != nil { + objectMap["cNameRecords"] = char.CNameRecords + } + if char.TxtRecords != nil { + objectMap["txtRecords"] = char.TxtRecords + } + if char.ARecords != nil { + objectMap["aRecords"] = char.ARecords + } + if char.AlternateCNameRecords != nil { + objectMap["alternateCNameRecords"] = char.AlternateCNameRecords + } + if char.AlternateTxtRecords != nil { + objectMap["alternateTxtRecords"] = char.AlternateTxtRecords + } + return json.Marshal(objectMap) +} + +// CustomHostnameSites a hostname and its assigned sites +type CustomHostnameSites struct { + // CustomHostnameSitesProperties - CustomHostnameSites resource specific properties + *CustomHostnameSitesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomHostnameSites. +func (chs CustomHostnameSites) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if chs.CustomHostnameSitesProperties != nil { + objectMap["properties"] = chs.CustomHostnameSitesProperties + } + if chs.Kind != nil { + objectMap["kind"] = chs.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for CustomHostnameSites struct. +func (chs *CustomHostnameSites) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var customHostnameSitesProperties CustomHostnameSitesProperties + err = json.Unmarshal(*v, &customHostnameSitesProperties) + if err != nil { + return err + } + chs.CustomHostnameSitesProperties = &customHostnameSitesProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + chs.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + chs.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + chs.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + chs.Type = &typeVar + } + } + } + + return nil +} + +// CustomHostnameSitesCollection collection of custom hostname sites +type CustomHostnameSitesCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]CustomHostnameSites `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomHostnameSitesCollection. +func (chsc CustomHostnameSitesCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if chsc.Value != nil { + objectMap["value"] = chsc.Value + } + return json.Marshal(objectMap) +} + +// CustomHostnameSitesCollectionIterator provides access to a complete listing of CustomHostnameSites +// values. +type CustomHostnameSitesCollectionIterator struct { + i int + page CustomHostnameSitesCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *CustomHostnameSitesCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomHostnameSitesCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *CustomHostnameSitesCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter CustomHostnameSitesCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter CustomHostnameSitesCollectionIterator) Response() CustomHostnameSitesCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter CustomHostnameSitesCollectionIterator) Value() CustomHostnameSites { + if !iter.page.NotDone() { + return CustomHostnameSites{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the CustomHostnameSitesCollectionIterator type. +func NewCustomHostnameSitesCollectionIterator(page CustomHostnameSitesCollectionPage) CustomHostnameSitesCollectionIterator { + return CustomHostnameSitesCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (chsc CustomHostnameSitesCollection) IsEmpty() bool { + return chsc.Value == nil || len(*chsc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (chsc CustomHostnameSitesCollection) hasNextLink() bool { + return chsc.NextLink != nil && len(*chsc.NextLink) != 0 +} + +// customHostnameSitesCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (chsc CustomHostnameSitesCollection) customHostnameSitesCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !chsc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(chsc.NextLink))) +} + +// CustomHostnameSitesCollectionPage contains a page of CustomHostnameSites values. +type CustomHostnameSitesCollectionPage struct { + fn func(context.Context, CustomHostnameSitesCollection) (CustomHostnameSitesCollection, error) + chsc CustomHostnameSitesCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *CustomHostnameSitesCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CustomHostnameSitesCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.chsc) + if err != nil { + return err + } + page.chsc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *CustomHostnameSitesCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page CustomHostnameSitesCollectionPage) NotDone() bool { + return !page.chsc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page CustomHostnameSitesCollectionPage) Response() CustomHostnameSitesCollection { + return page.chsc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page CustomHostnameSitesCollectionPage) Values() []CustomHostnameSites { + if page.chsc.IsEmpty() { + return nil + } + return *page.chsc.Value +} + +// Creates a new instance of the CustomHostnameSitesCollectionPage type. +func NewCustomHostnameSitesCollectionPage(cur CustomHostnameSitesCollection, getNextPage func(context.Context, CustomHostnameSitesCollection) (CustomHostnameSitesCollection, error)) CustomHostnameSitesCollectionPage { + return CustomHostnameSitesCollectionPage{ + fn: getNextPage, + chsc: cur, + } +} + +// CustomHostnameSitesProperties customHostnameSites resource specific properties +type CustomHostnameSitesProperties struct { + CustomHostname *string `json:"customHostname,omitempty"` + Region *string `json:"region,omitempty"` + SiteResourceIds *[]Identifier `json:"siteResourceIds,omitempty"` +} + +// CustomOpenIDConnectProvider the configuration settings of the custom Open ID Connect provider. +type CustomOpenIDConnectProvider struct { + // Enabled - false if the custom Open ID provider provider should not be enabled; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the app registration for the custom Open ID Connect provider. + Registration *OpenIDConnectRegistration `json:"registration,omitempty"` + // Login - The configuration settings of the login flow of the custom Open ID Connect provider. + Login *OpenIDConnectLogin `json:"login,omitempty"` +} + +// CustomScaleRule container App container Custom scaling rule. +type CustomScaleRule struct { + // Type - Type of the custom scale rule + // eg: azure-servicebus, redis etc. + Type *string `json:"type,omitempty"` + // Metadata - Metadata properties to describe custom scale rule. + Metadata map[string]*string `json:"metadata"` + // Auth - Authentication secrets for the custom scale rule. + Auth *[]ScaleRuleAuth `json:"auth,omitempty"` +} + +// MarshalJSON is the custom marshaler for CustomScaleRule. +func (csr CustomScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if csr.Type != nil { + objectMap["type"] = csr.Type + } + if csr.Metadata != nil { + objectMap["metadata"] = csr.Metadata + } + if csr.Auth != nil { + objectMap["auth"] = csr.Auth + } + return json.Marshal(objectMap) +} + +// Dapr container App Dapr configuration. +type Dapr struct { + // Enabled - Boolean indicating if the Dapr side car is enabled + Enabled *bool `json:"enabled,omitempty"` + // AppID - Dapr application identifier + AppID *string `json:"appId,omitempty"` + // AppPort - Port on which the Dapr side car + AppPort *int32 `json:"appPort,omitempty"` + // Components - Collection of Dapr components + Components *[]DaprComponent `json:"components,omitempty"` +} + +// DaprComponent dapr component configuration +type DaprComponent struct { + // Name - Component name + Name *string `json:"name,omitempty"` + // Type - Component type + Type *string `json:"type,omitempty"` + // Version - Component version + Version *string `json:"version,omitempty"` + // Metadata - Component metadata + Metadata *[]DaprMetadata `json:"metadata,omitempty"` +} + +// DaprMetadata container App Dapr component metadata. +type DaprMetadata struct { + // Name - Metadata property name. + Name *string `json:"name,omitempty"` + // Value - Metadata property value. + Value *string `json:"value,omitempty"` + // SecretRef - Name of the Container App secret from which to pull the metadata property value. + SecretRef *string `json:"secretRef,omitempty"` +} + +// DatabaseBackupSetting database backup settings. +type DatabaseBackupSetting struct { + // DatabaseType - Database type (e.g. SqlAzure / MySql). Possible values include: 'DatabaseTypeSQLAzure', 'DatabaseTypeMySQL', 'DatabaseTypeLocalMySQL', 'DatabaseTypePostgreSQL' + DatabaseType DatabaseType `json:"databaseType,omitempty"` + Name *string `json:"name,omitempty"` + // ConnectionStringName - Contains a connection string name that is linked to the SiteConfig.ConnectionStrings. + // This is used during restore with overwrite connection strings options. + ConnectionStringName *string `json:"connectionStringName,omitempty"` + // ConnectionString - Contains a connection string to a database which is being backed up or restored. If the restore should happen to a new database, the database name inside is the new one. + ConnectionString *string `json:"connectionString,omitempty"` +} + +// DataProviderMetadata additional configuration for a data providers +type DataProviderMetadata struct { + ProviderName *string `json:"providerName,omitempty"` + // PropertyBag - READ-ONLY; Settings for the data provider + PropertyBag *[]KeyValuePairStringObject `json:"propertyBag,omitempty"` +} + +// MarshalJSON is the custom marshaler for DataProviderMetadata. +func (dpm DataProviderMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpm.ProviderName != nil { + objectMap["providerName"] = dpm.ProviderName + } + return json.Marshal(objectMap) +} + +// DataSource class representing data source used by the detectors +type DataSource struct { + // Instructions - Instructions if any for the data source + Instructions *[]string `json:"instructions,omitempty"` + // DataSourceURI - Datasource Uri Links + DataSourceURI *[]NameValuePair `json:"dataSourceUri,omitempty"` +} + +// DataTableResponseColumn column definition +type DataTableResponseColumn struct { + // ColumnName - Name of the column + ColumnName *string `json:"columnName,omitempty"` + // DataType - Data type which looks like 'String' or 'Int32'. + DataType *string `json:"dataType,omitempty"` + // ColumnType - Column Type + ColumnType *string `json:"columnType,omitempty"` +} + +// DataTableResponseObject data Table which defines columns and raw row values +type DataTableResponseObject struct { + // TableName - Name of the table + TableName *string `json:"tableName,omitempty"` + // Columns - List of columns with data types + Columns *[]DataTableResponseColumn `json:"columns,omitempty"` + // Rows - Raw row values + Rows *[][]string `json:"rows,omitempty"` +} + +// DefaultAuthorizationPolicy the configuration settings of the Azure Active Directory default +// authorization policy. +type DefaultAuthorizationPolicy struct { + // AllowedPrincipals - The configuration settings of the Azure Active Directory allowed principals. + AllowedPrincipals *AllowedPrincipals `json:"allowedPrincipals,omitempty"` + // AllowedApplications - The configuration settings of the Azure Active Directory allowed applications. + AllowedApplications *[]string `json:"allowedApplications,omitempty"` +} + +// DefaultErrorResponse app Service error response. +type DefaultErrorResponse struct { + // Error - READ-ONLY; Error model. + Error *DefaultErrorResponseError `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultErrorResponse. +func (der DefaultErrorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DefaultErrorResponseError error model. +type DefaultErrorResponseError struct { + // Code - READ-ONLY; Standardized string to programmatically identify the error. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Detailed error description and debugging information. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; Detailed error description and debugging information. + Target *string `json:"target,omitempty"` + Details *[]DefaultErrorResponseErrorDetailsItem `json:"details,omitempty"` + // Innererror - READ-ONLY; More information to debug error. + Innererror *string `json:"innererror,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultErrorResponseError. +func (der DefaultErrorResponseError) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if der.Details != nil { + objectMap["details"] = der.Details + } + return json.Marshal(objectMap) +} + +// DefaultErrorResponseErrorDetailsItem detailed errors. +type DefaultErrorResponseErrorDetailsItem struct { + // Code - READ-ONLY; Standardized string to programmatically identify the error. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; Detailed error description and debugging information. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; Detailed error description and debugging information. + Target *string `json:"target,omitempty"` +} + +// MarshalJSON is the custom marshaler for DefaultErrorResponseErrorDetailsItem. +func (derI DefaultErrorResponseErrorDetailsItem) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DeletedAppRestoreRequest details about restoring a deleted app. +type DeletedAppRestoreRequest struct { + // DeletedAppRestoreRequestProperties - DeletedAppRestoreRequest resource specific properties + *DeletedAppRestoreRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedAppRestoreRequest. +func (darr DeletedAppRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if darr.DeletedAppRestoreRequestProperties != nil { + objectMap["properties"] = darr.DeletedAppRestoreRequestProperties + } + if darr.Kind != nil { + objectMap["kind"] = darr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeletedAppRestoreRequest struct. +func (darr *DeletedAppRestoreRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deletedAppRestoreRequestProperties DeletedAppRestoreRequestProperties + err = json.Unmarshal(*v, &deletedAppRestoreRequestProperties) + if err != nil { + return err + } + darr.DeletedAppRestoreRequestProperties = &deletedAppRestoreRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + darr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + darr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + darr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + darr.Type = &typeVar + } + } + } + + return nil +} + +// DeletedAppRestoreRequestProperties deletedAppRestoreRequest resource specific properties +type DeletedAppRestoreRequestProperties struct { + // DeletedSiteID - ARM resource ID of the deleted app. Example: + // /subscriptions/{subId}/providers/Microsoft.Web/deletedSites/{deletedSiteId} + DeletedSiteID *string `json:"deletedSiteId,omitempty"` + // RecoverConfiguration - If true, deleted site configuration, in addition to content, will be restored. + RecoverConfiguration *bool `json:"recoverConfiguration,omitempty"` + // SnapshotTime - Point in time to restore the deleted app from, formatted as a DateTime string. + // If unspecified, default value is the time that the app was deleted. + SnapshotTime *string `json:"snapshotTime,omitempty"` + // UseDRSecondary - If true, the snapshot is retrieved from DRSecondary endpoint. + UseDRSecondary *bool `json:"useDRSecondary,omitempty"` +} + +// DeletedSite a deleted app. +type DeletedSite struct { + autorest.Response `json:"-"` + // DeletedSiteProperties - DeletedSite resource specific properties + *DeletedSiteProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedSite. +func (ds DeletedSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ds.DeletedSiteProperties != nil { + objectMap["properties"] = ds.DeletedSiteProperties + } + if ds.Kind != nil { + objectMap["kind"] = ds.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DeletedSite struct. +func (ds *DeletedSite) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deletedSiteProperties DeletedSiteProperties + err = json.Unmarshal(*v, &deletedSiteProperties) + if err != nil { + return err + } + ds.DeletedSiteProperties = &deletedSiteProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ds.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ds.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ds.Type = &typeVar + } + } + } + + return nil +} + +// DeletedSiteProperties deletedSite resource specific properties +type DeletedSiteProperties struct { + // DeletedSiteID - READ-ONLY; Numeric id for the deleted site + DeletedSiteID *int32 `json:"deletedSiteId,omitempty"` + // DeletedTimestamp - READ-ONLY; Time in UTC when the app was deleted. + DeletedTimestamp *string `json:"deletedTimestamp,omitempty"` + // Subscription - READ-ONLY; Subscription containing the deleted site + Subscription *string `json:"subscription,omitempty"` + // ResourceGroup - READ-ONLY; ResourceGroup that contained the deleted site + ResourceGroup *string `json:"resourceGroup,omitempty"` + // DeletedSiteName - READ-ONLY; Name of the deleted site + DeletedSiteName *string `json:"deletedSiteName,omitempty"` + // Slot - READ-ONLY; Slot of the deleted site + Slot *string `json:"slot,omitempty"` + // Kind - READ-ONLY; Kind of site that was deleted + Kind *string `json:"kind,omitempty"` + // GeoRegionName - READ-ONLY; Geo Region of the deleted site + GeoRegionName *string `json:"geoRegionName,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedSiteProperties. +func (ds DeletedSiteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DeletedWebAppCollection collection of deleted apps. +type DeletedWebAppCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]DeletedSite `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeletedWebAppCollection. +func (dwac DeletedWebAppCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dwac.Value != nil { + objectMap["value"] = dwac.Value + } + return json.Marshal(objectMap) +} + +// DeletedWebAppCollectionIterator provides access to a complete listing of DeletedSite values. +type DeletedWebAppCollectionIterator struct { + i int + page DeletedWebAppCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeletedWebAppCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DeletedWebAppCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeletedWebAppCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeletedWebAppCollectionIterator) Response() DeletedWebAppCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeletedWebAppCollectionIterator) Value() DeletedSite { + if !iter.page.NotDone() { + return DeletedSite{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeletedWebAppCollectionIterator type. +func NewDeletedWebAppCollectionIterator(page DeletedWebAppCollectionPage) DeletedWebAppCollectionIterator { + return DeletedWebAppCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dwac DeletedWebAppCollection) IsEmpty() bool { + return dwac.Value == nil || len(*dwac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dwac DeletedWebAppCollection) hasNextLink() bool { + return dwac.NextLink != nil && len(*dwac.NextLink) != 0 +} + +// deletedWebAppCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dwac DeletedWebAppCollection) deletedWebAppCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !dwac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dwac.NextLink))) +} + +// DeletedWebAppCollectionPage contains a page of DeletedSite values. +type DeletedWebAppCollectionPage struct { + fn func(context.Context, DeletedWebAppCollection) (DeletedWebAppCollection, error) + dwac DeletedWebAppCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeletedWebAppCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeletedWebAppCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dwac) + if err != nil { + return err + } + page.dwac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DeletedWebAppCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeletedWebAppCollectionPage) NotDone() bool { + return !page.dwac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeletedWebAppCollectionPage) Response() DeletedWebAppCollection { + return page.dwac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeletedWebAppCollectionPage) Values() []DeletedSite { + if page.dwac.IsEmpty() { + return nil + } + return *page.dwac.Value +} + +// Creates a new instance of the DeletedWebAppCollectionPage type. +func NewDeletedWebAppCollectionPage(cur DeletedWebAppCollection, getNextPage func(context.Context, DeletedWebAppCollection) (DeletedWebAppCollection, error)) DeletedWebAppCollectionPage { + return DeletedWebAppCollectionPage{ + fn: getNextPage, + dwac: cur, + } +} + +// Deployment user credentials used for publishing activity. +type Deployment struct { + autorest.Response `json:"-"` + // DeploymentProperties - Deployment resource specific properties + *DeploymentProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Deployment. +func (d Deployment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DeploymentProperties != nil { + objectMap["properties"] = d.DeploymentProperties + } + if d.Kind != nil { + objectMap["kind"] = d.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Deployment struct. +func (d *Deployment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var deploymentProperties DeploymentProperties + err = json.Unmarshal(*v, &deploymentProperties) + if err != nil { + return err + } + d.DeploymentProperties = &deploymentProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + d.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + } + } + + return nil +} + +// DeploymentCollection collection of app deployments. +type DeploymentCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Deployment `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DeploymentCollection. +func (dc DeploymentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.Value != nil { + objectMap["value"] = dc.Value + } + return json.Marshal(objectMap) +} + +// DeploymentCollectionIterator provides access to a complete listing of Deployment values. +type DeploymentCollectionIterator struct { + i int + page DeploymentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DeploymentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DeploymentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DeploymentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DeploymentCollectionIterator) Response() DeploymentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DeploymentCollectionIterator) Value() Deployment { + if !iter.page.NotDone() { + return Deployment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DeploymentCollectionIterator type. +func NewDeploymentCollectionIterator(page DeploymentCollectionPage) DeploymentCollectionIterator { + return DeploymentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dc DeploymentCollection) IsEmpty() bool { + return dc.Value == nil || len(*dc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dc DeploymentCollection) hasNextLink() bool { + return dc.NextLink != nil && len(*dc.NextLink) != 0 +} + +// deploymentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dc DeploymentCollection) deploymentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !dc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dc.NextLink))) +} + +// DeploymentCollectionPage contains a page of Deployment values. +type DeploymentCollectionPage struct { + fn func(context.Context, DeploymentCollection) (DeploymentCollection, error) + dc DeploymentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DeploymentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DeploymentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dc) + if err != nil { + return err + } + page.dc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DeploymentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DeploymentCollectionPage) NotDone() bool { + return !page.dc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DeploymentCollectionPage) Response() DeploymentCollection { + return page.dc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DeploymentCollectionPage) Values() []Deployment { + if page.dc.IsEmpty() { + return nil + } + return *page.dc.Value +} + +// Creates a new instance of the DeploymentCollectionPage type. +func NewDeploymentCollectionPage(cur DeploymentCollection, getNextPage func(context.Context, DeploymentCollection) (DeploymentCollection, error)) DeploymentCollectionPage { + return DeploymentCollectionPage{ + fn: getNextPage, + dc: cur, + } +} + +// DeploymentLocations list of available locations (regions or App Service Environments) for +// deployment of App Service resources. +type DeploymentLocations struct { + autorest.Response `json:"-"` + // Locations - Available regions. + Locations *[]GeoRegion `json:"locations,omitempty"` + // HostingEnvironments - Available App Service Environments with full descriptions of the environments. + HostingEnvironments *[]AppServiceEnvironment `json:"hostingEnvironments,omitempty"` + // HostingEnvironmentDeploymentInfos - Available App Service Environments with basic information. + HostingEnvironmentDeploymentInfos *[]HostingEnvironmentDeploymentInfo `json:"hostingEnvironmentDeploymentInfos,omitempty"` +} + +// DeploymentProperties deployment resource specific properties +type DeploymentProperties struct { + // Status - Deployment status. + Status *int32 `json:"status,omitempty"` + // Message - Details about deployment status. + Message *string `json:"message,omitempty"` + // Author - Who authored the deployment. + Author *string `json:"author,omitempty"` + // Deployer - Who performed the deployment. + Deployer *string `json:"deployer,omitempty"` + // AuthorEmail - Author email. + AuthorEmail *string `json:"author_email,omitempty"` + // StartTime - Start time. + StartTime *date.Time `json:"start_time,omitempty"` + // EndTime - End time. + EndTime *date.Time `json:"end_time,omitempty"` + // Active - True if deployment is currently active, false if completed and null if not started. + Active *bool `json:"active,omitempty"` + // Details - Details on deployment. + Details *string `json:"details,omitempty"` +} + +// DetectorAbnormalTimePeriod class representing Abnormal Time Period detected. +type DetectorAbnormalTimePeriod struct { + // StartTime - Start time of the correlated event + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the correlated event + EndTime *date.Time `json:"endTime,omitempty"` + // Message - Message describing the event + Message *string `json:"message,omitempty"` + // Source - Represents the name of the Detector + Source *string `json:"source,omitempty"` + // Priority - Represents the rank of the Detector + Priority *float64 `json:"priority,omitempty"` + // MetaData - Downtime metadata + MetaData *[][]NameValuePair `json:"metaData,omitempty"` + // Type - Represents the type of the Detector. Possible values include: 'IssueTypeServiceIncident', 'IssueTypeAppDeployment', 'IssueTypeAppCrash', 'IssueTypeRuntimeIssueDetected', 'IssueTypeAseDeployment', 'IssueTypeUserIssue', 'IssueTypePlatformIssue', 'IssueTypeOther' + Type IssueType `json:"type,omitempty"` + // Solutions - List of proposed solutions + Solutions *[]Solution `json:"solutions,omitempty"` +} + +// DetectorDefinition class representing detector definition +type DetectorDefinition struct { + // DisplayName - READ-ONLY; Display name of the detector + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; Description of the detector + Description *string `json:"description,omitempty"` + // Rank - READ-ONLY; Detector Rank + Rank *float64 `json:"rank,omitempty"` + // IsEnabled - READ-ONLY; Flag representing whether detector is enabled or not. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// MarshalJSON is the custom marshaler for DetectorDefinition. +func (dd DetectorDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DetectorDefinitionResource ARM resource for a detector definition +type DetectorDefinitionResource struct { + autorest.Response `json:"-"` + // DetectorDefinition - Core resource properties + *DetectorDefinition `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DetectorDefinitionResource. +func (ddr DetectorDefinitionResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ddr.DetectorDefinition != nil { + objectMap["properties"] = ddr.DetectorDefinition + } + if ddr.Kind != nil { + objectMap["kind"] = ddr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DetectorDefinitionResource struct. +func (ddr *DetectorDefinitionResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var detectorDefinition DetectorDefinition + err = json.Unmarshal(*v, &detectorDefinition) + if err != nil { + return err + } + ddr.DetectorDefinition = &detectorDefinition + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ddr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ddr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ddr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ddr.Type = &typeVar + } + } + } + + return nil +} + +// DetectorInfo definition of Detector +type DetectorInfo struct { + // ID - READ-ONLY; Id of detector + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of detector + Name *string `json:"name,omitempty"` + // Description - READ-ONLY; Short description of the detector and its purpose. + Description *string `json:"description,omitempty"` + // Author - READ-ONLY; Author of the detector. + Author *string `json:"author,omitempty"` + // Category - READ-ONLY; Problem category. This serves for organizing group for detectors. + Category *string `json:"category,omitempty"` + // SupportTopicList - READ-ONLY; List of Support Topics for which this detector is enabled. + SupportTopicList *[]SupportTopic `json:"supportTopicList,omitempty"` + // AnalysisType - READ-ONLY; Analysis Types for which this detector should apply to. + AnalysisType *[]string `json:"analysisType,omitempty"` + // Type - READ-ONLY; Whether this detector is an Analysis Detector or not. Possible values include: 'DetectorTypeDetector', 'DetectorTypeAnalysis', 'DetectorTypeCategoryOverview' + Type DetectorType `json:"type,omitempty"` + // Score - READ-ONLY; Defines score of a detector to power ML based matching. + Score *float64 `json:"score,omitempty"` +} + +// MarshalJSON is the custom marshaler for DetectorInfo. +func (di DetectorInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DetectorResponse class representing Response from Detector +type DetectorResponse struct { + autorest.Response `json:"-"` + // DetectorResponseProperties - DetectorResponse resource specific properties + *DetectorResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DetectorResponse. +func (dr DetectorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dr.DetectorResponseProperties != nil { + objectMap["properties"] = dr.DetectorResponseProperties + } + if dr.Kind != nil { + objectMap["kind"] = dr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DetectorResponse struct. +func (dr *DetectorResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var detectorResponseProperties DetectorResponseProperties + err = json.Unmarshal(*v, &detectorResponseProperties) + if err != nil { + return err + } + dr.DetectorResponseProperties = &detectorResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dr.Type = &typeVar + } + } + } + + return nil +} + +// DetectorResponseCollection collection of detector responses +type DetectorResponseCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]DetectorResponse `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DetectorResponseCollection. +func (drc DetectorResponseCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if drc.Value != nil { + objectMap["value"] = drc.Value + } + return json.Marshal(objectMap) +} + +// DetectorResponseCollectionIterator provides access to a complete listing of DetectorResponse values. +type DetectorResponseCollectionIterator struct { + i int + page DetectorResponseCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DetectorResponseCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DetectorResponseCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DetectorResponseCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DetectorResponseCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DetectorResponseCollectionIterator) Response() DetectorResponseCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DetectorResponseCollectionIterator) Value() DetectorResponse { + if !iter.page.NotDone() { + return DetectorResponse{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DetectorResponseCollectionIterator type. +func NewDetectorResponseCollectionIterator(page DetectorResponseCollectionPage) DetectorResponseCollectionIterator { + return DetectorResponseCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (drc DetectorResponseCollection) IsEmpty() bool { + return drc.Value == nil || len(*drc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (drc DetectorResponseCollection) hasNextLink() bool { + return drc.NextLink != nil && len(*drc.NextLink) != 0 +} + +// detectorResponseCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (drc DetectorResponseCollection) detectorResponseCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !drc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(drc.NextLink))) +} + +// DetectorResponseCollectionPage contains a page of DetectorResponse values. +type DetectorResponseCollectionPage struct { + fn func(context.Context, DetectorResponseCollection) (DetectorResponseCollection, error) + drc DetectorResponseCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DetectorResponseCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DetectorResponseCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.drc) + if err != nil { + return err + } + page.drc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DetectorResponseCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DetectorResponseCollectionPage) NotDone() bool { + return !page.drc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DetectorResponseCollectionPage) Response() DetectorResponseCollection { + return page.drc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DetectorResponseCollectionPage) Values() []DetectorResponse { + if page.drc.IsEmpty() { + return nil + } + return *page.drc.Value +} + +// Creates a new instance of the DetectorResponseCollectionPage type. +func NewDetectorResponseCollectionPage(cur DetectorResponseCollection, getNextPage func(context.Context, DetectorResponseCollection) (DetectorResponseCollection, error)) DetectorResponseCollectionPage { + return DetectorResponseCollectionPage{ + fn: getNextPage, + drc: cur, + } +} + +// DetectorResponseProperties detectorResponse resource specific properties +type DetectorResponseProperties struct { + // Metadata - metadata for the detector + Metadata *DetectorInfo `json:"metadata,omitempty"` + // Dataset - Data Set + Dataset *[]DiagnosticData `json:"dataset,omitempty"` + // Status - Indicates status of the most severe insight. + Status *Status `json:"status,omitempty"` + // DataProvidersMetadata - Additional configuration for different data providers to be used by the UI + DataProvidersMetadata *[]DataProviderMetadata `json:"dataProvidersMetadata,omitempty"` + // SuggestedUtterances - Suggested utterances where the detector can be applicable. + SuggestedUtterances *QueryUtterancesResults `json:"suggestedUtterances,omitempty"` +} + +// DiagnosticAnalysis class representing a diagnostic analysis done on an application +type DiagnosticAnalysis struct { + autorest.Response `json:"-"` + // DiagnosticAnalysisProperties - DiagnosticAnalysis resource specific properties + *DiagnosticAnalysisProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticAnalysis. +func (da DiagnosticAnalysis) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if da.DiagnosticAnalysisProperties != nil { + objectMap["properties"] = da.DiagnosticAnalysisProperties + } + if da.Kind != nil { + objectMap["kind"] = da.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiagnosticAnalysis struct. +func (da *DiagnosticAnalysis) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticAnalysisProperties DiagnosticAnalysisProperties + err = json.Unmarshal(*v, &diagnosticAnalysisProperties) + if err != nil { + return err + } + da.DiagnosticAnalysisProperties = &diagnosticAnalysisProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + da.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + da.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + da.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + da.Type = &typeVar + } + } + } + + return nil +} + +// DiagnosticAnalysisCollection collection of Diagnostic Analyses +type DiagnosticAnalysisCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]AnalysisDefinition `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticAnalysisCollection. +func (dac DiagnosticAnalysisCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dac.Value != nil { + objectMap["value"] = dac.Value + } + return json.Marshal(objectMap) +} + +// DiagnosticAnalysisCollectionIterator provides access to a complete listing of AnalysisDefinition values. +type DiagnosticAnalysisCollectionIterator struct { + i int + page DiagnosticAnalysisCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiagnosticAnalysisCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticAnalysisCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiagnosticAnalysisCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiagnosticAnalysisCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiagnosticAnalysisCollectionIterator) Response() DiagnosticAnalysisCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiagnosticAnalysisCollectionIterator) Value() AnalysisDefinition { + if !iter.page.NotDone() { + return AnalysisDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiagnosticAnalysisCollectionIterator type. +func NewDiagnosticAnalysisCollectionIterator(page DiagnosticAnalysisCollectionPage) DiagnosticAnalysisCollectionIterator { + return DiagnosticAnalysisCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dac DiagnosticAnalysisCollection) IsEmpty() bool { + return dac.Value == nil || len(*dac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dac DiagnosticAnalysisCollection) hasNextLink() bool { + return dac.NextLink != nil && len(*dac.NextLink) != 0 +} + +// diagnosticAnalysisCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dac DiagnosticAnalysisCollection) diagnosticAnalysisCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !dac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dac.NextLink))) +} + +// DiagnosticAnalysisCollectionPage contains a page of AnalysisDefinition values. +type DiagnosticAnalysisCollectionPage struct { + fn func(context.Context, DiagnosticAnalysisCollection) (DiagnosticAnalysisCollection, error) + dac DiagnosticAnalysisCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiagnosticAnalysisCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticAnalysisCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dac) + if err != nil { + return err + } + page.dac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiagnosticAnalysisCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiagnosticAnalysisCollectionPage) NotDone() bool { + return !page.dac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiagnosticAnalysisCollectionPage) Response() DiagnosticAnalysisCollection { + return page.dac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiagnosticAnalysisCollectionPage) Values() []AnalysisDefinition { + if page.dac.IsEmpty() { + return nil + } + return *page.dac.Value +} + +// Creates a new instance of the DiagnosticAnalysisCollectionPage type. +func NewDiagnosticAnalysisCollectionPage(cur DiagnosticAnalysisCollection, getNextPage func(context.Context, DiagnosticAnalysisCollection) (DiagnosticAnalysisCollection, error)) DiagnosticAnalysisCollectionPage { + return DiagnosticAnalysisCollectionPage{ + fn: getNextPage, + dac: cur, + } +} + +// DiagnosticAnalysisProperties diagnosticAnalysis resource specific properties +type DiagnosticAnalysisProperties struct { + // StartTime - Start time of the period + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the period + EndTime *date.Time `json:"endTime,omitempty"` + // AbnormalTimePeriods - List of time periods. + AbnormalTimePeriods *[]AbnormalTimePeriod `json:"abnormalTimePeriods,omitempty"` + // Payload - Data by each detector + Payload *[]AnalysisData `json:"payload,omitempty"` + // NonCorrelatedDetectors - Data by each detector for detectors that did not corelate + NonCorrelatedDetectors *[]DetectorDefinition `json:"nonCorrelatedDetectors,omitempty"` +} + +// DiagnosticCategory class representing detector definition +type DiagnosticCategory struct { + autorest.Response `json:"-"` + // DiagnosticCategoryProperties - DiagnosticCategory resource specific properties + *DiagnosticCategoryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticCategory. +func (dc DiagnosticCategory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.DiagnosticCategoryProperties != nil { + objectMap["properties"] = dc.DiagnosticCategoryProperties + } + if dc.Kind != nil { + objectMap["kind"] = dc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiagnosticCategory struct. +func (dc *DiagnosticCategory) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticCategoryProperties DiagnosticCategoryProperties + err = json.Unmarshal(*v, &diagnosticCategoryProperties) + if err != nil { + return err + } + dc.DiagnosticCategoryProperties = &diagnosticCategoryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dc.Type = &typeVar + } + } + } + + return nil +} + +// DiagnosticCategoryCollection collection of Diagnostic Categories +type DiagnosticCategoryCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]DiagnosticCategory `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticCategoryCollection. +func (dcc DiagnosticCategoryCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dcc.Value != nil { + objectMap["value"] = dcc.Value + } + return json.Marshal(objectMap) +} + +// DiagnosticCategoryCollectionIterator provides access to a complete listing of DiagnosticCategory values. +type DiagnosticCategoryCollectionIterator struct { + i int + page DiagnosticCategoryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiagnosticCategoryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCategoryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiagnosticCategoryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiagnosticCategoryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiagnosticCategoryCollectionIterator) Response() DiagnosticCategoryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiagnosticCategoryCollectionIterator) Value() DiagnosticCategory { + if !iter.page.NotDone() { + return DiagnosticCategory{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiagnosticCategoryCollectionIterator type. +func NewDiagnosticCategoryCollectionIterator(page DiagnosticCategoryCollectionPage) DiagnosticCategoryCollectionIterator { + return DiagnosticCategoryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dcc DiagnosticCategoryCollection) IsEmpty() bool { + return dcc.Value == nil || len(*dcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dcc DiagnosticCategoryCollection) hasNextLink() bool { + return dcc.NextLink != nil && len(*dcc.NextLink) != 0 +} + +// diagnosticCategoryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dcc DiagnosticCategoryCollection) diagnosticCategoryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !dcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dcc.NextLink))) +} + +// DiagnosticCategoryCollectionPage contains a page of DiagnosticCategory values. +type DiagnosticCategoryCollectionPage struct { + fn func(context.Context, DiagnosticCategoryCollection) (DiagnosticCategoryCollection, error) + dcc DiagnosticCategoryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiagnosticCategoryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticCategoryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dcc) + if err != nil { + return err + } + page.dcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiagnosticCategoryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiagnosticCategoryCollectionPage) NotDone() bool { + return !page.dcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiagnosticCategoryCollectionPage) Response() DiagnosticCategoryCollection { + return page.dcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiagnosticCategoryCollectionPage) Values() []DiagnosticCategory { + if page.dcc.IsEmpty() { + return nil + } + return *page.dcc.Value +} + +// Creates a new instance of the DiagnosticCategoryCollectionPage type. +func NewDiagnosticCategoryCollectionPage(cur DiagnosticCategoryCollection, getNextPage func(context.Context, DiagnosticCategoryCollection) (DiagnosticCategoryCollection, error)) DiagnosticCategoryCollectionPage { + return DiagnosticCategoryCollectionPage{ + fn: getNextPage, + dcc: cur, + } +} + +// DiagnosticCategoryProperties diagnosticCategory resource specific properties +type DiagnosticCategoryProperties struct { + // Description - READ-ONLY; Description of the diagnostic category + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticCategoryProperties. +func (dc DiagnosticCategoryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DiagnosticData set of data with rendering instructions +type DiagnosticData struct { + // Table - Data in table form + Table *DataTableResponseObject `json:"table,omitempty"` + // RenderingProperties - Properties that describe how the table should be rendered + RenderingProperties *Rendering `json:"renderingProperties,omitempty"` +} + +// DiagnosticDetectorCollection collection of Diagnostic Detectors +type DiagnosticDetectorCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]DetectorDefinitionResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticDetectorCollection. +func (ddc DiagnosticDetectorCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ddc.Value != nil { + objectMap["value"] = ddc.Value + } + return json.Marshal(objectMap) +} + +// DiagnosticDetectorCollectionIterator provides access to a complete listing of DetectorDefinitionResource +// values. +type DiagnosticDetectorCollectionIterator struct { + i int + page DiagnosticDetectorCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DiagnosticDetectorCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticDetectorCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DiagnosticDetectorCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DiagnosticDetectorCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DiagnosticDetectorCollectionIterator) Response() DiagnosticDetectorCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DiagnosticDetectorCollectionIterator) Value() DetectorDefinitionResource { + if !iter.page.NotDone() { + return DetectorDefinitionResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DiagnosticDetectorCollectionIterator type. +func NewDiagnosticDetectorCollectionIterator(page DiagnosticDetectorCollectionPage) DiagnosticDetectorCollectionIterator { + return DiagnosticDetectorCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ddc DiagnosticDetectorCollection) IsEmpty() bool { + return ddc.Value == nil || len(*ddc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ddc DiagnosticDetectorCollection) hasNextLink() bool { + return ddc.NextLink != nil && len(*ddc.NextLink) != 0 +} + +// diagnosticDetectorCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ddc DiagnosticDetectorCollection) diagnosticDetectorCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ddc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ddc.NextLink))) +} + +// DiagnosticDetectorCollectionPage contains a page of DetectorDefinitionResource values. +type DiagnosticDetectorCollectionPage struct { + fn func(context.Context, DiagnosticDetectorCollection) (DiagnosticDetectorCollection, error) + ddc DiagnosticDetectorCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DiagnosticDetectorCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DiagnosticDetectorCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ddc) + if err != nil { + return err + } + page.ddc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DiagnosticDetectorCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DiagnosticDetectorCollectionPage) NotDone() bool { + return !page.ddc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DiagnosticDetectorCollectionPage) Response() DiagnosticDetectorCollection { + return page.ddc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DiagnosticDetectorCollectionPage) Values() []DetectorDefinitionResource { + if page.ddc.IsEmpty() { + return nil + } + return *page.ddc.Value +} + +// Creates a new instance of the DiagnosticDetectorCollectionPage type. +func NewDiagnosticDetectorCollectionPage(cur DiagnosticDetectorCollection, getNextPage func(context.Context, DiagnosticDetectorCollection) (DiagnosticDetectorCollection, error)) DiagnosticDetectorCollectionPage { + return DiagnosticDetectorCollectionPage{ + fn: getNextPage, + ddc: cur, + } +} + +// DiagnosticDetectorResponse class representing Response from Diagnostic Detectors +type DiagnosticDetectorResponse struct { + autorest.Response `json:"-"` + // DiagnosticDetectorResponseProperties - DiagnosticDetectorResponse resource specific properties + *DiagnosticDetectorResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DiagnosticDetectorResponse. +func (ddr DiagnosticDetectorResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ddr.DiagnosticDetectorResponseProperties != nil { + objectMap["properties"] = ddr.DiagnosticDetectorResponseProperties + } + if ddr.Kind != nil { + objectMap["kind"] = ddr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DiagnosticDetectorResponse struct. +func (ddr *DiagnosticDetectorResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var diagnosticDetectorResponseProperties DiagnosticDetectorResponseProperties + err = json.Unmarshal(*v, &diagnosticDetectorResponseProperties) + if err != nil { + return err + } + ddr.DiagnosticDetectorResponseProperties = &diagnosticDetectorResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ddr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ddr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ddr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ddr.Type = &typeVar + } + } + } + + return nil +} + +// DiagnosticDetectorResponseProperties diagnosticDetectorResponse resource specific properties +type DiagnosticDetectorResponseProperties struct { + // StartTime - Start time of the period + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the period + EndTime *date.Time `json:"endTime,omitempty"` + // IssueDetected - Flag representing Issue was detected. + IssueDetected *bool `json:"issueDetected,omitempty"` + // DetectorDefinition - Detector's definition + DetectorDefinition *DetectorDefinition `json:"detectorDefinition,omitempty"` + // Metrics - Metrics provided by the detector + Metrics *[]DiagnosticMetricSet `json:"metrics,omitempty"` + // AbnormalTimePeriods - List of Correlated events found by the detector + AbnormalTimePeriods *[]DetectorAbnormalTimePeriod `json:"abnormalTimePeriods,omitempty"` + // Data - Additional Data that detector wants to send. + Data *[][]NameValuePair `json:"data,omitempty"` + // ResponseMetaData - Meta Data + ResponseMetaData *ResponseMetaData `json:"responseMetaData,omitempty"` +} + +// DiagnosticMetricSample class representing Diagnostic Metric +type DiagnosticMetricSample struct { + // Timestamp - Time at which metric is measured + Timestamp *date.Time `json:"timestamp,omitempty"` + // RoleInstance - Role Instance. Null if this counter is not per instance + // This is returned and should be whichever instance name we desire to be returned + // i.e. CPU and Memory return RDWORKERNAME (LargeDed..._IN_0) + // where RDWORKERNAME is Machine name below and RoleInstance name in parenthesis + RoleInstance *string `json:"roleInstance,omitempty"` + // Total - Total value of the metric. If multiple measurements are made this will have sum of all. + Total *float64 `json:"total,omitempty"` + // Maximum - Maximum of the metric sampled during the time period + Maximum *float64 `json:"maximum,omitempty"` + // Minimum - Minimum of the metric sampled during the time period + Minimum *float64 `json:"minimum,omitempty"` + // IsAggregated - Whether the values are aggregates across all workers or not + IsAggregated *bool `json:"isAggregated,omitempty"` +} + +// DiagnosticMetricSet class representing Diagnostic Metric information +type DiagnosticMetricSet struct { + // Name - Name of the metric + Name *string `json:"name,omitempty"` + // Unit - Metric's unit + Unit *string `json:"unit,omitempty"` + // StartTime - Start time of the period + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the period + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - Presented time grain. Supported grains at the moment are PT1M, PT1H, P1D + TimeGrain *string `json:"timeGrain,omitempty"` + // Values - Collection of metric values for the selected period based on the {Microsoft.Web.Hosting.Administration.DiagnosticMetricSet.TimeGrain} + Values *[]DiagnosticMetricSample `json:"values,omitempty"` +} + +// Dimension dimension of a resource metric. For e.g. instance specific HTTP requests for a web app, +// where instance name is dimension of the metric HTTP request +type Dimension struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + InternalName *string `json:"internalName,omitempty"` + ToBeExportedForShoebox *bool `json:"toBeExportedForShoebox,omitempty"` +} + +// Domain information about a domain. +type Domain struct { + autorest.Response `json:"-"` + // DomainProperties - Domain resource specific properties + *DomainProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Domain. +func (d Domain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.DomainProperties != nil { + objectMap["properties"] = d.DomainProperties + } + if d.Kind != nil { + objectMap["kind"] = d.Kind + } + if d.Location != nil { + objectMap["location"] = d.Location + } + if d.Tags != nil { + objectMap["tags"] = d.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Domain struct. +func (d *Domain) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var domainProperties DomainProperties + err = json.Unmarshal(*v, &domainProperties) + if err != nil { + return err + } + d.DomainProperties = &domainProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + d.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + d.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + d.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + d.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + d.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + d.Tags = tags + } + } + } + + return nil +} + +// DomainAvailabilityCheckResult domain availability check result. +type DomainAvailabilityCheckResult struct { + autorest.Response `json:"-"` + // Name - Name of the domain. + Name *string `json:"name,omitempty"` + // Available - true if domain can be purchased using CreateDomain API; otherwise, false. + Available *bool `json:"available,omitempty"` + // DomainType - Valid values are Regular domain: Azure will charge the full price of domain registration, SoftDeleted: Purchasing this domain will simply restore it and this operation will not cost anything. Possible values include: 'DomainTypeRegular', 'DomainTypeSoftDeleted' + DomainType DomainType `json:"domainType,omitempty"` +} + +// DomainCollection collection of domains. +type DomainCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Domain `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainCollection. +func (dc DomainCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dc.Value != nil { + objectMap["value"] = dc.Value + } + return json.Marshal(objectMap) +} + +// DomainCollectionIterator provides access to a complete listing of Domain values. +type DomainCollectionIterator struct { + i int + page DomainCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DomainCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DomainCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DomainCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DomainCollectionIterator) Response() DomainCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DomainCollectionIterator) Value() Domain { + if !iter.page.NotDone() { + return Domain{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DomainCollectionIterator type. +func NewDomainCollectionIterator(page DomainCollectionPage) DomainCollectionIterator { + return DomainCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (dc DomainCollection) IsEmpty() bool { + return dc.Value == nil || len(*dc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (dc DomainCollection) hasNextLink() bool { + return dc.NextLink != nil && len(*dc.NextLink) != 0 +} + +// domainCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (dc DomainCollection) domainCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !dc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(dc.NextLink))) +} + +// DomainCollectionPage contains a page of Domain values. +type DomainCollectionPage struct { + fn func(context.Context, DomainCollection) (DomainCollection, error) + dc DomainCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DomainCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.dc) + if err != nil { + return err + } + page.dc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DomainCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DomainCollectionPage) NotDone() bool { + return !page.dc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DomainCollectionPage) Response() DomainCollection { + return page.dc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DomainCollectionPage) Values() []Domain { + if page.dc.IsEmpty() { + return nil + } + return *page.dc.Value +} + +// Creates a new instance of the DomainCollectionPage type. +func NewDomainCollectionPage(cur DomainCollection, getNextPage func(context.Context, DomainCollection) (DomainCollection, error)) DomainCollectionPage { + return DomainCollectionPage{ + fn: getNextPage, + dc: cur, + } +} + +// DomainControlCenterSsoRequest single sign-on request information for domain management. +type DomainControlCenterSsoRequest struct { + autorest.Response `json:"-"` + // URL - READ-ONLY; URL where the single sign-on request is to be made. + URL *string `json:"url,omitempty"` + // PostParameterKey - READ-ONLY; Post parameter key. + PostParameterKey *string `json:"postParameterKey,omitempty"` + // PostParameterValue - READ-ONLY; Post parameter value. Client should use 'application/x-www-form-urlencoded' encoding for this value. + PostParameterValue *string `json:"postParameterValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainControlCenterSsoRequest. +func (dccsr DomainControlCenterSsoRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// DomainOwnershipIdentifier domain ownership Identifier. +type DomainOwnershipIdentifier struct { + autorest.Response `json:"-"` + // DomainOwnershipIdentifierProperties - DomainOwnershipIdentifier resource specific properties + *DomainOwnershipIdentifierProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainOwnershipIdentifier. +func (doi DomainOwnershipIdentifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if doi.DomainOwnershipIdentifierProperties != nil { + objectMap["properties"] = doi.DomainOwnershipIdentifierProperties + } + if doi.Kind != nil { + objectMap["kind"] = doi.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DomainOwnershipIdentifier struct. +func (doi *DomainOwnershipIdentifier) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var domainOwnershipIdentifierProperties DomainOwnershipIdentifierProperties + err = json.Unmarshal(*v, &domainOwnershipIdentifierProperties) + if err != nil { + return err + } + doi.DomainOwnershipIdentifierProperties = &domainOwnershipIdentifierProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + doi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + doi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + doi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + doi.Type = &typeVar + } + } + } + + return nil +} + +// DomainOwnershipIdentifierCollection collection of domain ownership identifiers. +type DomainOwnershipIdentifierCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]DomainOwnershipIdentifier `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainOwnershipIdentifierCollection. +func (doic DomainOwnershipIdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if doic.Value != nil { + objectMap["value"] = doic.Value + } + return json.Marshal(objectMap) +} + +// DomainOwnershipIdentifierCollectionIterator provides access to a complete listing of +// DomainOwnershipIdentifier values. +type DomainOwnershipIdentifierCollectionIterator struct { + i int + page DomainOwnershipIdentifierCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *DomainOwnershipIdentifierCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainOwnershipIdentifierCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *DomainOwnershipIdentifierCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter DomainOwnershipIdentifierCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter DomainOwnershipIdentifierCollectionIterator) Response() DomainOwnershipIdentifierCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter DomainOwnershipIdentifierCollectionIterator) Value() DomainOwnershipIdentifier { + if !iter.page.NotDone() { + return DomainOwnershipIdentifier{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the DomainOwnershipIdentifierCollectionIterator type. +func NewDomainOwnershipIdentifierCollectionIterator(page DomainOwnershipIdentifierCollectionPage) DomainOwnershipIdentifierCollectionIterator { + return DomainOwnershipIdentifierCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (doic DomainOwnershipIdentifierCollection) IsEmpty() bool { + return doic.Value == nil || len(*doic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (doic DomainOwnershipIdentifierCollection) hasNextLink() bool { + return doic.NextLink != nil && len(*doic.NextLink) != 0 +} + +// domainOwnershipIdentifierCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (doic DomainOwnershipIdentifierCollection) domainOwnershipIdentifierCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !doic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(doic.NextLink))) +} + +// DomainOwnershipIdentifierCollectionPage contains a page of DomainOwnershipIdentifier values. +type DomainOwnershipIdentifierCollectionPage struct { + fn func(context.Context, DomainOwnershipIdentifierCollection) (DomainOwnershipIdentifierCollection, error) + doic DomainOwnershipIdentifierCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *DomainOwnershipIdentifierCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/DomainOwnershipIdentifierCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.doic) + if err != nil { + return err + } + page.doic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *DomainOwnershipIdentifierCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page DomainOwnershipIdentifierCollectionPage) NotDone() bool { + return !page.doic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page DomainOwnershipIdentifierCollectionPage) Response() DomainOwnershipIdentifierCollection { + return page.doic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page DomainOwnershipIdentifierCollectionPage) Values() []DomainOwnershipIdentifier { + if page.doic.IsEmpty() { + return nil + } + return *page.doic.Value +} + +// Creates a new instance of the DomainOwnershipIdentifierCollectionPage type. +func NewDomainOwnershipIdentifierCollectionPage(cur DomainOwnershipIdentifierCollection, getNextPage func(context.Context, DomainOwnershipIdentifierCollection) (DomainOwnershipIdentifierCollection, error)) DomainOwnershipIdentifierCollectionPage { + return DomainOwnershipIdentifierCollectionPage{ + fn: getNextPage, + doic: cur, + } +} + +// DomainOwnershipIdentifierProperties domainOwnershipIdentifier resource specific properties +type DomainOwnershipIdentifierProperties struct { + // OwnershipID - Ownership Id. + OwnershipID *string `json:"ownershipId,omitempty"` +} + +// DomainPatchResource ARM resource for a domain. +type DomainPatchResource struct { + // DomainPatchResourceProperties - DomainPatchResource resource specific properties + *DomainPatchResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainPatchResource. +func (dpr DomainPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpr.DomainPatchResourceProperties != nil { + objectMap["properties"] = dpr.DomainPatchResourceProperties + } + if dpr.Kind != nil { + objectMap["kind"] = dpr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for DomainPatchResource struct. +func (dpr *DomainPatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var domainPatchResourceProperties DomainPatchResourceProperties + err = json.Unmarshal(*v, &domainPatchResourceProperties) + if err != nil { + return err + } + dpr.DomainPatchResourceProperties = &domainPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + dpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + dpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + dpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + dpr.Type = &typeVar + } + } + } + + return nil +} + +// DomainPatchResourceProperties domainPatchResource resource specific properties +type DomainPatchResourceProperties struct { + // ContactAdmin - Administrative contact. + ContactAdmin *Contact `json:"contactAdmin,omitempty"` + // ContactBilling - Billing contact. + ContactBilling *Contact `json:"contactBilling,omitempty"` + // ContactRegistrant - Registrant contact. + ContactRegistrant *Contact `json:"contactRegistrant,omitempty"` + // ContactTech - Technical contact. + ContactTech *Contact `json:"contactTech,omitempty"` + // RegistrationStatus - READ-ONLY; Domain registration status. Possible values include: 'DomainStatusActive', 'DomainStatusAwaiting', 'DomainStatusCancelled', 'DomainStatusConfiscated', 'DomainStatusDisabled', 'DomainStatusExcluded', 'DomainStatusExpired', 'DomainStatusFailed', 'DomainStatusHeld', 'DomainStatusLocked', 'DomainStatusParked', 'DomainStatusPending', 'DomainStatusReserved', 'DomainStatusReverted', 'DomainStatusSuspended', 'DomainStatusTransferred', 'DomainStatusUnknown', 'DomainStatusUnlocked', 'DomainStatusUnparked', 'DomainStatusUpdated', 'DomainStatusJSONConverterFailed' + RegistrationStatus DomainStatus `json:"registrationStatus,omitempty"` + // ProvisioningState - READ-ONLY; Domain provisioning state. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // NameServers - READ-ONLY; Name servers. + NameServers *[]string `json:"nameServers,omitempty"` + // Privacy - true if domain privacy is enabled for this domain; otherwise, false. + Privacy *bool `json:"privacy,omitempty"` + // CreatedTime - READ-ONLY; Domain creation timestamp. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ExpirationTime - READ-ONLY; Domain expiration timestamp. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // LastRenewedTime - READ-ONLY; Timestamp when the domain was renewed last time. + LastRenewedTime *date.Time `json:"lastRenewedTime,omitempty"` + // AutoRenew - true if the domain should be automatically renewed; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + // ReadyForDNSRecordManagement - READ-ONLY; true if Azure can assign this domain to App Service apps; otherwise, false. This value will be true if domain registration status is active and + // it is hosted on name servers Azure has programmatic access to. + ReadyForDNSRecordManagement *bool `json:"readyForDnsRecordManagement,omitempty"` + // ManagedHostNames - READ-ONLY; All hostnames derived from the domain and assigned to Azure resources. + ManagedHostNames *[]HostName `json:"managedHostNames,omitempty"` + // Consent - Legal agreement consent. + Consent *DomainPurchaseConsent `json:"consent,omitempty"` + // DomainNotRenewableReasons - READ-ONLY; Reasons why domain is not renewable. + DomainNotRenewableReasons *[]string `json:"domainNotRenewableReasons,omitempty"` + // DNSType - Current DNS type. Possible values include: 'DNSTypeAzureDNS', 'DNSTypeDefaultDomainRegistrarDNS' + DNSType DNSType `json:"dnsType,omitempty"` + // DNSZoneID - Azure DNS Zone to use + DNSZoneID *string `json:"dnsZoneId,omitempty"` + // TargetDNSType - Target DNS type (would be used for migration). Possible values include: 'DNSTypeAzureDNS', 'DNSTypeDefaultDomainRegistrarDNS' + TargetDNSType DNSType `json:"targetDnsType,omitempty"` + AuthCode *string `json:"authCode,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainPatchResourceProperties. +func (dpr DomainPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if dpr.ContactAdmin != nil { + objectMap["contactAdmin"] = dpr.ContactAdmin + } + if dpr.ContactBilling != nil { + objectMap["contactBilling"] = dpr.ContactBilling + } + if dpr.ContactRegistrant != nil { + objectMap["contactRegistrant"] = dpr.ContactRegistrant + } + if dpr.ContactTech != nil { + objectMap["contactTech"] = dpr.ContactTech + } + if dpr.Privacy != nil { + objectMap["privacy"] = dpr.Privacy + } + if dpr.AutoRenew != nil { + objectMap["autoRenew"] = dpr.AutoRenew + } + if dpr.Consent != nil { + objectMap["consent"] = dpr.Consent + } + if dpr.DNSType != "" { + objectMap["dnsType"] = dpr.DNSType + } + if dpr.DNSZoneID != nil { + objectMap["dnsZoneId"] = dpr.DNSZoneID + } + if dpr.TargetDNSType != "" { + objectMap["targetDnsType"] = dpr.TargetDNSType + } + if dpr.AuthCode != nil { + objectMap["authCode"] = dpr.AuthCode + } + return json.Marshal(objectMap) +} + +// DomainProperties domain resource specific properties +type DomainProperties struct { + // ContactAdmin - Administrative contact. + ContactAdmin *Contact `json:"contactAdmin,omitempty"` + // ContactBilling - Billing contact. + ContactBilling *Contact `json:"contactBilling,omitempty"` + // ContactRegistrant - Registrant contact. + ContactRegistrant *Contact `json:"contactRegistrant,omitempty"` + // ContactTech - Technical contact. + ContactTech *Contact `json:"contactTech,omitempty"` + // RegistrationStatus - READ-ONLY; Domain registration status. Possible values include: 'DomainStatusActive', 'DomainStatusAwaiting', 'DomainStatusCancelled', 'DomainStatusConfiscated', 'DomainStatusDisabled', 'DomainStatusExcluded', 'DomainStatusExpired', 'DomainStatusFailed', 'DomainStatusHeld', 'DomainStatusLocked', 'DomainStatusParked', 'DomainStatusPending', 'DomainStatusReserved', 'DomainStatusReverted', 'DomainStatusSuspended', 'DomainStatusTransferred', 'DomainStatusUnknown', 'DomainStatusUnlocked', 'DomainStatusUnparked', 'DomainStatusUpdated', 'DomainStatusJSONConverterFailed' + RegistrationStatus DomainStatus `json:"registrationStatus,omitempty"` + // ProvisioningState - READ-ONLY; Domain provisioning state. Possible values include: 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled', 'ProvisioningStateInProgress', 'ProvisioningStateDeleting' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // NameServers - READ-ONLY; Name servers. + NameServers *[]string `json:"nameServers,omitempty"` + // Privacy - true if domain privacy is enabled for this domain; otherwise, false. + Privacy *bool `json:"privacy,omitempty"` + // CreatedTime - READ-ONLY; Domain creation timestamp. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ExpirationTime - READ-ONLY; Domain expiration timestamp. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // LastRenewedTime - READ-ONLY; Timestamp when the domain was renewed last time. + LastRenewedTime *date.Time `json:"lastRenewedTime,omitempty"` + // AutoRenew - true if the domain should be automatically renewed; otherwise, false. + AutoRenew *bool `json:"autoRenew,omitempty"` + // ReadyForDNSRecordManagement - READ-ONLY; true if Azure can assign this domain to App Service apps; otherwise, false. This value will be true if domain registration status is active and + // it is hosted on name servers Azure has programmatic access to. + ReadyForDNSRecordManagement *bool `json:"readyForDnsRecordManagement,omitempty"` + // ManagedHostNames - READ-ONLY; All hostnames derived from the domain and assigned to Azure resources. + ManagedHostNames *[]HostName `json:"managedHostNames,omitempty"` + // Consent - Legal agreement consent. + Consent *DomainPurchaseConsent `json:"consent,omitempty"` + // DomainNotRenewableReasons - READ-ONLY; Reasons why domain is not renewable. + DomainNotRenewableReasons *[]string `json:"domainNotRenewableReasons,omitempty"` + // DNSType - Current DNS type. Possible values include: 'DNSTypeAzureDNS', 'DNSTypeDefaultDomainRegistrarDNS' + DNSType DNSType `json:"dnsType,omitempty"` + // DNSZoneID - Azure DNS Zone to use + DNSZoneID *string `json:"dnsZoneId,omitempty"` + // TargetDNSType - Target DNS type (would be used for migration). Possible values include: 'DNSTypeAzureDNS', 'DNSTypeDefaultDomainRegistrarDNS' + TargetDNSType DNSType `json:"targetDnsType,omitempty"` + AuthCode *string `json:"authCode,omitempty"` +} + +// MarshalJSON is the custom marshaler for DomainProperties. +func (d DomainProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if d.ContactAdmin != nil { + objectMap["contactAdmin"] = d.ContactAdmin + } + if d.ContactBilling != nil { + objectMap["contactBilling"] = d.ContactBilling + } + if d.ContactRegistrant != nil { + objectMap["contactRegistrant"] = d.ContactRegistrant + } + if d.ContactTech != nil { + objectMap["contactTech"] = d.ContactTech + } + if d.Privacy != nil { + objectMap["privacy"] = d.Privacy + } + if d.AutoRenew != nil { + objectMap["autoRenew"] = d.AutoRenew + } + if d.Consent != nil { + objectMap["consent"] = d.Consent + } + if d.DNSType != "" { + objectMap["dnsType"] = d.DNSType + } + if d.DNSZoneID != nil { + objectMap["dnsZoneId"] = d.DNSZoneID + } + if d.TargetDNSType != "" { + objectMap["targetDnsType"] = d.TargetDNSType + } + if d.AuthCode != nil { + objectMap["authCode"] = d.AuthCode + } + return json.Marshal(objectMap) +} + +// DomainPurchaseConsent domain purchase consent object, representing acceptance of applicable legal +// agreements. +type DomainPurchaseConsent struct { + // AgreementKeys - List of applicable legal agreement keys. This list can be retrieved using ListLegalAgreements API under TopLevelDomain resource. + AgreementKeys *[]string `json:"agreementKeys,omitempty"` + // AgreedBy - Client IP address. + AgreedBy *string `json:"agreedBy,omitempty"` + // AgreedAt - Timestamp when the agreements were accepted. + AgreedAt *date.Time `json:"agreedAt,omitempty"` +} + +// DomainRecommendationSearchParameters domain recommendation search parameters. +type DomainRecommendationSearchParameters struct { + // Keywords - Keywords to be used for generating domain recommendations. + Keywords *string `json:"keywords,omitempty"` + // MaxDomainRecommendations - Maximum number of recommendations. + MaxDomainRecommendations *int32 `json:"maxDomainRecommendations,omitempty"` +} + +// DomainsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type DomainsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(DomainsClient) (Domain, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *DomainsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for DomainsCreateOrUpdateFuture.Result. +func (future *DomainsCreateOrUpdateFuture) result(client DomainsClient) (d Domain, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + d.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.DomainsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if d.Response.Response, err = future.GetResult(sender); err == nil && d.Response.Response.StatusCode != http.StatusNoContent { + d, err = client.CreateOrUpdateResponder(d.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.DomainsCreateOrUpdateFuture", "Result", d.Response.Response, "Failure responding to request") + } + } + return +} + +// EnabledConfig enabled configuration. +type EnabledConfig struct { + // Enabled - True if configuration is enabled, false if it is disabled and null if configuration is not set. + Enabled *bool `json:"enabled,omitempty"` +} + +// EndpointDependency a domain name that a service is reached at, including details of the current +// connection status. +type EndpointDependency struct { + // DomainName - The domain name of the dependency. + DomainName *string `json:"domainName,omitempty"` + // EndpointDetails - The IP Addresses and Ports used when connecting to DomainName. + EndpointDetails *[]EndpointDetail `json:"endpointDetails,omitempty"` +} + +// EndpointDetail current TCP connectivity information from the App Service Environment to a single +// endpoint. +type EndpointDetail struct { + // IPAddress - An IP Address that Domain Name currently resolves to. + IPAddress *string `json:"ipAddress,omitempty"` + // Port - The port an endpoint is connected to. + Port *int32 `json:"port,omitempty"` + // Latency - The time in milliseconds it takes for a TCP connection to be created from the App Service Environment to this IpAddress at this Port. + Latency *float64 `json:"latency,omitempty"` + // IsAccessible - Whether it is possible to create a TCP connection from the App Service Environment to this IpAddress at this Port. + IsAccessible *bool `json:"isAccessible,omitempty"` +} + +// EnvironmentVar container App container environment variable. +type EnvironmentVar struct { + // Name - Environment variable name. + Name *string `json:"name,omitempty"` + // Value - Non-secret environment variable value. + Value *string `json:"value,omitempty"` + // SecretRef - Name of the Container App secret from which to pull the environment variable value. + SecretRef *string `json:"secretRef,omitempty"` +} + +// ErrorEntity body of the error response returned from the API. +type ErrorEntity struct { + // ExtendedCode - Type of error. + ExtendedCode *string `json:"extendedCode,omitempty"` + // MessageTemplate - Message template. + MessageTemplate *string `json:"messageTemplate,omitempty"` + // Parameters - Parameters for the template. + Parameters *[]string `json:"parameters,omitempty"` + // InnerErrors - Inner errors. + InnerErrors *[]ErrorEntity `json:"innerErrors,omitempty"` + // Details - Error Details. + Details *[]ErrorEntity `json:"details,omitempty"` + // Target - The error target. + Target *string `json:"target,omitempty"` + // Code - Basic error code. + Code *string `json:"code,omitempty"` + // Message - Any details of the error. + Message *string `json:"message,omitempty"` +} + +// Experiments routing rules in production experiments. +type Experiments struct { + // RampUpRules - List of ramp-up rules. + RampUpRules *[]RampUpRule `json:"rampUpRules,omitempty"` +} + +// ExtendedLocation extended Location. +type ExtendedLocation struct { + // Name - Name of extended location. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Type of extended location. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ExtendedLocation. +func (el ExtendedLocation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if el.Name != nil { + objectMap["name"] = el.Name + } + return json.Marshal(objectMap) +} + +// Facebook the configuration settings of the Facebook provider. +type Facebook struct { + // Enabled - false if the Facebook provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the app registration for the Facebook provider. + Registration *AppRegistration `json:"registration,omitempty"` + // GraphAPIVersion - The version of the Facebook api to be used while logging in. + GraphAPIVersion *string `json:"graphApiVersion,omitempty"` + // Login - The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` +} + +// FileSystemApplicationLogsConfig application logs to file system configuration. +type FileSystemApplicationLogsConfig struct { + // Level - Log level. Possible values include: 'LogLevelOff', 'LogLevelVerbose', 'LogLevelInformation', 'LogLevelWarning', 'LogLevelError' + Level LogLevel `json:"level,omitempty"` +} + +// FileSystemHTTPLogsConfig http logs to file system configuration. +type FileSystemHTTPLogsConfig struct { + // RetentionInMb - Maximum size in megabytes that http log files can use. + // When reached old log files will be removed to make space for new ones. + // Value can range between 25 and 100. + RetentionInMb *int32 `json:"retentionInMb,omitempty"` + // RetentionInDays - Retention in days. + // Remove files older than X days. + // 0 or lower means no retention. + RetentionInDays *int32 `json:"retentionInDays,omitempty"` + // Enabled - True if configuration is enabled, false if it is disabled and null if configuration is not set. + Enabled *bool `json:"enabled,omitempty"` +} + +// FileSystemTokenStore the configuration settings of the storage of the tokens if a file system is used. +type FileSystemTokenStore struct { + // Directory - The directory in which the tokens will be stored. + Directory *string `json:"directory,omitempty"` +} + +// ForwardProxy the configuration settings of a forward proxy used to make the requests. +type ForwardProxy struct { + // Convention - The convention used to determine the url of the request made. Possible values include: 'ForwardProxyConventionNoProxy', 'ForwardProxyConventionStandard', 'ForwardProxyConventionCustom' + Convention ForwardProxyConvention `json:"convention,omitempty"` + // CustomHostHeaderName - The name of the header containing the host of the request. + CustomHostHeaderName *string `json:"customHostHeaderName,omitempty"` + // CustomProtoHeaderName - The name of the header containing the scheme of the request. + CustomProtoHeaderName *string `json:"customProtoHeaderName,omitempty"` +} + +// FrontEndConfiguration ... +type FrontEndConfiguration struct { + // Kind - Possible values include: 'FrontEndServiceTypeNodePort', 'FrontEndServiceTypeLoadBalancer' + Kind FrontEndServiceType `json:"kind,omitempty"` +} + +// FunctionAppMajorVersion function App stack major version. +type FunctionAppMajorVersion struct { + // DisplayText - READ-ONLY; Function App stack major version (display only). + DisplayText *string `json:"displayText,omitempty"` + // Value - READ-ONLY; Function App stack major version name. + Value *string `json:"value,omitempty"` + // MinorVersions - READ-ONLY; Minor versions associated with the major version. + MinorVersions *[]FunctionAppMinorVersion `json:"minorVersions,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppMajorVersion. +func (famv FunctionAppMajorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FunctionAppMinorVersion function App stack minor version. +type FunctionAppMinorVersion struct { + // DisplayText - READ-ONLY; Function App stack (display only). + DisplayText *string `json:"displayText,omitempty"` + // Value - READ-ONLY; Function App stack name. + Value *string `json:"value,omitempty"` + // StackSettings - READ-ONLY; Settings associated with the minor version. + StackSettings *FunctionAppRuntimes `json:"stackSettings,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppMinorVersion. +func (famv FunctionAppMinorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FunctionAppRuntimes function App stack runtimes. +type FunctionAppRuntimes struct { + // LinuxRuntimeSettings - READ-ONLY; Linux-specific settings associated with the minor version. + LinuxRuntimeSettings *FunctionAppRuntimeSettings `json:"linuxRuntimeSettings,omitempty"` + // WindowsRuntimeSettings - READ-ONLY; Windows-specific settings associated with the minor version. + WindowsRuntimeSettings *FunctionAppRuntimeSettings `json:"windowsRuntimeSettings,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppRuntimes. +func (far FunctionAppRuntimes) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FunctionAppRuntimeSettings function App runtime settings. +type FunctionAppRuntimeSettings struct { + // RuntimeVersion - READ-ONLY; Function App stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // RemoteDebuggingSupported - READ-ONLY; true if remote debugging is supported for the stack; otherwise, false. + RemoteDebuggingSupported *bool `json:"remoteDebuggingSupported,omitempty"` + // AppInsightsSettings - READ-ONLY; Application Insights settings associated with the minor version. + AppInsightsSettings *AppInsightsWebAppStackSettings `json:"appInsightsSettings,omitempty"` + // GitHubActionSettings - READ-ONLY; GitHub Actions settings associated with the minor version. + GitHubActionSettings *GitHubActionWebAppStackSettings `json:"gitHubActionSettings,omitempty"` + // AppSettingsDictionary - READ-ONLY; Application settings associated with the minor version. + AppSettingsDictionary map[string]*string `json:"appSettingsDictionary"` + // SiteConfigPropertiesDictionary - READ-ONLY; Configuration settings associated with the minor version. + SiteConfigPropertiesDictionary *SiteConfigPropertiesDictionary `json:"siteConfigPropertiesDictionary,omitempty"` + // SupportedFunctionsExtensionVersions - READ-ONLY; List of supported Functions extension versions. + SupportedFunctionsExtensionVersions *[]string `json:"supportedFunctionsExtensionVersions,omitempty"` + // IsPreview - READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty"` + // IsDeprecated - READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + // IsHidden - READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty"` + // EndOfLifeDate - READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // IsAutoUpdate - READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty"` + // IsEarlyAccess - READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty"` + // IsDefault - READ-ONLY; true if the minor version the default; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppRuntimeSettings. +func (fars FunctionAppRuntimeSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FunctionAppStack function App Stack. +type FunctionAppStack struct { + // Location - READ-ONLY; Function App stack location. + Location *string `json:"location,omitempty"` + // FunctionAppStackProperties - FunctionAppStack resource specific properties + *FunctionAppStackProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppStack. +func (fas FunctionAppStack) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fas.FunctionAppStackProperties != nil { + objectMap["properties"] = fas.FunctionAppStackProperties + } + if fas.Kind != nil { + objectMap["kind"] = fas.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FunctionAppStack struct. +func (fas *FunctionAppStack) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + fas.Location = &location + } + case "properties": + if v != nil { + var functionAppStackProperties FunctionAppStackProperties + err = json.Unmarshal(*v, &functionAppStackProperties) + if err != nil { + return err + } + fas.FunctionAppStackProperties = &functionAppStackProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fas.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fas.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fas.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fas.Type = &typeVar + } + } + } + + return nil +} + +// FunctionAppStackCollection collection of Function app Stacks +type FunctionAppStackCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]FunctionAppStack `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppStackCollection. +func (fasc FunctionAppStackCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fasc.Value != nil { + objectMap["value"] = fasc.Value + } + return json.Marshal(objectMap) +} + +// FunctionAppStackCollectionIterator provides access to a complete listing of FunctionAppStack values. +type FunctionAppStackCollectionIterator struct { + i int + page FunctionAppStackCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FunctionAppStackCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FunctionAppStackCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FunctionAppStackCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FunctionAppStackCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FunctionAppStackCollectionIterator) Response() FunctionAppStackCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FunctionAppStackCollectionIterator) Value() FunctionAppStack { + if !iter.page.NotDone() { + return FunctionAppStack{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FunctionAppStackCollectionIterator type. +func NewFunctionAppStackCollectionIterator(page FunctionAppStackCollectionPage) FunctionAppStackCollectionIterator { + return FunctionAppStackCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fasc FunctionAppStackCollection) IsEmpty() bool { + return fasc.Value == nil || len(*fasc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fasc FunctionAppStackCollection) hasNextLink() bool { + return fasc.NextLink != nil && len(*fasc.NextLink) != 0 +} + +// functionAppStackCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fasc FunctionAppStackCollection) functionAppStackCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fasc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fasc.NextLink))) +} + +// FunctionAppStackCollectionPage contains a page of FunctionAppStack values. +type FunctionAppStackCollectionPage struct { + fn func(context.Context, FunctionAppStackCollection) (FunctionAppStackCollection, error) + fasc FunctionAppStackCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FunctionAppStackCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FunctionAppStackCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fasc) + if err != nil { + return err + } + page.fasc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FunctionAppStackCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FunctionAppStackCollectionPage) NotDone() bool { + return !page.fasc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FunctionAppStackCollectionPage) Response() FunctionAppStackCollection { + return page.fasc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FunctionAppStackCollectionPage) Values() []FunctionAppStack { + if page.fasc.IsEmpty() { + return nil + } + return *page.fasc.Value +} + +// Creates a new instance of the FunctionAppStackCollectionPage type. +func NewFunctionAppStackCollectionPage(cur FunctionAppStackCollection, getNextPage func(context.Context, FunctionAppStackCollection) (FunctionAppStackCollection, error)) FunctionAppStackCollectionPage { + return FunctionAppStackCollectionPage{ + fn: getNextPage, + fasc: cur, + } +} + +// FunctionAppStackProperties functionAppStack resource specific properties +type FunctionAppStackProperties struct { + // DisplayText - READ-ONLY; Function App stack (display only). + DisplayText *string `json:"displayText,omitempty"` + // Value - READ-ONLY; Function App stack name. + Value *string `json:"value,omitempty"` + // MajorVersions - READ-ONLY; List of major versions available. + MajorVersions *[]FunctionAppMajorVersion `json:"majorVersions,omitempty"` + // PreferredOs - READ-ONLY; Function App stack preferred OS. Possible values include: 'StackPreferredOsWindows', 'StackPreferredOsLinux' + PreferredOs StackPreferredOs `json:"preferredOs,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionAppStackProperties. +func (fas FunctionAppStackProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// FunctionEnvelope function information. +type FunctionEnvelope struct { + autorest.Response `json:"-"` + // FunctionEnvelopeProperties - FunctionEnvelope resource specific properties + *FunctionEnvelopeProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionEnvelope. +func (fe FunctionEnvelope) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.FunctionEnvelopeProperties != nil { + objectMap["properties"] = fe.FunctionEnvelopeProperties + } + if fe.Kind != nil { + objectMap["kind"] = fe.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for FunctionEnvelope struct. +func (fe *FunctionEnvelope) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var functionEnvelopeProperties FunctionEnvelopeProperties + err = json.Unmarshal(*v, &functionEnvelopeProperties) + if err != nil { + return err + } + fe.FunctionEnvelopeProperties = &functionEnvelopeProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + fe.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fe.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + fe.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fe.Type = &typeVar + } + } + } + + return nil +} + +// FunctionEnvelopeCollection collection of Kudu function information elements. +type FunctionEnvelopeCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]FunctionEnvelope `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionEnvelopeCollection. +func (fec FunctionEnvelopeCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fec.Value != nil { + objectMap["value"] = fec.Value + } + return json.Marshal(objectMap) +} + +// FunctionEnvelopeCollectionIterator provides access to a complete listing of FunctionEnvelope values. +type FunctionEnvelopeCollectionIterator struct { + i int + page FunctionEnvelopeCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *FunctionEnvelopeCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FunctionEnvelopeCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *FunctionEnvelopeCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter FunctionEnvelopeCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter FunctionEnvelopeCollectionIterator) Response() FunctionEnvelopeCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter FunctionEnvelopeCollectionIterator) Value() FunctionEnvelope { + if !iter.page.NotDone() { + return FunctionEnvelope{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the FunctionEnvelopeCollectionIterator type. +func NewFunctionEnvelopeCollectionIterator(page FunctionEnvelopeCollectionPage) FunctionEnvelopeCollectionIterator { + return FunctionEnvelopeCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (fec FunctionEnvelopeCollection) IsEmpty() bool { + return fec.Value == nil || len(*fec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (fec FunctionEnvelopeCollection) hasNextLink() bool { + return fec.NextLink != nil && len(*fec.NextLink) != 0 +} + +// functionEnvelopeCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (fec FunctionEnvelopeCollection) functionEnvelopeCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !fec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(fec.NextLink))) +} + +// FunctionEnvelopeCollectionPage contains a page of FunctionEnvelope values. +type FunctionEnvelopeCollectionPage struct { + fn func(context.Context, FunctionEnvelopeCollection) (FunctionEnvelopeCollection, error) + fec FunctionEnvelopeCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *FunctionEnvelopeCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/FunctionEnvelopeCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.fec) + if err != nil { + return err + } + page.fec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *FunctionEnvelopeCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page FunctionEnvelopeCollectionPage) NotDone() bool { + return !page.fec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page FunctionEnvelopeCollectionPage) Response() FunctionEnvelopeCollection { + return page.fec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page FunctionEnvelopeCollectionPage) Values() []FunctionEnvelope { + if page.fec.IsEmpty() { + return nil + } + return *page.fec.Value +} + +// Creates a new instance of the FunctionEnvelopeCollectionPage type. +func NewFunctionEnvelopeCollectionPage(cur FunctionEnvelopeCollection, getNextPage func(context.Context, FunctionEnvelopeCollection) (FunctionEnvelopeCollection, error)) FunctionEnvelopeCollectionPage { + return FunctionEnvelopeCollectionPage{ + fn: getNextPage, + fec: cur, + } +} + +// FunctionEnvelopeProperties functionEnvelope resource specific properties +type FunctionEnvelopeProperties struct { + // FunctionAppID - Function App ID. + FunctionAppID *string `json:"function_app_id,omitempty"` + // ScriptRootPathHref - Script root path URI. + ScriptRootPathHref *string `json:"script_root_path_href,omitempty"` + // ScriptHref - Script URI. + ScriptHref *string `json:"script_href,omitempty"` + // ConfigHref - Config URI. + ConfigHref *string `json:"config_href,omitempty"` + // TestDataHref - Test data URI. + TestDataHref *string `json:"test_data_href,omitempty"` + // SecretsFileHref - Secrets file URI. + SecretsFileHref *string `json:"secrets_file_href,omitempty"` + // Href - Function URI. + Href *string `json:"href,omitempty"` + // Config - Config information. + Config interface{} `json:"config,omitempty"` + // Files - File list. + Files map[string]*string `json:"files"` + // TestData - Test data used when testing via the Azure Portal. + TestData *string `json:"test_data,omitempty"` + // InvokeURLTemplate - The invocation URL + InvokeURLTemplate *string `json:"invoke_url_template,omitempty"` + // Language - The function language + Language *string `json:"language,omitempty"` + // IsDisabled - Gets or sets a value indicating whether the function is disabled + IsDisabled *bool `json:"isDisabled,omitempty"` +} + +// MarshalJSON is the custom marshaler for FunctionEnvelopeProperties. +func (fe FunctionEnvelopeProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if fe.FunctionAppID != nil { + objectMap["function_app_id"] = fe.FunctionAppID + } + if fe.ScriptRootPathHref != nil { + objectMap["script_root_path_href"] = fe.ScriptRootPathHref + } + if fe.ScriptHref != nil { + objectMap["script_href"] = fe.ScriptHref + } + if fe.ConfigHref != nil { + objectMap["config_href"] = fe.ConfigHref + } + if fe.TestDataHref != nil { + objectMap["test_data_href"] = fe.TestDataHref + } + if fe.SecretsFileHref != nil { + objectMap["secrets_file_href"] = fe.SecretsFileHref + } + if fe.Href != nil { + objectMap["href"] = fe.Href + } + if fe.Config != nil { + objectMap["config"] = fe.Config + } + if fe.Files != nil { + objectMap["files"] = fe.Files + } + if fe.TestData != nil { + objectMap["test_data"] = fe.TestData + } + if fe.InvokeURLTemplate != nil { + objectMap["invoke_url_template"] = fe.InvokeURLTemplate + } + if fe.Language != nil { + objectMap["language"] = fe.Language + } + if fe.IsDisabled != nil { + objectMap["isDisabled"] = fe.IsDisabled + } + return json.Marshal(objectMap) +} + +// FunctionSecrets function secrets. +type FunctionSecrets struct { + autorest.Response `json:"-"` + // Key - Secret key. + Key *string `json:"key,omitempty"` + // TriggerURL - Trigger URL. + TriggerURL *string `json:"trigger_url,omitempty"` +} + +// GeoRegion geographical region. +type GeoRegion struct { + // GeoRegionProperties - GeoRegion resource specific properties + *GeoRegionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for GeoRegion. +func (gr GeoRegion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gr.GeoRegionProperties != nil { + objectMap["properties"] = gr.GeoRegionProperties + } + if gr.Kind != nil { + objectMap["kind"] = gr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for GeoRegion struct. +func (gr *GeoRegion) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var geoRegionProperties GeoRegionProperties + err = json.Unmarshal(*v, &geoRegionProperties) + if err != nil { + return err + } + gr.GeoRegionProperties = &geoRegionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + gr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + gr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + gr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + gr.Type = &typeVar + } + } + } + + return nil +} + +// GeoRegionCollection collection of geographical regions. +type GeoRegionCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]GeoRegion `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for GeoRegionCollection. +func (grc GeoRegionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if grc.Value != nil { + objectMap["value"] = grc.Value + } + return json.Marshal(objectMap) +} + +// GeoRegionCollectionIterator provides access to a complete listing of GeoRegion values. +type GeoRegionCollectionIterator struct { + i int + page GeoRegionCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *GeoRegionCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GeoRegionCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *GeoRegionCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter GeoRegionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter GeoRegionCollectionIterator) Response() GeoRegionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter GeoRegionCollectionIterator) Value() GeoRegion { + if !iter.page.NotDone() { + return GeoRegion{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the GeoRegionCollectionIterator type. +func NewGeoRegionCollectionIterator(page GeoRegionCollectionPage) GeoRegionCollectionIterator { + return GeoRegionCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (grc GeoRegionCollection) IsEmpty() bool { + return grc.Value == nil || len(*grc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (grc GeoRegionCollection) hasNextLink() bool { + return grc.NextLink != nil && len(*grc.NextLink) != 0 +} + +// geoRegionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (grc GeoRegionCollection) geoRegionCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !grc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(grc.NextLink))) +} + +// GeoRegionCollectionPage contains a page of GeoRegion values. +type GeoRegionCollectionPage struct { + fn func(context.Context, GeoRegionCollection) (GeoRegionCollection, error) + grc GeoRegionCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *GeoRegionCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/GeoRegionCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.grc) + if err != nil { + return err + } + page.grc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *GeoRegionCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page GeoRegionCollectionPage) NotDone() bool { + return !page.grc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page GeoRegionCollectionPage) Response() GeoRegionCollection { + return page.grc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page GeoRegionCollectionPage) Values() []GeoRegion { + if page.grc.IsEmpty() { + return nil + } + return *page.grc.Value +} + +// Creates a new instance of the GeoRegionCollectionPage type. +func NewGeoRegionCollectionPage(cur GeoRegionCollection, getNextPage func(context.Context, GeoRegionCollection) (GeoRegionCollection, error)) GeoRegionCollectionPage { + return GeoRegionCollectionPage{ + fn: getNextPage, + grc: cur, + } +} + +// GeoRegionProperties geoRegion resource specific properties +type GeoRegionProperties struct { + // Description - READ-ONLY; Region description. + Description *string `json:"description,omitempty"` + // DisplayName - READ-ONLY; Display name for region. + DisplayName *string `json:"displayName,omitempty"` + // OrgDomain - READ-ONLY; Display name for region. + OrgDomain *string `json:"orgDomain,omitempty"` +} + +// MarshalJSON is the custom marshaler for GeoRegionProperties. +func (gr GeoRegionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GitHub the configuration settings of the GitHub provider. +type GitHub struct { + // Enabled - false if the GitHub provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the app registration for the GitHub provider. + Registration *ClientRegistration `json:"registration,omitempty"` + // Login - The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` +} + +// GitHubActionCodeConfiguration the GitHub action code configuration. +type GitHubActionCodeConfiguration struct { + // RuntimeStack - Runtime stack is used to determine the workflow file content for code base apps. + RuntimeStack *string `json:"runtimeStack,omitempty"` + // RuntimeVersion - Runtime version is used to determine what build version to set in the workflow file. + RuntimeVersion *string `json:"runtimeVersion,omitempty"` +} + +// GitHubActionConfiguration the GitHub action configuration. +type GitHubActionConfiguration struct { + // CodeConfiguration - GitHub Action code configuration. + CodeConfiguration *GitHubActionCodeConfiguration `json:"codeConfiguration,omitempty"` + // ContainerConfiguration - GitHub Action container configuration. + ContainerConfiguration *GitHubActionContainerConfiguration `json:"containerConfiguration,omitempty"` + // IsLinux - This will help determine the workflow configuration to select. + IsLinux *bool `json:"isLinux,omitempty"` + // GenerateWorkflowFile - Workflow option to determine whether the workflow file should be generated and written to the repository. + GenerateWorkflowFile *bool `json:"generateWorkflowFile,omitempty"` +} + +// GitHubActionContainerConfiguration the GitHub action container configuration. +type GitHubActionContainerConfiguration struct { + // ServerURL - The server URL for the container registry where the build will be hosted. + ServerURL *string `json:"serverUrl,omitempty"` + // ImageName - The image name for the build. + ImageName *string `json:"imageName,omitempty"` + // Username - The username used to upload the image to the container registry. + Username *string `json:"username,omitempty"` + // Password - The password used to upload the image to the container registry. + Password *string `json:"password,omitempty"` +} + +// GitHubActionWebAppStackSettings gitHub Actions Web App stack settings. +type GitHubActionWebAppStackSettings struct { + // IsSupported - READ-ONLY; true if GitHub Actions is supported for the stack; otherwise, false. + IsSupported *bool `json:"isSupported,omitempty"` + // SupportedVersion - READ-ONLY; The minor version that is supported for GitHub Actions. + SupportedVersion *string `json:"supportedVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for GitHubActionWebAppStackSettings. +func (ghawass GitHubActionWebAppStackSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// GlobalCsmSkuDescription a Global SKU Description. +type GlobalCsmSkuDescription struct { + // Name - Name of the resource SKU. + Name *string `json:"name,omitempty"` + // Tier - Service Tier of the resource SKU. + Tier *string `json:"tier,omitempty"` + // Size - Size specifier of the resource SKU. + Size *string `json:"size,omitempty"` + // Family - Family code of the resource SKU. + Family *string `json:"family,omitempty"` + // Capacity - Min, max, and default scale values of the SKU. + Capacity *SkuCapacity `json:"capacity,omitempty"` + // Locations - Locations of the SKU. + Locations *[]string `json:"locations,omitempty"` + // Capabilities - Capabilities of the SKU, e.g., is traffic manager enabled? + Capabilities *[]Capability `json:"capabilities,omitempty"` +} + +// GlobalValidation the configuration settings that determines the validation flow of users using App +// Service Authentication/Authorization. +type GlobalValidation struct { + // RequireAuthentication - true if the authentication flow is required any request is made; otherwise, false. + RequireAuthentication *bool `json:"requireAuthentication,omitempty"` + // UnauthenticatedClientAction - The action to take when an unauthenticated client attempts to access the app. Possible values include: 'UnauthenticatedClientActionV2RedirectToLoginPage', 'UnauthenticatedClientActionV2AllowAnonymous', 'UnauthenticatedClientActionV2Return401', 'UnauthenticatedClientActionV2Return403' + UnauthenticatedClientAction UnauthenticatedClientActionV2 `json:"unauthenticatedClientAction,omitempty"` + // RedirectToProvider - The default authentication provider to use when multiple providers are configured. + // This setting is only needed if multiple providers are configured and the unauthenticated client + // action is set to "RedirectToLoginPage". + RedirectToProvider *string `json:"redirectToProvider,omitempty"` + // ExcludedPaths - The paths for which unauthenticated flow would not be redirected to the login page. + ExcludedPaths *[]string `json:"excludedPaths,omitempty"` +} + +// Google the configuration settings of the Google provider. +type Google struct { + // Enabled - false if the Google provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the app registration for the Google provider. + Registration *ClientRegistration `json:"registration,omitempty"` + // Login - The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + // Validation - The configuration settings of the Azure Active Directory token validation flow. + Validation *AllowedAudiencesValidation `json:"validation,omitempty"` +} + +// HandlerMapping the IIS handler mappings used to define which handler processes HTTP requests with +// certain extension. +// For example, it is used to configure php-cgi.exe process to handle all HTTP requests with *.php +// extension. +type HandlerMapping struct { + // Extension - Requests with this extension will be handled using the specified FastCGI application. + Extension *string `json:"extension,omitempty"` + // ScriptProcessor - The absolute path to the FastCGI application. + ScriptProcessor *string `json:"scriptProcessor,omitempty"` + // Arguments - Command-line arguments to be passed to the script processor. + Arguments *string `json:"arguments,omitempty"` +} + +// HostingEnvironmentDeploymentInfo information needed to create resources on an App Service Environment. +type HostingEnvironmentDeploymentInfo struct { + // Name - Name of the App Service Environment. + Name *string `json:"name,omitempty"` + // Location - Location of the App Service Environment. + Location *string `json:"location,omitempty"` +} + +// HostingEnvironmentDiagnostics diagnostics for an App Service Environment. +type HostingEnvironmentDiagnostics struct { + autorest.Response `json:"-"` + // Name - Name/identifier of the diagnostics. + Name *string `json:"name,omitempty"` + // DiagnosticsOutput - Diagnostics output. + DiagnosticsOutput *string `json:"diagnosticsOutput,omitempty"` +} + +// HostingEnvironmentProfile specification for an App Service Environment to use for this resource. +type HostingEnvironmentProfile struct { + // ID - Resource ID of the App Service Environment. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the App Service Environment. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type of the App Service Environment. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostingEnvironmentProfile. +func (hep HostingEnvironmentProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hep.ID != nil { + objectMap["id"] = hep.ID + } + return json.Marshal(objectMap) +} + +// HostKeys functions host level keys. +type HostKeys struct { + autorest.Response `json:"-"` + // MasterKey - Secret key. + MasterKey *string `json:"masterKey,omitempty"` + // FunctionKeys - Host level function keys. + FunctionKeys map[string]*string `json:"functionKeys"` + // SystemKeys - System keys. + SystemKeys map[string]*string `json:"systemKeys"` +} + +// MarshalJSON is the custom marshaler for HostKeys. +func (hk HostKeys) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hk.MasterKey != nil { + objectMap["masterKey"] = hk.MasterKey + } + if hk.FunctionKeys != nil { + objectMap["functionKeys"] = hk.FunctionKeys + } + if hk.SystemKeys != nil { + objectMap["systemKeys"] = hk.SystemKeys + } + return json.Marshal(objectMap) +} + +// HostName details of a hostname derived from a domain. +type HostName struct { + // Name - Name of the hostname. + Name *string `json:"name,omitempty"` + // SiteNames - List of apps the hostname is assigned to. This list will have more than one app only if the hostname is pointing to a Traffic Manager. + SiteNames *[]string `json:"siteNames,omitempty"` + // AzureResourceName - Name of the Azure resource the hostname is assigned to. If it is assigned to a Traffic Manager then it will be the Traffic Manager name otherwise it will be the app name. + AzureResourceName *string `json:"azureResourceName,omitempty"` + // AzureResourceType - Type of the Azure resource the hostname is assigned to. Possible values include: 'AzureResourceTypeWebsite', 'AzureResourceTypeTrafficManager' + AzureResourceType AzureResourceType `json:"azureResourceType,omitempty"` + // CustomHostNameDNSRecordType - Type of the DNS record. Possible values include: 'CustomHostNameDNSRecordTypeCName', 'CustomHostNameDNSRecordTypeA' + CustomHostNameDNSRecordType CustomHostNameDNSRecordType `json:"customHostNameDnsRecordType,omitempty"` + // HostNameType - Type of the hostname. Possible values include: 'HostNameTypeVerified', 'HostNameTypeManaged' + HostNameType HostNameType `json:"hostNameType,omitempty"` +} + +// HostNameBinding a hostname binding object. +type HostNameBinding struct { + autorest.Response `json:"-"` + // HostNameBindingProperties - HostNameBinding resource specific properties + *HostNameBindingProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostNameBinding. +func (hnb HostNameBinding) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hnb.HostNameBindingProperties != nil { + objectMap["properties"] = hnb.HostNameBindingProperties + } + if hnb.Kind != nil { + objectMap["kind"] = hnb.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HostNameBinding struct. +func (hnb *HostNameBinding) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hostNameBindingProperties HostNameBindingProperties + err = json.Unmarshal(*v, &hostNameBindingProperties) + if err != nil { + return err + } + hnb.HostNameBindingProperties = &hostNameBindingProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hnb.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hnb.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hnb.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hnb.Type = &typeVar + } + } + } + + return nil +} + +// HostNameBindingCollection collection of hostname bindings. +type HostNameBindingCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]HostNameBinding `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostNameBindingCollection. +func (hnbc HostNameBindingCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hnbc.Value != nil { + objectMap["value"] = hnbc.Value + } + return json.Marshal(objectMap) +} + +// HostNameBindingCollectionIterator provides access to a complete listing of HostNameBinding values. +type HostNameBindingCollectionIterator struct { + i int + page HostNameBindingCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *HostNameBindingCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostNameBindingCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *HostNameBindingCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HostNameBindingCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter HostNameBindingCollectionIterator) Response() HostNameBindingCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter HostNameBindingCollectionIterator) Value() HostNameBinding { + if !iter.page.NotDone() { + return HostNameBinding{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the HostNameBindingCollectionIterator type. +func NewHostNameBindingCollectionIterator(page HostNameBindingCollectionPage) HostNameBindingCollectionIterator { + return HostNameBindingCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (hnbc HostNameBindingCollection) IsEmpty() bool { + return hnbc.Value == nil || len(*hnbc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (hnbc HostNameBindingCollection) hasNextLink() bool { + return hnbc.NextLink != nil && len(*hnbc.NextLink) != 0 +} + +// hostNameBindingCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hnbc HostNameBindingCollection) hostNameBindingCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !hnbc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hnbc.NextLink))) +} + +// HostNameBindingCollectionPage contains a page of HostNameBinding values. +type HostNameBindingCollectionPage struct { + fn func(context.Context, HostNameBindingCollection) (HostNameBindingCollection, error) + hnbc HostNameBindingCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *HostNameBindingCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HostNameBindingCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.hnbc) + if err != nil { + return err + } + page.hnbc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *HostNameBindingCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HostNameBindingCollectionPage) NotDone() bool { + return !page.hnbc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HostNameBindingCollectionPage) Response() HostNameBindingCollection { + return page.hnbc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HostNameBindingCollectionPage) Values() []HostNameBinding { + if page.hnbc.IsEmpty() { + return nil + } + return *page.hnbc.Value +} + +// Creates a new instance of the HostNameBindingCollectionPage type. +func NewHostNameBindingCollectionPage(cur HostNameBindingCollection, getNextPage func(context.Context, HostNameBindingCollection) (HostNameBindingCollection, error)) HostNameBindingCollectionPage { + return HostNameBindingCollectionPage{ + fn: getNextPage, + hnbc: cur, + } +} + +// HostNameBindingProperties hostNameBinding resource specific properties +type HostNameBindingProperties struct { + // SiteName - App Service app name. + SiteName *string `json:"siteName,omitempty"` + // DomainID - Fully qualified ARM domain resource URI. + DomainID *string `json:"domainId,omitempty"` + // AzureResourceName - Azure resource name. + AzureResourceName *string `json:"azureResourceName,omitempty"` + // AzureResourceType - Azure resource type. Possible values include: 'AzureResourceTypeWebsite', 'AzureResourceTypeTrafficManager' + AzureResourceType AzureResourceType `json:"azureResourceType,omitempty"` + // CustomHostNameDNSRecordType - Custom DNS record type. Possible values include: 'CustomHostNameDNSRecordTypeCName', 'CustomHostNameDNSRecordTypeA' + CustomHostNameDNSRecordType CustomHostNameDNSRecordType `json:"customHostNameDnsRecordType,omitempty"` + // HostNameType - Hostname type. Possible values include: 'HostNameTypeVerified', 'HostNameTypeManaged' + HostNameType HostNameType `json:"hostNameType,omitempty"` + // SslState - SSL type. Possible values include: 'SslStateDisabled', 'SslStateSniEnabled', 'SslStateIPBasedEnabled' + SslState SslState `json:"sslState,omitempty"` + // Thumbprint - SSL certificate thumbprint + Thumbprint *string `json:"thumbprint,omitempty"` + // VirtualIP - READ-ONLY; Virtual IP address assigned to the hostname if IP based SSL is enabled. + VirtualIP *string `json:"virtualIP,omitempty"` +} + +// MarshalJSON is the custom marshaler for HostNameBindingProperties. +func (hnb HostNameBindingProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hnb.SiteName != nil { + objectMap["siteName"] = hnb.SiteName + } + if hnb.DomainID != nil { + objectMap["domainId"] = hnb.DomainID + } + if hnb.AzureResourceName != nil { + objectMap["azureResourceName"] = hnb.AzureResourceName + } + if hnb.AzureResourceType != "" { + objectMap["azureResourceType"] = hnb.AzureResourceType + } + if hnb.CustomHostNameDNSRecordType != "" { + objectMap["customHostNameDnsRecordType"] = hnb.CustomHostNameDNSRecordType + } + if hnb.HostNameType != "" { + objectMap["hostNameType"] = hnb.HostNameType + } + if hnb.SslState != "" { + objectMap["sslState"] = hnb.SslState + } + if hnb.Thumbprint != nil { + objectMap["thumbprint"] = hnb.Thumbprint + } + return json.Marshal(objectMap) +} + +// HostNameSslState SSL-enabled hostname. +type HostNameSslState struct { + // Name - Hostname. + Name *string `json:"name,omitempty"` + // SslState - SSL type. Possible values include: 'SslStateDisabled', 'SslStateSniEnabled', 'SslStateIPBasedEnabled' + SslState SslState `json:"sslState,omitempty"` + // VirtualIP - Virtual IP address assigned to the hostname if IP based SSL is enabled. + VirtualIP *string `json:"virtualIP,omitempty"` + // Thumbprint - SSL certificate thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + // ToUpdate - Set to true to update existing hostname. + ToUpdate *bool `json:"toUpdate,omitempty"` + // HostType - Indicates whether the hostname is a standard or repository hostname. Possible values include: 'HostTypeStandard', 'HostTypeRepository' + HostType HostType `json:"hostType,omitempty"` +} + +// HTTPLogsConfig http logs configuration. +type HTTPLogsConfig struct { + // FileSystem - Http logs to file system configuration. + FileSystem *FileSystemHTTPLogsConfig `json:"fileSystem,omitempty"` + // AzureBlobStorage - Http logs to azure blob storage configuration. + AzureBlobStorage *AzureBlobStorageHTTPLogsConfig `json:"azureBlobStorage,omitempty"` +} + +// HTTPScaleRule container App container Custom scaling rule. +type HTTPScaleRule struct { + // Metadata - Metadata properties to describe http scale rule. + Metadata map[string]*string `json:"metadata"` + // Auth - Authentication secrets for the custom scale rule. + Auth *[]ScaleRuleAuth `json:"auth,omitempty"` +} + +// MarshalJSON is the custom marshaler for HTTPScaleRule. +func (hsr HTTPScaleRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hsr.Metadata != nil { + objectMap["metadata"] = hsr.Metadata + } + if hsr.Auth != nil { + objectMap["auth"] = hsr.Auth + } + return json.Marshal(objectMap) +} + +// HTTPSettings the configuration settings of the HTTP requests for authentication and authorization +// requests made against App Service Authentication/Authorization. +type HTTPSettings struct { + // RequireHTTPS - false if the authentication/authorization responses not having the HTTPS scheme are permissible; otherwise, true. + RequireHTTPS *bool `json:"requireHttps,omitempty"` + // Routes - The configuration settings of the paths HTTP requests. + Routes *HTTPSettingsRoutes `json:"routes,omitempty"` + // ForwardProxy - The configuration settings of a forward proxy used to make the requests. + ForwardProxy *ForwardProxy `json:"forwardProxy,omitempty"` +} + +// HTTPSettingsRoutes the configuration settings of the paths HTTP requests. +type HTTPSettingsRoutes struct { + // APIPrefix - The prefix that should precede all the authentication/authorization paths. + APIPrefix *string `json:"apiPrefix,omitempty"` +} + +// HybridConnection hybrid Connection contract. This is used to configure a Hybrid Connection. +type HybridConnection struct { + autorest.Response `json:"-"` + // HybridConnectionProperties - HybridConnection resource specific properties + *HybridConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridConnection. +func (hc HybridConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hc.HybridConnectionProperties != nil { + objectMap["properties"] = hc.HybridConnectionProperties + } + if hc.Kind != nil { + objectMap["kind"] = hc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HybridConnection struct. +func (hc *HybridConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hybridConnectionProperties HybridConnectionProperties + err = json.Unmarshal(*v, &hybridConnectionProperties) + if err != nil { + return err + } + hc.HybridConnectionProperties = &hybridConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hc.Type = &typeVar + } + } + } + + return nil +} + +// HybridConnectionCollection collection of hostname bindings. +type HybridConnectionCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]HybridConnection `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionCollection. +func (hcc HybridConnectionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hcc.Value != nil { + objectMap["value"] = hcc.Value + } + return json.Marshal(objectMap) +} + +// HybridConnectionCollectionIterator provides access to a complete listing of HybridConnection values. +type HybridConnectionCollectionIterator struct { + i int + page HybridConnectionCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *HybridConnectionCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridConnectionCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *HybridConnectionCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter HybridConnectionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter HybridConnectionCollectionIterator) Response() HybridConnectionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter HybridConnectionCollectionIterator) Value() HybridConnection { + if !iter.page.NotDone() { + return HybridConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the HybridConnectionCollectionIterator type. +func NewHybridConnectionCollectionIterator(page HybridConnectionCollectionPage) HybridConnectionCollectionIterator { + return HybridConnectionCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (hcc HybridConnectionCollection) IsEmpty() bool { + return hcc.Value == nil || len(*hcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (hcc HybridConnectionCollection) hasNextLink() bool { + return hcc.NextLink != nil && len(*hcc.NextLink) != 0 +} + +// hybridConnectionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (hcc HybridConnectionCollection) hybridConnectionCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !hcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(hcc.NextLink))) +} + +// HybridConnectionCollectionPage contains a page of HybridConnection values. +type HybridConnectionCollectionPage struct { + fn func(context.Context, HybridConnectionCollection) (HybridConnectionCollection, error) + hcc HybridConnectionCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *HybridConnectionCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/HybridConnectionCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.hcc) + if err != nil { + return err + } + page.hcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *HybridConnectionCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page HybridConnectionCollectionPage) NotDone() bool { + return !page.hcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page HybridConnectionCollectionPage) Response() HybridConnectionCollection { + return page.hcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page HybridConnectionCollectionPage) Values() []HybridConnection { + if page.hcc.IsEmpty() { + return nil + } + return *page.hcc.Value +} + +// Creates a new instance of the HybridConnectionCollectionPage type. +func NewHybridConnectionCollectionPage(cur HybridConnectionCollection, getNextPage func(context.Context, HybridConnectionCollection) (HybridConnectionCollection, error)) HybridConnectionCollectionPage { + return HybridConnectionCollectionPage{ + fn: getNextPage, + hcc: cur, + } +} + +// HybridConnectionKey hybrid Connection key contract. This has the send key name and value for a Hybrid +// Connection. +type HybridConnectionKey struct { + autorest.Response `json:"-"` + // HybridConnectionKeyProperties - HybridConnectionKey resource specific properties + *HybridConnectionKeyProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionKey. +func (hck HybridConnectionKey) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hck.HybridConnectionKeyProperties != nil { + objectMap["properties"] = hck.HybridConnectionKeyProperties + } + if hck.Kind != nil { + objectMap["kind"] = hck.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HybridConnectionKey struct. +func (hck *HybridConnectionKey) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hybridConnectionKeyProperties HybridConnectionKeyProperties + err = json.Unmarshal(*v, &hybridConnectionKeyProperties) + if err != nil { + return err + } + hck.HybridConnectionKeyProperties = &hybridConnectionKeyProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hck.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hck.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hck.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hck.Type = &typeVar + } + } + } + + return nil +} + +// HybridConnectionKeyProperties hybridConnectionKey resource specific properties +type HybridConnectionKeyProperties struct { + // SendKeyName - READ-ONLY; The name of the send key. + SendKeyName *string `json:"sendKeyName,omitempty"` + // SendKeyValue - READ-ONLY; The value of the send key. + SendKeyValue *string `json:"sendKeyValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionKeyProperties. +func (hck HybridConnectionKeyProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HybridConnectionLimits hybrid Connection limits contract. This is used to return the plan limits of +// Hybrid Connections. +type HybridConnectionLimits struct { + autorest.Response `json:"-"` + // HybridConnectionLimitsProperties - HybridConnectionLimits resource specific properties + *HybridConnectionLimitsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionLimits. +func (hcl HybridConnectionLimits) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if hcl.HybridConnectionLimitsProperties != nil { + objectMap["properties"] = hcl.HybridConnectionLimitsProperties + } + if hcl.Kind != nil { + objectMap["kind"] = hcl.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for HybridConnectionLimits struct. +func (hcl *HybridConnectionLimits) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var hybridConnectionLimitsProperties HybridConnectionLimitsProperties + err = json.Unmarshal(*v, &hybridConnectionLimitsProperties) + if err != nil { + return err + } + hcl.HybridConnectionLimitsProperties = &hybridConnectionLimitsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + hcl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + hcl.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + hcl.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + hcl.Type = &typeVar + } + } + } + + return nil +} + +// HybridConnectionLimitsProperties hybridConnectionLimits resource specific properties +type HybridConnectionLimitsProperties struct { + // Current - READ-ONLY; The current number of Hybrid Connections. + Current *int32 `json:"current,omitempty"` + // Maximum - READ-ONLY; The maximum number of Hybrid Connections allowed. + Maximum *int32 `json:"maximum,omitempty"` +} + +// MarshalJSON is the custom marshaler for HybridConnectionLimitsProperties. +func (hcl HybridConnectionLimitsProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// HybridConnectionProperties hybridConnection resource specific properties +type HybridConnectionProperties struct { + // ServiceBusNamespace - The name of the Service Bus namespace. + ServiceBusNamespace *string `json:"serviceBusNamespace,omitempty"` + // RelayName - The name of the Service Bus relay. + RelayName *string `json:"relayName,omitempty"` + // RelayArmURI - The ARM URI to the Service Bus relay. + RelayArmURI *string `json:"relayArmUri,omitempty"` + // Hostname - The hostname of the endpoint. + Hostname *string `json:"hostname,omitempty"` + // Port - The port of the endpoint. + Port *int32 `json:"port,omitempty"` + // SendKeyName - The name of the Service Bus key which has Send permissions. This is used to authenticate to Service Bus. + SendKeyName *string `json:"sendKeyName,omitempty"` + // SendKeyValue - The value of the Service Bus key. This is used to authenticate to Service Bus. In ARM this key will not be returned + // normally, use the POST /listKeys API instead. + SendKeyValue *string `json:"sendKeyValue,omitempty"` + // ServiceBusSuffix - The suffix for the service bus endpoint. By default this is .servicebus.windows.net + ServiceBusSuffix *string `json:"serviceBusSuffix,omitempty"` +} + +// Identifier a domain specific resource identifier. +type Identifier struct { + autorest.Response `json:"-"` + // IdentifierProperties - Identifier resource specific properties + *IdentifierProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Identifier. +func (i Identifier) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.IdentifierProperties != nil { + objectMap["properties"] = i.IdentifierProperties + } + if i.Kind != nil { + objectMap["kind"] = i.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Identifier struct. +func (i *Identifier) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var identifierProperties IdentifierProperties + err = json.Unmarshal(*v, &identifierProperties) + if err != nil { + return err + } + i.IdentifierProperties = &identifierProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + i.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + } + } + + return nil +} + +// IdentifierCollection collection of identifiers. +type IdentifierCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Identifier `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IdentifierCollection. +func (ic IdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ic.Value != nil { + objectMap["value"] = ic.Value + } + return json.Marshal(objectMap) +} + +// IdentifierCollectionIterator provides access to a complete listing of Identifier values. +type IdentifierCollectionIterator struct { + i int + page IdentifierCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IdentifierCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentifierCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IdentifierCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IdentifierCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IdentifierCollectionIterator) Response() IdentifierCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IdentifierCollectionIterator) Value() Identifier { + if !iter.page.NotDone() { + return Identifier{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IdentifierCollectionIterator type. +func NewIdentifierCollectionIterator(page IdentifierCollectionPage) IdentifierCollectionIterator { + return IdentifierCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ic IdentifierCollection) IsEmpty() bool { + return ic.Value == nil || len(*ic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ic IdentifierCollection) hasNextLink() bool { + return ic.NextLink != nil && len(*ic.NextLink) != 0 +} + +// identifierCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ic IdentifierCollection) identifierCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ic.NextLink))) +} + +// IdentifierCollectionPage contains a page of Identifier values. +type IdentifierCollectionPage struct { + fn func(context.Context, IdentifierCollection) (IdentifierCollection, error) + ic IdentifierCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IdentifierCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IdentifierCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ic) + if err != nil { + return err + } + page.ic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IdentifierCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IdentifierCollectionPage) NotDone() bool { + return !page.ic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IdentifierCollectionPage) Response() IdentifierCollection { + return page.ic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IdentifierCollectionPage) Values() []Identifier { + if page.ic.IsEmpty() { + return nil + } + return *page.ic.Value +} + +// Creates a new instance of the IdentifierCollectionPage type. +func NewIdentifierCollectionPage(cur IdentifierCollection, getNextPage func(context.Context, IdentifierCollection) (IdentifierCollection, error)) IdentifierCollectionPage { + return IdentifierCollectionPage{ + fn: getNextPage, + ic: cur, + } +} + +// IdentifierProperties identifier resource specific properties +type IdentifierProperties struct { + // Value - String representation of the identity. + Value *string `json:"id,omitempty"` +} + +// IdentityProviders the configuration settings of each of the identity providers used to configure App +// Service Authentication/Authorization. +type IdentityProviders struct { + // AzureActiveDirectory - The configuration settings of the Azure Active directory provider. + AzureActiveDirectory *AzureActiveDirectory `json:"azureActiveDirectory,omitempty"` + // Facebook - The configuration settings of the Facebook provider. + Facebook *Facebook `json:"facebook,omitempty"` + // GitHub - The configuration settings of the GitHub provider. + GitHub *GitHub `json:"gitHub,omitempty"` + // Google - The configuration settings of the Google provider. + Google *Google `json:"google,omitempty"` + // LegacyMicrosoftAccount - The configuration settings of the legacy Microsoft Account provider. + LegacyMicrosoftAccount *LegacyMicrosoftAccount `json:"legacyMicrosoftAccount,omitempty"` + // Twitter - The configuration settings of the Twitter provider. + Twitter *Twitter `json:"twitter,omitempty"` + // Apple - The configuration settings of the Apple provider. + Apple *Apple `json:"apple,omitempty"` + // AzureStaticWebApps - The configuration settings of the Azure Static Web Apps provider. + AzureStaticWebApps *AzureStaticWebApps `json:"azureStaticWebApps,omitempty"` + // CustomOpenIDConnectProviders - The map of the name of the alias of each custom Open ID Connect provider to the + // configuration settings of the custom Open ID Connect provider. + CustomOpenIDConnectProviders map[string]*CustomOpenIDConnectProvider `json:"customOpenIdConnectProviders"` +} + +// MarshalJSON is the custom marshaler for IdentityProviders. +func (IP IdentityProviders) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.AzureActiveDirectory != nil { + objectMap["azureActiveDirectory"] = IP.AzureActiveDirectory + } + if IP.Facebook != nil { + objectMap["facebook"] = IP.Facebook + } + if IP.GitHub != nil { + objectMap["gitHub"] = IP.GitHub + } + if IP.Google != nil { + objectMap["google"] = IP.Google + } + if IP.LegacyMicrosoftAccount != nil { + objectMap["legacyMicrosoftAccount"] = IP.LegacyMicrosoftAccount + } + if IP.Twitter != nil { + objectMap["twitter"] = IP.Twitter + } + if IP.Apple != nil { + objectMap["apple"] = IP.Apple + } + if IP.AzureStaticWebApps != nil { + objectMap["azureStaticWebApps"] = IP.AzureStaticWebApps + } + if IP.CustomOpenIDConnectProviders != nil { + objectMap["customOpenIdConnectProviders"] = IP.CustomOpenIDConnectProviders + } + return json.Marshal(objectMap) +} + +// InboundEnvironmentEndpoint the IP Addresses and Ports that require inbound network access to and within +// the subnet of the App Service Environment. +type InboundEnvironmentEndpoint struct { + // Description - Short text describing the purpose of the network traffic. + Description *string `json:"description,omitempty"` + // Endpoints - The IP addresses that network traffic will originate from in cidr notation. + Endpoints *[]string `json:"endpoints,omitempty"` + // Ports - The ports that network traffic will arrive to the App Service Environment at. + Ports *[]string `json:"ports,omitempty"` +} + +// InboundEnvironmentEndpointCollection collection of Inbound Environment Endpoints +type InboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]InboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for InboundEnvironmentEndpointCollection. +func (ieec InboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ieec.Value != nil { + objectMap["value"] = ieec.Value + } + return json.Marshal(objectMap) +} + +// InboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// InboundEnvironmentEndpoint values. +type InboundEnvironmentEndpointCollectionIterator struct { + i int + page InboundEnvironmentEndpointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *InboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InboundEnvironmentEndpointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *InboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter InboundEnvironmentEndpointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter InboundEnvironmentEndpointCollectionIterator) Response() InboundEnvironmentEndpointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter InboundEnvironmentEndpointCollectionIterator) Value() InboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return InboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the InboundEnvironmentEndpointCollectionIterator type. +func NewInboundEnvironmentEndpointCollectionIterator(page InboundEnvironmentEndpointCollectionPage) InboundEnvironmentEndpointCollectionIterator { + return InboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ieec InboundEnvironmentEndpointCollection) IsEmpty() bool { + return ieec.Value == nil || len(*ieec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ieec InboundEnvironmentEndpointCollection) hasNextLink() bool { + return ieec.NextLink != nil && len(*ieec.NextLink) != 0 +} + +// inboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ieec InboundEnvironmentEndpointCollection) inboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ieec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ieec.NextLink))) +} + +// InboundEnvironmentEndpointCollectionPage contains a page of InboundEnvironmentEndpoint values. +type InboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error) + ieec InboundEnvironmentEndpointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *InboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/InboundEnvironmentEndpointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ieec) + if err != nil { + return err + } + page.ieec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *InboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page InboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.ieec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page InboundEnvironmentEndpointCollectionPage) Response() InboundEnvironmentEndpointCollection { + return page.ieec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page InboundEnvironmentEndpointCollectionPage) Values() []InboundEnvironmentEndpoint { + if page.ieec.IsEmpty() { + return nil + } + return *page.ieec.Value +} + +// Creates a new instance of the InboundEnvironmentEndpointCollectionPage type. +func NewInboundEnvironmentEndpointCollectionPage(cur InboundEnvironmentEndpointCollection, getNextPage func(context.Context, InboundEnvironmentEndpointCollection) (InboundEnvironmentEndpointCollection, error)) InboundEnvironmentEndpointCollectionPage { + return InboundEnvironmentEndpointCollectionPage{ + fn: getNextPage, + ieec: cur, + } +} + +// Ingress container App Ingress configuration. +type Ingress struct { + // Fqdn - READ-ONLY; Hostname. + Fqdn *string `json:"fqdn,omitempty"` + // External - Bool indicating if app exposes an external http endpoint + External *bool `json:"external,omitempty"` + // TargetPort - Target Port in containers for traffic from ingress + TargetPort *int32 `json:"targetPort,omitempty"` + // Transport - Ingress transport protocol. Possible values include: 'IngressTransportMethodAuto', 'IngressTransportMethodHTTP', 'IngressTransportMethodHTTP2' + Transport IngressTransportMethod `json:"transport,omitempty"` + Traffic *[]TrafficWeight `json:"traffic,omitempty"` + // AllowInsecure - Bool indicating if HTTP connections to is allowed. If set to false HTTP connections are automatically redirected to HTTPS connections + AllowInsecure *bool `json:"allowInsecure,omitempty"` +} + +// MarshalJSON is the custom marshaler for Ingress. +func (i Ingress) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.External != nil { + objectMap["external"] = i.External + } + if i.TargetPort != nil { + objectMap["targetPort"] = i.TargetPort + } + if i.Transport != "" { + objectMap["transport"] = i.Transport + } + if i.Traffic != nil { + objectMap["traffic"] = i.Traffic + } + if i.AllowInsecure != nil { + objectMap["allowInsecure"] = i.AllowInsecure + } + return json.Marshal(objectMap) +} + +// IPSecurityRestriction IP security restriction on an app. +type IPSecurityRestriction struct { + // IPAddress - IP address the security restriction is valid for. + // It can be in form of pure ipv4 address (required SubnetMask property) or + // CIDR notation such as ipv4/mask (leading bit match). For CIDR, + // SubnetMask property must not be specified. + IPAddress *string `json:"ipAddress,omitempty"` + // SubnetMask - Subnet mask for the range of IP addresses the restriction is valid for. + SubnetMask *string `json:"subnetMask,omitempty"` + // VnetSubnetResourceID - Virtual network resource id + VnetSubnetResourceID *string `json:"vnetSubnetResourceId,omitempty"` + // VnetTrafficTag - (internal) Vnet traffic tag + VnetTrafficTag *int32 `json:"vnetTrafficTag,omitempty"` + // SubnetTrafficTag - (internal) Subnet traffic tag + SubnetTrafficTag *int32 `json:"subnetTrafficTag,omitempty"` + // Action - Allow or Deny access for this IP range. + Action *string `json:"action,omitempty"` + // Tag - Defines what this IP filter will be used for. This is to support IP filtering on proxies. Possible values include: 'IPFilterTagDefault', 'IPFilterTagXffProxy', 'IPFilterTagServiceTag' + Tag IPFilterTag `json:"tag,omitempty"` + // Priority - Priority of IP restriction rule. + Priority *int32 `json:"priority,omitempty"` + // Name - IP restriction rule name. + Name *string `json:"name,omitempty"` + // Description - IP restriction rule description. + Description *string `json:"description,omitempty"` + // Headers - IP restriction rule headers. + // X-Forwarded-Host (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-Host#Examples). + // The matching logic is .. + // - If the property is null or empty (default), all hosts(or lack of) are allowed. + // - A value is compared using ordinal-ignore-case (excluding port number). + // - Subdomain wildcards are permitted but don't match the root domain. For example, *.contoso.com matches the subdomain foo.contoso.com + // but not the root domain contoso.com or multi-level foo.bar.contoso.com + // - Unicode host names are allowed but are converted to Punycode for matching. + // X-Forwarded-For (https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Forwarded-For#Examples). + // The matching logic is .. + // - If the property is null or empty (default), any forwarded-for chains (or lack of) are allowed. + // - If any address (excluding port number) in the chain (comma separated) matches the CIDR defined by the property. + // X-Azure-FDID and X-FD-HealthProbe. + // The matching logic is exact match. + Headers map[string][]string `json:"headers"` +} + +// MarshalJSON is the custom marshaler for IPSecurityRestriction. +func (isr IPSecurityRestriction) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if isr.IPAddress != nil { + objectMap["ipAddress"] = isr.IPAddress + } + if isr.SubnetMask != nil { + objectMap["subnetMask"] = isr.SubnetMask + } + if isr.VnetSubnetResourceID != nil { + objectMap["vnetSubnetResourceId"] = isr.VnetSubnetResourceID + } + if isr.VnetTrafficTag != nil { + objectMap["vnetTrafficTag"] = isr.VnetTrafficTag + } + if isr.SubnetTrafficTag != nil { + objectMap["subnetTrafficTag"] = isr.SubnetTrafficTag + } + if isr.Action != nil { + objectMap["action"] = isr.Action + } + if isr.Tag != "" { + objectMap["tag"] = isr.Tag + } + if isr.Priority != nil { + objectMap["priority"] = isr.Priority + } + if isr.Name != nil { + objectMap["name"] = isr.Name + } + if isr.Description != nil { + objectMap["description"] = isr.Description + } + if isr.Headers != nil { + objectMap["headers"] = isr.Headers + } + return json.Marshal(objectMap) +} + +// Job web Job Information. +type Job struct { + autorest.Response `json:"-"` + // JobProperties - WebJob resource specific properties + *JobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Job. +func (j Job) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.JobProperties != nil { + objectMap["properties"] = j.JobProperties + } + if j.Kind != nil { + objectMap["kind"] = j.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Job struct. +func (j *Job) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var jobProperties JobProperties + err = json.Unmarshal(*v, &jobProperties) + if err != nil { + return err + } + j.JobProperties = &jobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + j.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + j.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + j.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + j.Type = &typeVar + } + } + } + + return nil +} + +// JobCollection collection of Kudu web job information elements. +type JobCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Job `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobCollection. +func (jc JobCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jc.Value != nil { + objectMap["value"] = jc.Value + } + return json.Marshal(objectMap) +} + +// JobCollectionIterator provides access to a complete listing of Job values. +type JobCollectionIterator struct { + i int + page JobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobCollectionIterator) Response() JobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobCollectionIterator) Value() Job { + if !iter.page.NotDone() { + return Job{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobCollectionIterator type. +func NewJobCollectionIterator(page JobCollectionPage) JobCollectionIterator { + return JobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jc JobCollection) IsEmpty() bool { + return jc.Value == nil || len(*jc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jc JobCollection) hasNextLink() bool { + return jc.NextLink != nil && len(*jc.NextLink) != 0 +} + +// jobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jc JobCollection) jobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !jc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jc.NextLink))) +} + +// JobCollectionPage contains a page of Job values. +type JobCollectionPage struct { + fn func(context.Context, JobCollection) (JobCollection, error) + jc JobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jc) + if err != nil { + return err + } + page.jc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobCollectionPage) NotDone() bool { + return !page.jc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobCollectionPage) Response() JobCollection { + return page.jc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobCollectionPage) Values() []Job { + if page.jc.IsEmpty() { + return nil + } + return *page.jc.Value +} + +// Creates a new instance of the JobCollectionPage type. +func NewJobCollectionPage(cur JobCollection, getNextPage func(context.Context, JobCollection) (JobCollection, error)) JobCollectionPage { + return JobCollectionPage{ + fn: getNextPage, + jc: cur, + } +} + +// JobProperties webJob resource specific properties +type JobProperties struct { + // RunCommand - Run command. + RunCommand *string `json:"run_command,omitempty"` + // URL - Job URL. + URL *string `json:"url,omitempty"` + // ExtraInfoURL - Extra Info URL. + ExtraInfoURL *string `json:"extra_info_url,omitempty"` + // WebJobType - Job type. Possible values include: 'JobTypeContinuous', 'JobTypeTriggered' + WebJobType JobType `json:"web_job_type,omitempty"` + // Error - Error information. + Error *string `json:"error,omitempty"` + // UsingSdk - Using SDK? + UsingSdk *bool `json:"using_sdk,omitempty"` + // Settings - Job settings. + Settings map[string]interface{} `json:"settings"` +} + +// MarshalJSON is the custom marshaler for JobProperties. +func (j JobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if j.RunCommand != nil { + objectMap["run_command"] = j.RunCommand + } + if j.URL != nil { + objectMap["url"] = j.URL + } + if j.ExtraInfoURL != nil { + objectMap["extra_info_url"] = j.ExtraInfoURL + } + if j.WebJobType != "" { + objectMap["web_job_type"] = j.WebJobType + } + if j.Error != nil { + objectMap["error"] = j.Error + } + if j.UsingSdk != nil { + objectMap["using_sdk"] = j.UsingSdk + } + if j.Settings != nil { + objectMap["settings"] = j.Settings + } + return json.Marshal(objectMap) +} + +// JwtClaimChecks the configuration settings of the checks that should be made while validating the JWT +// Claims. +type JwtClaimChecks struct { + // AllowedGroups - The list of the allowed groups. + AllowedGroups *[]string `json:"allowedGroups,omitempty"` + // AllowedClientApplications - The list of the allowed client applications. + AllowedClientApplications *[]string `json:"allowedClientApplications,omitempty"` +} + +// KeyInfo function key info. +type KeyInfo struct { + autorest.Response `json:"-"` + // Name - Key name + Name *string `json:"name,omitempty"` + // Value - Key value + Value *string `json:"value,omitempty"` +} + +// KeyValuePairStringObject ... +type KeyValuePairStringObject struct { + // Key - READ-ONLY + Key *string `json:"key,omitempty"` + // Value - READ-ONLY + Value interface{} `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for KeyValuePairStringObject. +func (kvpSo KeyValuePairStringObject) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// KubeEnvironment a Kubernetes cluster specialized for web workloads by Azure App Service +type KubeEnvironment struct { + autorest.Response `json:"-"` + // KubeEnvironmentProperties - KubeEnvironment resource specific properties + *KubeEnvironmentProperties `json:"properties,omitempty"` + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for KubeEnvironment. +func (ke KubeEnvironment) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ke.KubeEnvironmentProperties != nil { + objectMap["properties"] = ke.KubeEnvironmentProperties + } + if ke.ExtendedLocation != nil { + objectMap["extendedLocation"] = ke.ExtendedLocation + } + if ke.Kind != nil { + objectMap["kind"] = ke.Kind + } + if ke.Location != nil { + objectMap["location"] = ke.Location + } + if ke.Tags != nil { + objectMap["tags"] = ke.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for KubeEnvironment struct. +func (ke *KubeEnvironment) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kubeEnvironmentProperties KubeEnvironmentProperties + err = json.Unmarshal(*v, &kubeEnvironmentProperties) + if err != nil { + return err + } + ke.KubeEnvironmentProperties = &kubeEnvironmentProperties + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + ke.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ke.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ke.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ke.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ke.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ke.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ke.Tags = tags + } + } + } + + return nil +} + +// KubeEnvironmentCollection collection of Kubernetes Environments +type KubeEnvironmentCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]KubeEnvironment `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for KubeEnvironmentCollection. +func (kec KubeEnvironmentCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kec.Value != nil { + objectMap["value"] = kec.Value + } + return json.Marshal(objectMap) +} + +// KubeEnvironmentCollectionIterator provides access to a complete listing of KubeEnvironment values. +type KubeEnvironmentCollectionIterator struct { + i int + page KubeEnvironmentCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *KubeEnvironmentCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *KubeEnvironmentCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter KubeEnvironmentCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter KubeEnvironmentCollectionIterator) Response() KubeEnvironmentCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter KubeEnvironmentCollectionIterator) Value() KubeEnvironment { + if !iter.page.NotDone() { + return KubeEnvironment{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the KubeEnvironmentCollectionIterator type. +func NewKubeEnvironmentCollectionIterator(page KubeEnvironmentCollectionPage) KubeEnvironmentCollectionIterator { + return KubeEnvironmentCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (kec KubeEnvironmentCollection) IsEmpty() bool { + return kec.Value == nil || len(*kec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (kec KubeEnvironmentCollection) hasNextLink() bool { + return kec.NextLink != nil && len(*kec.NextLink) != 0 +} + +// kubeEnvironmentCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (kec KubeEnvironmentCollection) kubeEnvironmentCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !kec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(kec.NextLink))) +} + +// KubeEnvironmentCollectionPage contains a page of KubeEnvironment values. +type KubeEnvironmentCollectionPage struct { + fn func(context.Context, KubeEnvironmentCollection) (KubeEnvironmentCollection, error) + kec KubeEnvironmentCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *KubeEnvironmentCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/KubeEnvironmentCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.kec) + if err != nil { + return err + } + page.kec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *KubeEnvironmentCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page KubeEnvironmentCollectionPage) NotDone() bool { + return !page.kec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page KubeEnvironmentCollectionPage) Response() KubeEnvironmentCollection { + return page.kec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page KubeEnvironmentCollectionPage) Values() []KubeEnvironment { + if page.kec.IsEmpty() { + return nil + } + return *page.kec.Value +} + +// Creates a new instance of the KubeEnvironmentCollectionPage type. +func NewKubeEnvironmentCollectionPage(cur KubeEnvironmentCollection, getNextPage func(context.Context, KubeEnvironmentCollection) (KubeEnvironmentCollection, error)) KubeEnvironmentCollectionPage { + return KubeEnvironmentCollectionPage{ + fn: getNextPage, + kec: cur, + } +} + +// KubeEnvironmentPatchResource ARM resource for a KubeEnvironment when patching +type KubeEnvironmentPatchResource struct { + // KubeEnvironmentPatchResourceProperties - KubeEnvironmentPatchResource resource specific properties + *KubeEnvironmentPatchResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for KubeEnvironmentPatchResource. +func (kepr KubeEnvironmentPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kepr.KubeEnvironmentPatchResourceProperties != nil { + objectMap["properties"] = kepr.KubeEnvironmentPatchResourceProperties + } + if kepr.Kind != nil { + objectMap["kind"] = kepr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for KubeEnvironmentPatchResource struct. +func (kepr *KubeEnvironmentPatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var kubeEnvironmentPatchResourceProperties KubeEnvironmentPatchResourceProperties + err = json.Unmarshal(*v, &kubeEnvironmentPatchResourceProperties) + if err != nil { + return err + } + kepr.KubeEnvironmentPatchResourceProperties = &kubeEnvironmentPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + kepr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + kepr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + kepr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + kepr.Type = &typeVar + } + } + } + + return nil +} + +// KubeEnvironmentPatchResourceProperties kubeEnvironmentPatchResource resource specific properties +type KubeEnvironmentPatchResourceProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the Kubernetes Environment. Possible values include: 'KubeEnvironmentProvisioningStateSucceeded', 'KubeEnvironmentProvisioningStateFailed', 'KubeEnvironmentProvisioningStateCanceled', 'KubeEnvironmentProvisioningStateWaiting', 'KubeEnvironmentProvisioningStateInitializationInProgress', 'KubeEnvironmentProvisioningStateInfrastructureSetupInProgress', 'KubeEnvironmentProvisioningStateInfrastructureSetupComplete', 'KubeEnvironmentProvisioningStateScheduledForDelete', 'KubeEnvironmentProvisioningStateUpgradeRequested', 'KubeEnvironmentProvisioningStateUpgradeFailed' + ProvisioningState KubeEnvironmentProvisioningState `json:"provisioningState,omitempty"` + // DeploymentErrors - READ-ONLY; Any errors that occurred during deployment or deployment validation + DeploymentErrors *string `json:"deploymentErrors,omitempty"` + // InternalLoadBalancerEnabled - Only visible within Vnet/Subnet + InternalLoadBalancerEnabled *bool `json:"internalLoadBalancerEnabled,omitempty"` + // DefaultDomain - READ-ONLY; Default Domain Name for the cluster + DefaultDomain *string `json:"defaultDomain,omitempty"` + // StaticIP - Static IP of the KubeEnvironment + StaticIP *string `json:"staticIp,omitempty"` + // ArcConfiguration - Cluster configuration which determines the ARC cluster + // components types. Eg: Choosing between BuildService kind, + // FrontEnd Service ArtifactsStorageType etc. + ArcConfiguration *ArcConfiguration `json:"arcConfiguration,omitempty"` + // AppLogsConfiguration - Cluster configuration which enables the log daemon to export + // app logs to a destination. Currently only "log-analytics" is + // supported + AppLogsConfiguration *AppLogsConfiguration `json:"appLogsConfiguration,omitempty"` + // ContainerAppsConfiguration - Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration + ContainerAppsConfiguration *ContainerAppsConfiguration `json:"containerAppsConfiguration,omitempty"` + AksResourceID *string `json:"aksResourceID,omitempty"` +} + +// MarshalJSON is the custom marshaler for KubeEnvironmentPatchResourceProperties. +func (kepr KubeEnvironmentPatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kepr.InternalLoadBalancerEnabled != nil { + objectMap["internalLoadBalancerEnabled"] = kepr.InternalLoadBalancerEnabled + } + if kepr.StaticIP != nil { + objectMap["staticIp"] = kepr.StaticIP + } + if kepr.ArcConfiguration != nil { + objectMap["arcConfiguration"] = kepr.ArcConfiguration + } + if kepr.AppLogsConfiguration != nil { + objectMap["appLogsConfiguration"] = kepr.AppLogsConfiguration + } + if kepr.ContainerAppsConfiguration != nil { + objectMap["containerAppsConfiguration"] = kepr.ContainerAppsConfiguration + } + if kepr.AksResourceID != nil { + objectMap["aksResourceID"] = kepr.AksResourceID + } + return json.Marshal(objectMap) +} + +// KubeEnvironmentProfile specification for a Kubernetes Environment to use for this resource. +type KubeEnvironmentProfile struct { + // ID - Resource ID of the Kubernetes Environment. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the Kubernetes Environment. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type of the Kubernetes Environment. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for KubeEnvironmentProfile. +func (kep KubeEnvironmentProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kep.ID != nil { + objectMap["id"] = kep.ID + } + return json.Marshal(objectMap) +} + +// KubeEnvironmentProperties kubeEnvironment resource specific properties +type KubeEnvironmentProperties struct { + // ProvisioningState - READ-ONLY; Provisioning state of the Kubernetes Environment. Possible values include: 'KubeEnvironmentProvisioningStateSucceeded', 'KubeEnvironmentProvisioningStateFailed', 'KubeEnvironmentProvisioningStateCanceled', 'KubeEnvironmentProvisioningStateWaiting', 'KubeEnvironmentProvisioningStateInitializationInProgress', 'KubeEnvironmentProvisioningStateInfrastructureSetupInProgress', 'KubeEnvironmentProvisioningStateInfrastructureSetupComplete', 'KubeEnvironmentProvisioningStateScheduledForDelete', 'KubeEnvironmentProvisioningStateUpgradeRequested', 'KubeEnvironmentProvisioningStateUpgradeFailed' + ProvisioningState KubeEnvironmentProvisioningState `json:"provisioningState,omitempty"` + // DeploymentErrors - READ-ONLY; Any errors that occurred during deployment or deployment validation + DeploymentErrors *string `json:"deploymentErrors,omitempty"` + // InternalLoadBalancerEnabled - Only visible within Vnet/Subnet + InternalLoadBalancerEnabled *bool `json:"internalLoadBalancerEnabled,omitempty"` + // DefaultDomain - READ-ONLY; Default Domain Name for the cluster + DefaultDomain *string `json:"defaultDomain,omitempty"` + // StaticIP - Static IP of the KubeEnvironment + StaticIP *string `json:"staticIp,omitempty"` + // EnvironmentType - Type of Kubernetes Environment. Only supported for Container App Environments with value as Managed + EnvironmentType *string `json:"environmentType,omitempty"` + // ArcConfiguration - Cluster configuration which determines the ARC cluster + // components types. Eg: Choosing between BuildService kind, + // FrontEnd Service ArtifactsStorageType etc. + ArcConfiguration *ArcConfiguration `json:"arcConfiguration,omitempty"` + // AppLogsConfiguration - Cluster configuration which enables the log daemon to export + // app logs to a destination. Currently only "log-analytics" is + // supported + AppLogsConfiguration *AppLogsConfiguration `json:"appLogsConfiguration,omitempty"` + // ContainerAppsConfiguration - Cluster configuration for Container Apps Environments to configure Dapr Instrumentation Key and VNET Configuration + ContainerAppsConfiguration *ContainerAppsConfiguration `json:"containerAppsConfiguration,omitempty"` + AksResourceID *string `json:"aksResourceID,omitempty"` +} + +// MarshalJSON is the custom marshaler for KubeEnvironmentProperties. +func (ke KubeEnvironmentProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ke.InternalLoadBalancerEnabled != nil { + objectMap["internalLoadBalancerEnabled"] = ke.InternalLoadBalancerEnabled + } + if ke.StaticIP != nil { + objectMap["staticIp"] = ke.StaticIP + } + if ke.EnvironmentType != nil { + objectMap["environmentType"] = ke.EnvironmentType + } + if ke.ArcConfiguration != nil { + objectMap["arcConfiguration"] = ke.ArcConfiguration + } + if ke.AppLogsConfiguration != nil { + objectMap["appLogsConfiguration"] = ke.AppLogsConfiguration + } + if ke.ContainerAppsConfiguration != nil { + objectMap["containerAppsConfiguration"] = ke.ContainerAppsConfiguration + } + if ke.AksResourceID != nil { + objectMap["aksResourceID"] = ke.AksResourceID + } + return json.Marshal(objectMap) +} + +// KubeEnvironmentsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type KubeEnvironmentsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(KubeEnvironmentsClient) (KubeEnvironment, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *KubeEnvironmentsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for KubeEnvironmentsCreateOrUpdateFuture.Result. +func (future *KubeEnvironmentsCreateOrUpdateFuture) result(client KubeEnvironmentsClient) (ke KubeEnvironment, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ke.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.KubeEnvironmentsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ke.Response.Response, err = future.GetResult(sender); err == nil && ke.Response.Response.StatusCode != http.StatusNoContent { + ke, err = client.CreateOrUpdateResponder(ke.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsCreateOrUpdateFuture", "Result", ke.Response.Response, "Failure responding to request") + } + } + return +} + +// KubeEnvironmentsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type KubeEnvironmentsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(KubeEnvironmentsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *KubeEnvironmentsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for KubeEnvironmentsDeleteFuture.Result. +func (future *KubeEnvironmentsDeleteFuture) result(client KubeEnvironmentsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.KubeEnvironmentsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.KubeEnvironmentsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LegacyMicrosoftAccount the configuration settings of the legacy Microsoft Account provider. +type LegacyMicrosoftAccount struct { + // Enabled - false if the legacy Microsoft Account provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the app registration for the legacy Microsoft Account provider. + Registration *ClientRegistration `json:"registration,omitempty"` + // Login - The configuration settings of the login flow. + Login *LoginScopes `json:"login,omitempty"` + // Validation - The configuration settings of the legacy Microsoft Account provider token validation flow. + Validation *AllowedAudiencesValidation `json:"validation,omitempty"` +} + +// LinuxJavaContainerSettings linux Java Container settings. +type LinuxJavaContainerSettings struct { + // Java11Runtime - READ-ONLY; Java 11 version (runtime only). + Java11Runtime *string `json:"java11Runtime,omitempty"` + // Java8Runtime - READ-ONLY; Java 8 version (runtime only). + Java8Runtime *string `json:"java8Runtime,omitempty"` + // IsPreview - READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty"` + // IsDeprecated - READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + // IsHidden - READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty"` + // EndOfLifeDate - READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // IsAutoUpdate - READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty"` + // IsEarlyAccess - READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for LinuxJavaContainerSettings. +func (ljcs LinuxJavaContainerSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ListCapability ... +type ListCapability struct { + autorest.Response `json:"-"` + Value *[]Capability `json:"value,omitempty"` +} + +// ListCertificateEmail ... +type ListCertificateEmail struct { + autorest.Response `json:"-"` + Value *[]CertificateEmail `json:"value,omitempty"` +} + +// ListCertificateOrderAction ... +type ListCertificateOrderAction struct { + autorest.Response `json:"-"` + Value *[]CertificateOrderAction `json:"value,omitempty"` +} + +// ListHostingEnvironmentDiagnostics ... +type ListHostingEnvironmentDiagnostics struct { + autorest.Response `json:"-"` + Value *[]HostingEnvironmentDiagnostics `json:"value,omitempty"` +} + +// ListNetworkTrace ... +type ListNetworkTrace struct { + autorest.Response `json:"-"` + Value *[]NetworkTrace `json:"value,omitempty"` +} + +// ListOperation ... +type ListOperation struct { + autorest.Response `json:"-"` + Value *[]Operation `json:"value,omitempty"` +} + +// ListSnapshot ... +type ListSnapshot struct { + autorest.Response `json:"-"` + Value *[]Snapshot `json:"value,omitempty"` +} + +// ListVnetInfoResource ... +type ListVnetInfoResource struct { + autorest.Response `json:"-"` + Value *[]VnetInfoResource `json:"value,omitempty"` +} + +// ListVnetRoute ... +type ListVnetRoute struct { + autorest.Response `json:"-"` + Value *[]VnetRoute `json:"value,omitempty"` +} + +// LocalizableString localizable string object containing the name and a localized value. +type LocalizableString struct { + // Value - Non-localized name. + Value *string `json:"value,omitempty"` + // LocalizedValue - Localized name. + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// LogAnalyticsConfiguration ... +type LogAnalyticsConfiguration struct { + CustomerID *string `json:"customerId,omitempty"` + SharedKey *string `json:"sharedKey,omitempty"` +} + +// Login the configuration settings of the login flow of users using App Service +// Authentication/Authorization. +type Login struct { + // Routes - The routes that specify the endpoints used for login and logout requests. + Routes *LoginRoutes `json:"routes,omitempty"` + // TokenStore - The configuration settings of the token store. + TokenStore *TokenStore `json:"tokenStore,omitempty"` + // PreserveURLFragmentsForLogins - true if the fragments from the request are preserved after the login request is made; otherwise, false. + PreserveURLFragmentsForLogins *bool `json:"preserveUrlFragmentsForLogins,omitempty"` + // AllowedExternalRedirectUrls - External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + // This is an advanced setting typically only needed by Windows Store application backends. + // Note that URLs within the current domain are always implicitly allowed. + AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + // CookieExpiration - The configuration settings of the session cookie's expiration. + CookieExpiration *CookieExpiration `json:"cookieExpiration,omitempty"` + // Nonce - The configuration settings of the nonce used in the login flow. + Nonce *Nonce `json:"nonce,omitempty"` +} + +// LoginRoutes the routes that specify the endpoints used for login and logout requests. +type LoginRoutes struct { + // LogoutEndpoint - The endpoint at which a logout request should be made. + LogoutEndpoint *string `json:"logoutEndpoint,omitempty"` +} + +// LoginScopes the configuration settings of the login flow, including the scopes that should be requested. +type LoginScopes struct { + // Scopes - A list of the scopes that should be requested while authenticating. + Scopes *[]string `json:"scopes,omitempty"` +} + +// LogSpecification log Definition of a single resource metric. +type LogSpecification struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + BlobDuration *string `json:"blobDuration,omitempty"` + LogFilterPattern *string `json:"logFilterPattern,omitempty"` +} + +// ManagedServiceIdentity managed service identity. +type ManagedServiceIdentity struct { + // Type - Type of managed service identity. Possible values include: 'ManagedServiceIdentityTypeSystemAssigned', 'ManagedServiceIdentityTypeUserAssigned', 'ManagedServiceIdentityTypeSystemAssignedUserAssigned', 'ManagedServiceIdentityTypeNone' + Type ManagedServiceIdentityType `json:"type,omitempty"` + // TenantID - READ-ONLY; Tenant of managed service identity. + TenantID *string `json:"tenantId,omitempty"` + // PrincipalID - READ-ONLY; Principal Id of managed service identity. + PrincipalID *string `json:"principalId,omitempty"` + // UserAssignedIdentities - The list of user assigned identities associated with the resource. The user identity dictionary key references will be ARM resource ids in the form: '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName} + UserAssignedIdentities map[string]*UserAssignedIdentity `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ManagedServiceIdentity. +func (msi ManagedServiceIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if msi.Type != "" { + objectMap["type"] = msi.Type + } + if msi.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = msi.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// MetricAvailability retention policy of a resource metric. +type MetricAvailability struct { + TimeGrain *string `json:"timeGrain,omitempty"` + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// MetricSpecification definition of a single resource metric. +type MetricSpecification struct { + Name *string `json:"name,omitempty"` + DisplayName *string `json:"displayName,omitempty"` + DisplayDescription *string `json:"displayDescription,omitempty"` + Unit *string `json:"unit,omitempty"` + AggregationType *string `json:"aggregationType,omitempty"` + SupportsInstanceLevelAggregation *bool `json:"supportsInstanceLevelAggregation,omitempty"` + EnableRegionalMdmAccount *bool `json:"enableRegionalMdmAccount,omitempty"` + SourceMdmAccount *string `json:"sourceMdmAccount,omitempty"` + SourceMdmNamespace *string `json:"sourceMdmNamespace,omitempty"` + MetricFilterPattern *string `json:"metricFilterPattern,omitempty"` + FillGapWithZero *bool `json:"fillGapWithZero,omitempty"` + IsInternal *bool `json:"isInternal,omitempty"` + Dimensions *[]Dimension `json:"dimensions,omitempty"` + Category *string `json:"category,omitempty"` + Availabilities *[]MetricAvailability `json:"availabilities,omitempty"` + SupportedTimeGrainTypes *[]string `json:"supportedTimeGrainTypes,omitempty"` + SupportedAggregationTypes *[]string `json:"supportedAggregationTypes,omitempty"` +} + +// MigrateMySQLRequest mySQL migration request. +type MigrateMySQLRequest struct { + // MigrateMySQLRequestProperties - MigrateMySqlRequest resource specific properties + *MigrateMySQLRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrateMySQLRequest. +func (mmsr MigrateMySQLRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mmsr.MigrateMySQLRequestProperties != nil { + objectMap["properties"] = mmsr.MigrateMySQLRequestProperties + } + if mmsr.Kind != nil { + objectMap["kind"] = mmsr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrateMySQLRequest struct. +func (mmsr *MigrateMySQLRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var migrateMySQLRequestProperties MigrateMySQLRequestProperties + err = json.Unmarshal(*v, &migrateMySQLRequestProperties) + if err != nil { + return err + } + mmsr.MigrateMySQLRequestProperties = &migrateMySQLRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mmsr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mmsr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mmsr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mmsr.Type = &typeVar + } + } + } + + return nil +} + +// MigrateMySQLRequestProperties migrateMySqlRequest resource specific properties +type MigrateMySQLRequestProperties struct { + // ConnectionString - Connection string to the remote MySQL database. + ConnectionString *string `json:"connectionString,omitempty"` + // MigrationType - The type of migration operation to be done. Possible values include: 'MySQLMigrationTypeLocalToRemote', 'MySQLMigrationTypeRemoteToLocal' + MigrationType MySQLMigrationType `json:"migrationType,omitempty"` +} + +// MigrateMySQLStatus mySQL migration status. +type MigrateMySQLStatus struct { + autorest.Response `json:"-"` + // MigrateMySQLStatusProperties - MigrateMySqlStatus resource specific properties + *MigrateMySQLStatusProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrateMySQLStatus. +func (mmss MigrateMySQLStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mmss.MigrateMySQLStatusProperties != nil { + objectMap["properties"] = mmss.MigrateMySQLStatusProperties + } + if mmss.Kind != nil { + objectMap["kind"] = mmss.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MigrateMySQLStatus struct. +func (mmss *MigrateMySQLStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var migrateMySQLStatusProperties MigrateMySQLStatusProperties + err = json.Unmarshal(*v, &migrateMySQLStatusProperties) + if err != nil { + return err + } + mmss.MigrateMySQLStatusProperties = &migrateMySQLStatusProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mmss.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mmss.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mmss.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mmss.Type = &typeVar + } + } + } + + return nil +} + +// MigrateMySQLStatusProperties migrateMySqlStatus resource specific properties +type MigrateMySQLStatusProperties struct { + // MigrationOperationStatus - READ-ONLY; Status of the migration task. Possible values include: 'OperationStatusInProgress', 'OperationStatusFailed', 'OperationStatusSucceeded', 'OperationStatusTimedOut', 'OperationStatusCreated' + MigrationOperationStatus OperationStatus `json:"migrationOperationStatus,omitempty"` + // OperationID - READ-ONLY; Operation ID for the migration task. + OperationID *string `json:"operationId,omitempty"` + // LocalMySQLEnabled - READ-ONLY; True if the web app has in app MySql enabled + LocalMySQLEnabled *bool `json:"localMySqlEnabled,omitempty"` +} + +// MarshalJSON is the custom marshaler for MigrateMySQLStatusProperties. +func (mmss MigrateMySQLStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MSDeploy mSDeploy ARM PUT information +type MSDeploy struct { + // MSDeployCore - Core resource properties + *MSDeployCore `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeploy. +func (md MSDeploy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if md.MSDeployCore != nil { + objectMap["properties"] = md.MSDeployCore + } + if md.Kind != nil { + objectMap["kind"] = md.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MSDeploy struct. +func (md *MSDeploy) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mSDeployCore MSDeployCore + err = json.Unmarshal(*v, &mSDeployCore) + if err != nil { + return err + } + md.MSDeployCore = &mSDeployCore + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + md.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + md.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + md.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + md.Type = &typeVar + } + } + } + + return nil +} + +// MSDeployCore mSDeploy ARM PUT core information +type MSDeployCore struct { + // PackageURI - Package URI + PackageURI *string `json:"packageUri,omitempty"` + // ConnectionString - SQL Connection String + ConnectionString *string `json:"connectionString,omitempty"` + // DbType - Database Type + DbType *string `json:"dbType,omitempty"` + // SetParametersXMLFileURI - URI of MSDeploy Parameters file. Must not be set if SetParameters is used. + SetParametersXMLFileURI *string `json:"setParametersXmlFileUri,omitempty"` + // SetParameters - MSDeploy Parameters. Must not be set if SetParametersXmlFileUri is used. + SetParameters map[string]*string `json:"setParameters"` + // SkipAppData - Controls whether the MSDeploy operation skips the App_Data directory. + // If set to true, the existing App_Data directory on the destination + // will not be deleted, and any App_Data directory in the source will be ignored. + // Setting is false by default. + SkipAppData *bool `json:"skipAppData,omitempty"` + // AppOffline - Sets the AppOffline rule while the MSDeploy operation executes. + // Setting is false by default. + AppOffline *bool `json:"appOffline,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeployCore. +func (mdc MSDeployCore) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdc.PackageURI != nil { + objectMap["packageUri"] = mdc.PackageURI + } + if mdc.ConnectionString != nil { + objectMap["connectionString"] = mdc.ConnectionString + } + if mdc.DbType != nil { + objectMap["dbType"] = mdc.DbType + } + if mdc.SetParametersXMLFileURI != nil { + objectMap["setParametersXmlFileUri"] = mdc.SetParametersXMLFileURI + } + if mdc.SetParameters != nil { + objectMap["setParameters"] = mdc.SetParameters + } + if mdc.SkipAppData != nil { + objectMap["skipAppData"] = mdc.SkipAppData + } + if mdc.AppOffline != nil { + objectMap["appOffline"] = mdc.AppOffline + } + return json.Marshal(objectMap) +} + +// MSDeployLog mSDeploy log +type MSDeployLog struct { + autorest.Response `json:"-"` + // MSDeployLogProperties - MSDeployLog resource specific properties + *MSDeployLogProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeployLog. +func (mdl MSDeployLog) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mdl.MSDeployLogProperties != nil { + objectMap["properties"] = mdl.MSDeployLogProperties + } + if mdl.Kind != nil { + objectMap["kind"] = mdl.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MSDeployLog struct. +func (mdl *MSDeployLog) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mSDeployLogProperties MSDeployLogProperties + err = json.Unmarshal(*v, &mSDeployLogProperties) + if err != nil { + return err + } + mdl.MSDeployLogProperties = &mSDeployLogProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mdl.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mdl.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mdl.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mdl.Type = &typeVar + } + } + } + + return nil +} + +// MSDeployLogEntry mSDeploy log entry +type MSDeployLogEntry struct { + // Time - READ-ONLY; Timestamp of log entry + Time *date.Time `json:"time,omitempty"` + // Type - READ-ONLY; Log entry type. Possible values include: 'MSDeployLogEntryTypeMessage', 'MSDeployLogEntryTypeWarning', 'MSDeployLogEntryTypeError' + Type MSDeployLogEntryType `json:"type,omitempty"` + // Message - READ-ONLY; Log entry message + Message *string `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeployLogEntry. +func (mdle MSDeployLogEntry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MSDeployLogProperties mSDeployLog resource specific properties +type MSDeployLogProperties struct { + // Entries - READ-ONLY; List of log entry messages + Entries *[]MSDeployLogEntry `json:"entries,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeployLogProperties. +func (mdl MSDeployLogProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// MSDeployStatus mSDeploy ARM response +type MSDeployStatus struct { + autorest.Response `json:"-"` + // MSDeployStatusProperties - MSDeployStatus resource specific properties + *MSDeployStatusProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeployStatus. +func (mds MSDeployStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if mds.MSDeployStatusProperties != nil { + objectMap["properties"] = mds.MSDeployStatusProperties + } + if mds.Kind != nil { + objectMap["kind"] = mds.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for MSDeployStatus struct. +func (mds *MSDeployStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var mSDeployStatusProperties MSDeployStatusProperties + err = json.Unmarshal(*v, &mSDeployStatusProperties) + if err != nil { + return err + } + mds.MSDeployStatusProperties = &mSDeployStatusProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + mds.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + mds.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + mds.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + mds.Type = &typeVar + } + } + } + + return nil +} + +// MSDeployStatusProperties mSDeployStatus resource specific properties +type MSDeployStatusProperties struct { + // Deployer - READ-ONLY; Username of deployer + Deployer *string `json:"deployer,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state. Possible values include: 'MSDeployProvisioningStateAccepted', 'MSDeployProvisioningStateRunning', 'MSDeployProvisioningStateSucceeded', 'MSDeployProvisioningStateFailed', 'MSDeployProvisioningStateCanceled' + ProvisioningState MSDeployProvisioningState `json:"provisioningState,omitempty"` + // StartTime - READ-ONLY; Start time of deploy operation + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - READ-ONLY; End time of deploy operation + EndTime *date.Time `json:"endTime,omitempty"` + // Complete - READ-ONLY; Whether the deployment operation has completed + Complete *bool `json:"complete,omitempty"` +} + +// MarshalJSON is the custom marshaler for MSDeployStatusProperties. +func (mds MSDeployStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NameIdentifier identifies an object. +type NameIdentifier struct { + // Name - Name of the object. + Name *string `json:"name,omitempty"` +} + +// NameIdentifierCollection collection of domain name identifiers. +type NameIdentifierCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]NameIdentifier `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for NameIdentifierCollection. +func (nic NameIdentifierCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nic.Value != nil { + objectMap["value"] = nic.Value + } + return json.Marshal(objectMap) +} + +// NameIdentifierCollectionIterator provides access to a complete listing of NameIdentifier values. +type NameIdentifierCollectionIterator struct { + i int + page NameIdentifierCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *NameIdentifierCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NameIdentifierCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *NameIdentifierCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter NameIdentifierCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter NameIdentifierCollectionIterator) Response() NameIdentifierCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter NameIdentifierCollectionIterator) Value() NameIdentifier { + if !iter.page.NotDone() { + return NameIdentifier{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the NameIdentifierCollectionIterator type. +func NewNameIdentifierCollectionIterator(page NameIdentifierCollectionPage) NameIdentifierCollectionIterator { + return NameIdentifierCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (nic NameIdentifierCollection) IsEmpty() bool { + return nic.Value == nil || len(*nic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (nic NameIdentifierCollection) hasNextLink() bool { + return nic.NextLink != nil && len(*nic.NextLink) != 0 +} + +// nameIdentifierCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (nic NameIdentifierCollection) nameIdentifierCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !nic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(nic.NextLink))) +} + +// NameIdentifierCollectionPage contains a page of NameIdentifier values. +type NameIdentifierCollectionPage struct { + fn func(context.Context, NameIdentifierCollection) (NameIdentifierCollection, error) + nic NameIdentifierCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *NameIdentifierCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/NameIdentifierCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.nic) + if err != nil { + return err + } + page.nic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *NameIdentifierCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page NameIdentifierCollectionPage) NotDone() bool { + return !page.nic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page NameIdentifierCollectionPage) Response() NameIdentifierCollection { + return page.nic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page NameIdentifierCollectionPage) Values() []NameIdentifier { + if page.nic.IsEmpty() { + return nil + } + return *page.nic.Value +} + +// Creates a new instance of the NameIdentifierCollectionPage type. +func NewNameIdentifierCollectionPage(cur NameIdentifierCollection, getNextPage func(context.Context, NameIdentifierCollection) (NameIdentifierCollection, error)) NameIdentifierCollectionPage { + return NameIdentifierCollectionPage{ + fn: getNextPage, + nic: cur, + } +} + +// NameValuePair name value pair. +type NameValuePair struct { + // Name - Pair name. + Name *string `json:"name,omitempty"` + // Value - Pair value. + Value *string `json:"value,omitempty"` +} + +// NetworkFeatures full view of network features for an app (presently VNET integration and Hybrid +// Connections). +type NetworkFeatures struct { + autorest.Response `json:"-"` + // NetworkFeaturesProperties - NetworkFeatures resource specific properties + *NetworkFeaturesProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkFeatures. +func (nf NetworkFeatures) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if nf.NetworkFeaturesProperties != nil { + objectMap["properties"] = nf.NetworkFeaturesProperties + } + if nf.Kind != nil { + objectMap["kind"] = nf.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for NetworkFeatures struct. +func (nf *NetworkFeatures) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var networkFeaturesProperties NetworkFeaturesProperties + err = json.Unmarshal(*v, &networkFeaturesProperties) + if err != nil { + return err + } + nf.NetworkFeaturesProperties = &networkFeaturesProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + nf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + nf.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + nf.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + nf.Type = &typeVar + } + } + } + + return nil +} + +// NetworkFeaturesProperties networkFeatures resource specific properties +type NetworkFeaturesProperties struct { + // VirtualNetworkName - READ-ONLY; The Virtual Network name. + VirtualNetworkName *string `json:"virtualNetworkName,omitempty"` + // VirtualNetworkConnection - READ-ONLY; The Virtual Network summary view. + VirtualNetworkConnection *VnetInfo `json:"virtualNetworkConnection,omitempty"` + // HybridConnections - READ-ONLY; The Hybrid Connections summary view. + HybridConnections *[]RelayServiceConnectionEntity `json:"hybridConnections,omitempty"` + // HybridConnectionsV2 - READ-ONLY; The Hybrid Connection V2 (Service Bus) view. + HybridConnectionsV2 *[]HybridConnection `json:"hybridConnectionsV2,omitempty"` +} + +// MarshalJSON is the custom marshaler for NetworkFeaturesProperties. +func (nf NetworkFeaturesProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// NetworkTrace network trace +type NetworkTrace struct { + // Path - Local file path for the captured network trace file. + Path *string `json:"path,omitempty"` + // Status - Current status of the network trace operation, same as Operation.Status (InProgress/Succeeded/Failed). + Status *string `json:"status,omitempty"` + // Message - Detailed message of a network trace operation, e.g. error message in case of failure. + Message *string `json:"message,omitempty"` +} + +// Nonce the configuration settings of the nonce used in the login flow. +type Nonce struct { + // ValidateNonce - false if the nonce should not be validated while completing the login flow; otherwise, true. + ValidateNonce *bool `json:"validateNonce,omitempty"` + // NonceExpirationInterval - The time after the request is made when the nonce should expire. + NonceExpirationInterval *string `json:"nonceExpirationInterval,omitempty"` +} + +// OpenIDConnectClientCredential the authentication client credentials of the custom Open ID Connect +// provider. +type OpenIDConnectClientCredential struct { + // Method - The method that should be used to authenticate the user. Possible values include: 'ClientCredentialMethodClientSecretPost' + Method ClientCredentialMethod `json:"method,omitempty"` + // ClientSecretSettingName - The app setting that contains the client secret for the custom Open ID Connect provider. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` +} + +// OpenIDConnectConfig the configuration settings of the endpoints used for the custom Open ID Connect +// provider. +type OpenIDConnectConfig struct { + // AuthorizationEndpoint - The endpoint to be used to make an authorization request. + AuthorizationEndpoint *string `json:"authorizationEndpoint,omitempty"` + // TokenEndpoint - The endpoint to be used to request a token. + TokenEndpoint *string `json:"tokenEndpoint,omitempty"` + // Issuer - The endpoint that issues the token. + Issuer *string `json:"issuer,omitempty"` + // CertificationURI - The endpoint that provides the keys necessary to validate the token. + CertificationURI *string `json:"certificationUri,omitempty"` + // WellKnownOpenIDConfiguration - The endpoint that contains all the configuration endpoints for the provider. + WellKnownOpenIDConfiguration *string `json:"wellKnownOpenIdConfiguration,omitempty"` +} + +// OpenIDConnectLogin the configuration settings of the login flow of the custom Open ID Connect provider. +type OpenIDConnectLogin struct { + // NameClaimType - The name of the claim that contains the users name. + NameClaimType *string `json:"nameClaimType,omitempty"` + // Scopes - A list of the scopes that should be requested while authenticating. + Scopes *[]string `json:"scopes,omitempty"` +} + +// OpenIDConnectRegistration the configuration settings of the app registration for the custom Open ID +// Connect provider. +type OpenIDConnectRegistration struct { + // ClientID - The client id of the custom Open ID Connect provider. + ClientID *string `json:"clientId,omitempty"` + // ClientCredential - The authentication credentials of the custom Open ID Connect provider. + ClientCredential *OpenIDConnectClientCredential `json:"clientCredential,omitempty"` + // OpenIDConnectConfiguration - The configuration settings of the endpoints used for the custom Open ID Connect provider. + OpenIDConnectConfiguration *OpenIDConnectConfig `json:"openIdConnectConfiguration,omitempty"` +} + +// Operation an operation on a resource. +type Operation struct { + autorest.Response `json:"-"` + // ID - Operation ID. + ID *string `json:"id,omitempty"` + // Name - Operation name. + Name *string `json:"name,omitempty"` + // Status - The current status of the operation. Possible values include: 'OperationStatusInProgress', 'OperationStatusFailed', 'OperationStatusSucceeded', 'OperationStatusTimedOut', 'OperationStatusCreated' + Status OperationStatus `json:"status,omitempty"` + // Errors - Any errors associate with the operation. + Errors *[]ErrorEntity `json:"errors,omitempty"` + // CreatedTime - Time when operation has started. + CreatedTime *date.Time `json:"createdTime,omitempty"` + // ModifiedTime - Time when operation has been updated. + ModifiedTime *date.Time `json:"modifiedTime,omitempty"` + // ExpirationTime - Time when operation will expire. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` + // GeoMasterOperationID - Applicable only for stamp operation ids. + GeoMasterOperationID *uuid.UUID `json:"geoMasterOperationId,omitempty"` +} + +// OutboundEnvironmentEndpoint endpoints accessed for a common purpose that the App Service Environment +// requires outbound network access to. +type OutboundEnvironmentEndpoint struct { + // Category - The type of service accessed by the App Service Environment, e.g., Azure Storage, Azure SQL Database, and Azure Active Directory. + Category *string `json:"category,omitempty"` + // Endpoints - The endpoints that the App Service Environment reaches the service at. + Endpoints *[]EndpointDependency `json:"endpoints,omitempty"` +} + +// OutboundEnvironmentEndpointCollection collection of Outbound Environment Endpoints +type OutboundEnvironmentEndpointCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]OutboundEnvironmentEndpoint `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OutboundEnvironmentEndpointCollection. +func (oeec OutboundEnvironmentEndpointCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if oeec.Value != nil { + objectMap["value"] = oeec.Value + } + return json.Marshal(objectMap) +} + +// OutboundEnvironmentEndpointCollectionIterator provides access to a complete listing of +// OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionIterator struct { + i int + page OutboundEnvironmentEndpointCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OutboundEnvironmentEndpointCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OutboundEnvironmentEndpointCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OutboundEnvironmentEndpointCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OutboundEnvironmentEndpointCollectionIterator) Response() OutboundEnvironmentEndpointCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OutboundEnvironmentEndpointCollectionIterator) Value() OutboundEnvironmentEndpoint { + if !iter.page.NotDone() { + return OutboundEnvironmentEndpoint{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionIterator type. +func NewOutboundEnvironmentEndpointCollectionIterator(page OutboundEnvironmentEndpointCollectionPage) OutboundEnvironmentEndpointCollectionIterator { + return OutboundEnvironmentEndpointCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (oeec OutboundEnvironmentEndpointCollection) IsEmpty() bool { + return oeec.Value == nil || len(*oeec.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (oeec OutboundEnvironmentEndpointCollection) hasNextLink() bool { + return oeec.NextLink != nil && len(*oeec.NextLink) != 0 +} + +// outboundEnvironmentEndpointCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (oeec OutboundEnvironmentEndpointCollection) outboundEnvironmentEndpointCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !oeec.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(oeec.NextLink))) +} + +// OutboundEnvironmentEndpointCollectionPage contains a page of OutboundEnvironmentEndpoint values. +type OutboundEnvironmentEndpointCollectionPage struct { + fn func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error) + oeec OutboundEnvironmentEndpointCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OutboundEnvironmentEndpointCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OutboundEnvironmentEndpointCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.oeec) + if err != nil { + return err + } + page.oeec = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OutboundEnvironmentEndpointCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OutboundEnvironmentEndpointCollectionPage) NotDone() bool { + return !page.oeec.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OutboundEnvironmentEndpointCollectionPage) Response() OutboundEnvironmentEndpointCollection { + return page.oeec +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OutboundEnvironmentEndpointCollectionPage) Values() []OutboundEnvironmentEndpoint { + if page.oeec.IsEmpty() { + return nil + } + return *page.oeec.Value +} + +// Creates a new instance of the OutboundEnvironmentEndpointCollectionPage type. +func NewOutboundEnvironmentEndpointCollectionPage(cur OutboundEnvironmentEndpointCollection, getNextPage func(context.Context, OutboundEnvironmentEndpointCollection) (OutboundEnvironmentEndpointCollection, error)) OutboundEnvironmentEndpointCollectionPage { + return OutboundEnvironmentEndpointCollectionPage{ + fn: getNextPage, + oeec: cur, + } +} + +// PerfMonCounterCollection collection of performance monitor counters. +type PerfMonCounterCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]PerfMonResponse `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PerfMonCounterCollection. +func (pmcc PerfMonCounterCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pmcc.Value != nil { + objectMap["value"] = pmcc.Value + } + return json.Marshal(objectMap) +} + +// PerfMonCounterCollectionIterator provides access to a complete listing of PerfMonResponse values. +type PerfMonCounterCollectionIterator struct { + i int + page PerfMonCounterCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PerfMonCounterCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PerfMonCounterCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PerfMonCounterCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PerfMonCounterCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PerfMonCounterCollectionIterator) Response() PerfMonCounterCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PerfMonCounterCollectionIterator) Value() PerfMonResponse { + if !iter.page.NotDone() { + return PerfMonResponse{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PerfMonCounterCollectionIterator type. +func NewPerfMonCounterCollectionIterator(page PerfMonCounterCollectionPage) PerfMonCounterCollectionIterator { + return PerfMonCounterCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pmcc PerfMonCounterCollection) IsEmpty() bool { + return pmcc.Value == nil || len(*pmcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pmcc PerfMonCounterCollection) hasNextLink() bool { + return pmcc.NextLink != nil && len(*pmcc.NextLink) != 0 +} + +// perfMonCounterCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pmcc PerfMonCounterCollection) perfMonCounterCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pmcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pmcc.NextLink))) +} + +// PerfMonCounterCollectionPage contains a page of PerfMonResponse values. +type PerfMonCounterCollectionPage struct { + fn func(context.Context, PerfMonCounterCollection) (PerfMonCounterCollection, error) + pmcc PerfMonCounterCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PerfMonCounterCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PerfMonCounterCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pmcc) + if err != nil { + return err + } + page.pmcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PerfMonCounterCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PerfMonCounterCollectionPage) NotDone() bool { + return !page.pmcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PerfMonCounterCollectionPage) Response() PerfMonCounterCollection { + return page.pmcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PerfMonCounterCollectionPage) Values() []PerfMonResponse { + if page.pmcc.IsEmpty() { + return nil + } + return *page.pmcc.Value +} + +// Creates a new instance of the PerfMonCounterCollectionPage type. +func NewPerfMonCounterCollectionPage(cur PerfMonCounterCollection, getNextPage func(context.Context, PerfMonCounterCollection) (PerfMonCounterCollection, error)) PerfMonCounterCollectionPage { + return PerfMonCounterCollectionPage{ + fn: getNextPage, + pmcc: cur, + } +} + +// PerfMonResponse performance monitor API response. +type PerfMonResponse struct { + // Code - The response code. + Code *string `json:"code,omitempty"` + // Message - The message. + Message *string `json:"message,omitempty"` + // Data - The performance monitor counters. + Data *PerfMonSet `json:"data,omitempty"` +} + +// PerfMonSample performance monitor sample in a set. +type PerfMonSample struct { + // Time - Point in time for which counter was measured. + Time *date.Time `json:"time,omitempty"` + // InstanceName - Name of the server on which the measurement is made. + InstanceName *string `json:"instanceName,omitempty"` + // Value - Value of counter at a certain time. + Value *float64 `json:"value,omitempty"` +} + +// PerfMonSet metric information. +type PerfMonSet struct { + // Name - Unique key name of the counter. + Name *string `json:"name,omitempty"` + // StartTime - Start time of the period. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time of the period. + EndTime *date.Time `json:"endTime,omitempty"` + // TimeGrain - Presented time grain. + TimeGrain *string `json:"timeGrain,omitempty"` + // Values - Collection of workers that are active during this time. + Values *[]PerfMonSample `json:"values,omitempty"` +} + +// PremierAddOn premier add-on. +type PremierAddOn struct { + autorest.Response `json:"-"` + // PremierAddOnProperties - PremierAddOn resource specific properties + *PremierAddOnProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for PremierAddOn. +func (pao PremierAddOn) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pao.PremierAddOnProperties != nil { + objectMap["properties"] = pao.PremierAddOnProperties + } + if pao.Kind != nil { + objectMap["kind"] = pao.Kind + } + if pao.Location != nil { + objectMap["location"] = pao.Location + } + if pao.Tags != nil { + objectMap["tags"] = pao.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PremierAddOn struct. +func (pao *PremierAddOn) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var premierAddOnProperties PremierAddOnProperties + err = json.Unmarshal(*v, &premierAddOnProperties) + if err != nil { + return err + } + pao.PremierAddOnProperties = &premierAddOnProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pao.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pao.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pao.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + pao.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pao.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + pao.Tags = tags + } + } + } + + return nil +} + +// PremierAddOnOffer premier add-on offer. +type PremierAddOnOffer struct { + // PremierAddOnOfferProperties - PremierAddOnOffer resource specific properties + *PremierAddOnOfferProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PremierAddOnOffer. +func (paoo PremierAddOnOffer) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if paoo.PremierAddOnOfferProperties != nil { + objectMap["properties"] = paoo.PremierAddOnOfferProperties + } + if paoo.Kind != nil { + objectMap["kind"] = paoo.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PremierAddOnOffer struct. +func (paoo *PremierAddOnOffer) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var premierAddOnOfferProperties PremierAddOnOfferProperties + err = json.Unmarshal(*v, &premierAddOnOfferProperties) + if err != nil { + return err + } + paoo.PremierAddOnOfferProperties = &premierAddOnOfferProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + paoo.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + paoo.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + paoo.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + paoo.Type = &typeVar + } + } + } + + return nil +} + +// PremierAddOnOfferCollection collection of premier add-on offers. +type PremierAddOnOfferCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]PremierAddOnOffer `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PremierAddOnOfferCollection. +func (paooc PremierAddOnOfferCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if paooc.Value != nil { + objectMap["value"] = paooc.Value + } + return json.Marshal(objectMap) +} + +// PremierAddOnOfferCollectionIterator provides access to a complete listing of PremierAddOnOffer values. +type PremierAddOnOfferCollectionIterator struct { + i int + page PremierAddOnOfferCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PremierAddOnOfferCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PremierAddOnOfferCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PremierAddOnOfferCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PremierAddOnOfferCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PremierAddOnOfferCollectionIterator) Response() PremierAddOnOfferCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PremierAddOnOfferCollectionIterator) Value() PremierAddOnOffer { + if !iter.page.NotDone() { + return PremierAddOnOffer{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PremierAddOnOfferCollectionIterator type. +func NewPremierAddOnOfferCollectionIterator(page PremierAddOnOfferCollectionPage) PremierAddOnOfferCollectionIterator { + return PremierAddOnOfferCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (paooc PremierAddOnOfferCollection) IsEmpty() bool { + return paooc.Value == nil || len(*paooc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (paooc PremierAddOnOfferCollection) hasNextLink() bool { + return paooc.NextLink != nil && len(*paooc.NextLink) != 0 +} + +// premierAddOnOfferCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (paooc PremierAddOnOfferCollection) premierAddOnOfferCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !paooc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(paooc.NextLink))) +} + +// PremierAddOnOfferCollectionPage contains a page of PremierAddOnOffer values. +type PremierAddOnOfferCollectionPage struct { + fn func(context.Context, PremierAddOnOfferCollection) (PremierAddOnOfferCollection, error) + paooc PremierAddOnOfferCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PremierAddOnOfferCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PremierAddOnOfferCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.paooc) + if err != nil { + return err + } + page.paooc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PremierAddOnOfferCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PremierAddOnOfferCollectionPage) NotDone() bool { + return !page.paooc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PremierAddOnOfferCollectionPage) Response() PremierAddOnOfferCollection { + return page.paooc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PremierAddOnOfferCollectionPage) Values() []PremierAddOnOffer { + if page.paooc.IsEmpty() { + return nil + } + return *page.paooc.Value +} + +// Creates a new instance of the PremierAddOnOfferCollectionPage type. +func NewPremierAddOnOfferCollectionPage(cur PremierAddOnOfferCollection, getNextPage func(context.Context, PremierAddOnOfferCollection) (PremierAddOnOfferCollection, error)) PremierAddOnOfferCollectionPage { + return PremierAddOnOfferCollectionPage{ + fn: getNextPage, + paooc: cur, + } +} + +// PremierAddOnOfferProperties premierAddOnOffer resource specific properties +type PremierAddOnOfferProperties struct { + // Sku - Premier add on SKU. + Sku *string `json:"sku,omitempty"` + // Product - Premier add on offer Product. + Product *string `json:"product,omitempty"` + // Vendor - Premier add on offer Vendor. + Vendor *string `json:"vendor,omitempty"` + // PromoCodeRequired - true if promotion code is required; otherwise, false. + PromoCodeRequired *bool `json:"promoCodeRequired,omitempty"` + // Quota - Premier add on offer Quota. + Quota *int32 `json:"quota,omitempty"` + // WebHostingPlanRestrictions - App Service plans this offer is restricted to. Possible values include: 'AppServicePlanRestrictionsNone', 'AppServicePlanRestrictionsFree', 'AppServicePlanRestrictionsShared', 'AppServicePlanRestrictionsBasic', 'AppServicePlanRestrictionsStandard', 'AppServicePlanRestrictionsPremium' + WebHostingPlanRestrictions AppServicePlanRestrictions `json:"webHostingPlanRestrictions,omitempty"` + // PrivacyPolicyURL - Privacy policy URL. + PrivacyPolicyURL *string `json:"privacyPolicyUrl,omitempty"` + // LegalTermsURL - Legal terms URL. + LegalTermsURL *string `json:"legalTermsUrl,omitempty"` + // MarketplacePublisher - Marketplace publisher. + MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` + // MarketplaceOffer - Marketplace offer. + MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` +} + +// PremierAddOnPatchResource ARM resource for a PremierAddOn. +type PremierAddOnPatchResource struct { + // PremierAddOnPatchResourceProperties - PremierAddOnPatchResource resource specific properties + *PremierAddOnPatchResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PremierAddOnPatchResource. +func (paopr PremierAddOnPatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if paopr.PremierAddOnPatchResourceProperties != nil { + objectMap["properties"] = paopr.PremierAddOnPatchResourceProperties + } + if paopr.Kind != nil { + objectMap["kind"] = paopr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PremierAddOnPatchResource struct. +func (paopr *PremierAddOnPatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var premierAddOnPatchResourceProperties PremierAddOnPatchResourceProperties + err = json.Unmarshal(*v, &premierAddOnPatchResourceProperties) + if err != nil { + return err + } + paopr.PremierAddOnPatchResourceProperties = &premierAddOnPatchResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + paopr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + paopr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + paopr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + paopr.Type = &typeVar + } + } + } + + return nil +} + +// PremierAddOnPatchResourceProperties premierAddOnPatchResource resource specific properties +type PremierAddOnPatchResourceProperties struct { + // Sku - Premier add on SKU. + Sku *string `json:"sku,omitempty"` + // Product - Premier add on Product. + Product *string `json:"product,omitempty"` + // Vendor - Premier add on Vendor. + Vendor *string `json:"vendor,omitempty"` + // MarketplacePublisher - Premier add on Marketplace publisher. + MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` + // MarketplaceOffer - Premier add on Marketplace offer. + MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` +} + +// PremierAddOnProperties premierAddOn resource specific properties +type PremierAddOnProperties struct { + // Sku - Premier add on SKU. + Sku *string `json:"sku,omitempty"` + // Product - Premier add on Product. + Product *string `json:"product,omitempty"` + // Vendor - Premier add on Vendor. + Vendor *string `json:"vendor,omitempty"` + // MarketplacePublisher - Premier add on Marketplace publisher. + MarketplacePublisher *string `json:"marketplacePublisher,omitempty"` + // MarketplaceOffer - Premier add on Marketplace offer. + MarketplaceOffer *string `json:"marketplaceOffer,omitempty"` +} + +// PrivateAccess description of the parameters of Private Access for a Web Site. +type PrivateAccess struct { + autorest.Response `json:"-"` + // PrivateAccessProperties - PrivateAccess resource specific properties + *PrivateAccessProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateAccess. +func (pa PrivateAccess) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pa.PrivateAccessProperties != nil { + objectMap["properties"] = pa.PrivateAccessProperties + } + if pa.Kind != nil { + objectMap["kind"] = pa.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateAccess struct. +func (pa *PrivateAccess) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateAccessProperties PrivateAccessProperties + err = json.Unmarshal(*v, &privateAccessProperties) + if err != nil { + return err + } + pa.PrivateAccessProperties = &privateAccessProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pa.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pa.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pa.Type = &typeVar + } + } + } + + return nil +} + +// PrivateAccessProperties privateAccess resource specific properties +type PrivateAccessProperties struct { + // Enabled - Whether private access is enabled or not. + Enabled *bool `json:"enabled,omitempty"` + // VirtualNetworks - The Virtual Networks (and subnets) allowed to access the site privately. + VirtualNetworks *[]PrivateAccessVirtualNetwork `json:"virtualNetworks,omitempty"` +} + +// PrivateAccessSubnet description of a Virtual Network subnet that is useable for private site access. +type PrivateAccessSubnet struct { + // Name - The name of the subnet. + Name *string `json:"name,omitempty"` + // Key - The key (ID) of the subnet. + Key *int32 `json:"key,omitempty"` +} + +// PrivateAccessVirtualNetwork description of a Virtual Network that is useable for private site access. +type PrivateAccessVirtualNetwork struct { + // Name - The name of the Virtual Network. + Name *string `json:"name,omitempty"` + // Key - The key (ID) of the Virtual Network. + Key *int32 `json:"key,omitempty"` + // ResourceID - The ARM uri of the Virtual Network + ResourceID *string `json:"resourceId,omitempty"` + // Subnets - A List of subnets that access is allowed to on this Virtual Network. An empty array (but not null) is interpreted to mean that all subnets are allowed within this Virtual Network. + Subnets *[]PrivateAccessSubnet `json:"subnets,omitempty"` +} + +// PrivateEndpointConnectionCollection ... +type PrivateEndpointConnectionCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]RemotePrivateEndpointConnectionARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionCollection. +func (pecc PrivateEndpointConnectionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecc.Value != nil { + objectMap["value"] = pecc.Value + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionCollectionIterator provides access to a complete listing of +// RemotePrivateEndpointConnectionARMResource values. +type PrivateEndpointConnectionCollectionIterator struct { + i int + page PrivateEndpointConnectionCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PrivateEndpointConnectionCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateEndpointConnectionCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PrivateEndpointConnectionCollectionIterator) Response() PrivateEndpointConnectionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PrivateEndpointConnectionCollectionIterator) Value() RemotePrivateEndpointConnectionARMResource { + if !iter.page.NotDone() { + return RemotePrivateEndpointConnectionARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionCollectionIterator type. +func NewPrivateEndpointConnectionCollectionIterator(page PrivateEndpointConnectionCollectionPage) PrivateEndpointConnectionCollectionIterator { + return PrivateEndpointConnectionCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pecc PrivateEndpointConnectionCollection) IsEmpty() bool { + return pecc.Value == nil || len(*pecc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pecc PrivateEndpointConnectionCollection) hasNextLink() bool { + return pecc.NextLink != nil && len(*pecc.NextLink) != 0 +} + +// privateEndpointConnectionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pecc PrivateEndpointConnectionCollection) privateEndpointConnectionCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pecc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pecc.NextLink))) +} + +// PrivateEndpointConnectionCollectionPage contains a page of RemotePrivateEndpointConnectionARMResource +// values. +type PrivateEndpointConnectionCollectionPage struct { + fn func(context.Context, PrivateEndpointConnectionCollection) (PrivateEndpointConnectionCollection, error) + pecc PrivateEndpointConnectionCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PrivateEndpointConnectionCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pecc) + if err != nil { + return err + } + page.pecc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionCollectionPage) NotDone() bool { + return !page.pecc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionCollectionPage) Response() PrivateEndpointConnectionCollection { + return page.pecc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionCollectionPage) Values() []RemotePrivateEndpointConnectionARMResource { + if page.pecc.IsEmpty() { + return nil + } + return *page.pecc.Value +} + +// Creates a new instance of the PrivateEndpointConnectionCollectionPage type. +func NewPrivateEndpointConnectionCollectionPage(cur PrivateEndpointConnectionCollection, getNextPage func(context.Context, PrivateEndpointConnectionCollection) (PrivateEndpointConnectionCollection, error)) PrivateEndpointConnectionCollectionPage { + return PrivateEndpointConnectionCollectionPage{ + fn: getNextPage, + pecc: cur, + } +} + +// PrivateLinkConnectionApprovalRequest a request to approve or reject a private endpoint connection +type PrivateLinkConnectionApprovalRequest struct { + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateLinkConnectionApprovalRequestResource private Endpoint Connection Approval ARM resource. +type PrivateLinkConnectionApprovalRequestResource struct { + // PrivateLinkConnectionApprovalRequest - Core resource properties + *PrivateLinkConnectionApprovalRequest `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkConnectionApprovalRequestResource. +func (plcarr PrivateLinkConnectionApprovalRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plcarr.PrivateLinkConnectionApprovalRequest != nil { + objectMap["properties"] = plcarr.PrivateLinkConnectionApprovalRequest + } + if plcarr.Kind != nil { + objectMap["kind"] = plcarr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkConnectionApprovalRequestResource struct. +func (plcarr *PrivateLinkConnectionApprovalRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateLinkConnectionApprovalRequest PrivateLinkConnectionApprovalRequest + err = json.Unmarshal(*v, &privateLinkConnectionApprovalRequest) + if err != nil { + return err + } + plcarr.PrivateLinkConnectionApprovalRequest = &privateLinkConnectionApprovalRequest + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plcarr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plcarr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + plcarr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plcarr.Type = &typeVar + } + } + } + + return nil +} + +// PrivateLinkConnectionState the state of a private link connection +type PrivateLinkConnectionState struct { + // Status - Status of a private link connection + Status *string `json:"status,omitempty"` + // Description - Description of a private link connection + Description *string `json:"description,omitempty"` + // ActionsRequired - ActionsRequired for a private link connection + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// PrivateLinkResource a private link resource +type PrivateLinkResource struct { + ID *string `json:"id,omitempty"` + // Name - Name of a private link resource + Name *string `json:"name,omitempty"` + Type *string `json:"type,omitempty"` + // Properties - Properties of a private link resource + Properties *PrivateLinkResourceProperties `json:"properties,omitempty"` +} + +// PrivateLinkResourceProperties properties of a private link resource +type PrivateLinkResourceProperties struct { + // GroupID - READ-ONLY; GroupId of a private link resource + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - READ-ONLY; RequiredMembers of a private link resource + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - READ-ONLY; RequiredZoneNames of a private link resource + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResourceProperties. +func (plrp PrivateLinkResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateLinkResourcesWrapper wrapper for a collection of private link resources +type PrivateLinkResourcesWrapper struct { + autorest.Response `json:"-"` + Value *[]PrivateLinkResource `json:"value,omitempty"` +} + +// ProcessInfo process Information. +type ProcessInfo struct { + autorest.Response `json:"-"` + // ProcessInfoProperties - ProcessInfo resource specific properties + *ProcessInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessInfo. +func (pi ProcessInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.ProcessInfoProperties != nil { + objectMap["properties"] = pi.ProcessInfoProperties + } + if pi.Kind != nil { + objectMap["kind"] = pi.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProcessInfo struct. +func (pi *ProcessInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var processInfoProperties ProcessInfoProperties + err = json.Unmarshal(*v, &processInfoProperties) + if err != nil { + return err + } + pi.ProcessInfoProperties = &processInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pi.Type = &typeVar + } + } + } + + return nil +} + +// ProcessInfoCollection collection of Kudu process information elements. +type ProcessInfoCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ProcessInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessInfoCollection. +func (pic ProcessInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pic.Value != nil { + objectMap["value"] = pic.Value + } + return json.Marshal(objectMap) +} + +// ProcessInfoCollectionIterator provides access to a complete listing of ProcessInfo values. +type ProcessInfoCollectionIterator struct { + i int + page ProcessInfoCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProcessInfoCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProcessInfoCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProcessInfoCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProcessInfoCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProcessInfoCollectionIterator) Response() ProcessInfoCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProcessInfoCollectionIterator) Value() ProcessInfo { + if !iter.page.NotDone() { + return ProcessInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProcessInfoCollectionIterator type. +func NewProcessInfoCollectionIterator(page ProcessInfoCollectionPage) ProcessInfoCollectionIterator { + return ProcessInfoCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pic ProcessInfoCollection) IsEmpty() bool { + return pic.Value == nil || len(*pic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pic ProcessInfoCollection) hasNextLink() bool { + return pic.NextLink != nil && len(*pic.NextLink) != 0 +} + +// processInfoCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pic ProcessInfoCollection) processInfoCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pic.NextLink))) +} + +// ProcessInfoCollectionPage contains a page of ProcessInfo values. +type ProcessInfoCollectionPage struct { + fn func(context.Context, ProcessInfoCollection) (ProcessInfoCollection, error) + pic ProcessInfoCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProcessInfoCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProcessInfoCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pic) + if err != nil { + return err + } + page.pic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProcessInfoCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProcessInfoCollectionPage) NotDone() bool { + return !page.pic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProcessInfoCollectionPage) Response() ProcessInfoCollection { + return page.pic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProcessInfoCollectionPage) Values() []ProcessInfo { + if page.pic.IsEmpty() { + return nil + } + return *page.pic.Value +} + +// Creates a new instance of the ProcessInfoCollectionPage type. +func NewProcessInfoCollectionPage(cur ProcessInfoCollection, getNextPage func(context.Context, ProcessInfoCollection) (ProcessInfoCollection, error)) ProcessInfoCollectionPage { + return ProcessInfoCollectionPage{ + fn: getNextPage, + pic: cur, + } +} + +// ProcessInfoProperties processInfo resource specific properties +type ProcessInfoProperties struct { + // Identifier - READ-ONLY; ARM Identifier for deployment. + Identifier *int32 `json:"identifier,omitempty"` + // DeploymentName - Deployment name. + DeploymentName *string `json:"deployment_name,omitempty"` + // Href - HRef URI. + Href *string `json:"href,omitempty"` + // Minidump - Minidump URI. + Minidump *string `json:"minidump,omitempty"` + // IsProfileRunning - Is profile running? + IsProfileRunning *bool `json:"is_profile_running,omitempty"` + // IsIisProfileRunning - Is the IIS Profile running? + IsIisProfileRunning *bool `json:"is_iis_profile_running,omitempty"` + // IisProfileTimeoutInSeconds - IIS Profile timeout (seconds). + IisProfileTimeoutInSeconds *float64 `json:"iis_profile_timeout_in_seconds,omitempty"` + // Parent - Parent process. + Parent *string `json:"parent,omitempty"` + // Children - Child process list. + Children *[]string `json:"children,omitempty"` + // Threads - Thread list. + Threads *[]ProcessThreadInfo `json:"threads,omitempty"` + // OpenFileHandles - List of open files. + OpenFileHandles *[]string `json:"open_file_handles,omitempty"` + // Modules - List of modules. + Modules *[]ProcessModuleInfo `json:"modules,omitempty"` + // FileName - File name of this process. + FileName *string `json:"file_name,omitempty"` + // CommandLine - Command line. + CommandLine *string `json:"command_line,omitempty"` + // UserName - User name. + UserName *string `json:"user_name,omitempty"` + // HandleCount - Handle count. + HandleCount *int32 `json:"handle_count,omitempty"` + // ModuleCount - Module count. + ModuleCount *int32 `json:"module_count,omitempty"` + // ThreadCount - Thread count. + ThreadCount *int32 `json:"thread_count,omitempty"` + // StartTime - Start time. + StartTime *date.Time `json:"start_time,omitempty"` + // TotalCPUTime - Total CPU time. + TotalCPUTime *string `json:"total_cpu_time,omitempty"` + // UserCPUTime - User CPU time. + UserCPUTime *string `json:"user_cpu_time,omitempty"` + // PrivilegedCPUTime - Privileged CPU time. + PrivilegedCPUTime *string `json:"privileged_cpu_time,omitempty"` + // WorkingSet - Working set. + WorkingSet *int64 `json:"working_set,omitempty"` + // PeakWorkingSet - Peak working set. + PeakWorkingSet *int64 `json:"peak_working_set,omitempty"` + // PrivateMemory - Private memory size. + PrivateMemory *int64 `json:"private_memory,omitempty"` + // VirtualMemory - Virtual memory size. + VirtualMemory *int64 `json:"virtual_memory,omitempty"` + // PeakVirtualMemory - Peak virtual memory usage. + PeakVirtualMemory *int64 `json:"peak_virtual_memory,omitempty"` + // PagedSystemMemory - Paged system memory. + PagedSystemMemory *int64 `json:"paged_system_memory,omitempty"` + // NonPagedSystemMemory - Non-paged system memory. + NonPagedSystemMemory *int64 `json:"non_paged_system_memory,omitempty"` + // PagedMemory - Paged memory. + PagedMemory *int64 `json:"paged_memory,omitempty"` + // PeakPagedMemory - Peak paged memory. + PeakPagedMemory *int64 `json:"peak_paged_memory,omitempty"` + // TimeStamp - Time stamp. + TimeStamp *date.Time `json:"time_stamp,omitempty"` + // EnvironmentVariables - List of environment variables. + EnvironmentVariables map[string]*string `json:"environment_variables"` + // IsScmSite - Is this the SCM site? + IsScmSite *bool `json:"is_scm_site,omitempty"` + // IsWebjob - Is this a Web Job? + IsWebjob *bool `json:"is_webjob,omitempty"` + // Description - Description of process. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessInfoProperties. +func (pi ProcessInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pi.DeploymentName != nil { + objectMap["deployment_name"] = pi.DeploymentName + } + if pi.Href != nil { + objectMap["href"] = pi.Href + } + if pi.Minidump != nil { + objectMap["minidump"] = pi.Minidump + } + if pi.IsProfileRunning != nil { + objectMap["is_profile_running"] = pi.IsProfileRunning + } + if pi.IsIisProfileRunning != nil { + objectMap["is_iis_profile_running"] = pi.IsIisProfileRunning + } + if pi.IisProfileTimeoutInSeconds != nil { + objectMap["iis_profile_timeout_in_seconds"] = pi.IisProfileTimeoutInSeconds + } + if pi.Parent != nil { + objectMap["parent"] = pi.Parent + } + if pi.Children != nil { + objectMap["children"] = pi.Children + } + if pi.Threads != nil { + objectMap["threads"] = pi.Threads + } + if pi.OpenFileHandles != nil { + objectMap["open_file_handles"] = pi.OpenFileHandles + } + if pi.Modules != nil { + objectMap["modules"] = pi.Modules + } + if pi.FileName != nil { + objectMap["file_name"] = pi.FileName + } + if pi.CommandLine != nil { + objectMap["command_line"] = pi.CommandLine + } + if pi.UserName != nil { + objectMap["user_name"] = pi.UserName + } + if pi.HandleCount != nil { + objectMap["handle_count"] = pi.HandleCount + } + if pi.ModuleCount != nil { + objectMap["module_count"] = pi.ModuleCount + } + if pi.ThreadCount != nil { + objectMap["thread_count"] = pi.ThreadCount + } + if pi.StartTime != nil { + objectMap["start_time"] = pi.StartTime + } + if pi.TotalCPUTime != nil { + objectMap["total_cpu_time"] = pi.TotalCPUTime + } + if pi.UserCPUTime != nil { + objectMap["user_cpu_time"] = pi.UserCPUTime + } + if pi.PrivilegedCPUTime != nil { + objectMap["privileged_cpu_time"] = pi.PrivilegedCPUTime + } + if pi.WorkingSet != nil { + objectMap["working_set"] = pi.WorkingSet + } + if pi.PeakWorkingSet != nil { + objectMap["peak_working_set"] = pi.PeakWorkingSet + } + if pi.PrivateMemory != nil { + objectMap["private_memory"] = pi.PrivateMemory + } + if pi.VirtualMemory != nil { + objectMap["virtual_memory"] = pi.VirtualMemory + } + if pi.PeakVirtualMemory != nil { + objectMap["peak_virtual_memory"] = pi.PeakVirtualMemory + } + if pi.PagedSystemMemory != nil { + objectMap["paged_system_memory"] = pi.PagedSystemMemory + } + if pi.NonPagedSystemMemory != nil { + objectMap["non_paged_system_memory"] = pi.NonPagedSystemMemory + } + if pi.PagedMemory != nil { + objectMap["paged_memory"] = pi.PagedMemory + } + if pi.PeakPagedMemory != nil { + objectMap["peak_paged_memory"] = pi.PeakPagedMemory + } + if pi.TimeStamp != nil { + objectMap["time_stamp"] = pi.TimeStamp + } + if pi.EnvironmentVariables != nil { + objectMap["environment_variables"] = pi.EnvironmentVariables + } + if pi.IsScmSite != nil { + objectMap["is_scm_site"] = pi.IsScmSite + } + if pi.IsWebjob != nil { + objectMap["is_webjob"] = pi.IsWebjob + } + if pi.Description != nil { + objectMap["description"] = pi.Description + } + return json.Marshal(objectMap) +} + +// ProcessModuleInfo process Module Information. +type ProcessModuleInfo struct { + autorest.Response `json:"-"` + // ProcessModuleInfoProperties - ProcessModuleInfo resource specific properties + *ProcessModuleInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessModuleInfo. +func (pmi ProcessModuleInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pmi.ProcessModuleInfoProperties != nil { + objectMap["properties"] = pmi.ProcessModuleInfoProperties + } + if pmi.Kind != nil { + objectMap["kind"] = pmi.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProcessModuleInfo struct. +func (pmi *ProcessModuleInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var processModuleInfoProperties ProcessModuleInfoProperties + err = json.Unmarshal(*v, &processModuleInfoProperties) + if err != nil { + return err + } + pmi.ProcessModuleInfoProperties = &processModuleInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pmi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pmi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pmi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pmi.Type = &typeVar + } + } + } + + return nil +} + +// ProcessModuleInfoCollection collection of Kudu thread information elements. +type ProcessModuleInfoCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ProcessModuleInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessModuleInfoCollection. +func (pmic ProcessModuleInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pmic.Value != nil { + objectMap["value"] = pmic.Value + } + return json.Marshal(objectMap) +} + +// ProcessModuleInfoCollectionIterator provides access to a complete listing of ProcessModuleInfo values. +type ProcessModuleInfoCollectionIterator struct { + i int + page ProcessModuleInfoCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProcessModuleInfoCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProcessModuleInfoCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProcessModuleInfoCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProcessModuleInfoCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProcessModuleInfoCollectionIterator) Response() ProcessModuleInfoCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProcessModuleInfoCollectionIterator) Value() ProcessModuleInfo { + if !iter.page.NotDone() { + return ProcessModuleInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProcessModuleInfoCollectionIterator type. +func NewProcessModuleInfoCollectionIterator(page ProcessModuleInfoCollectionPage) ProcessModuleInfoCollectionIterator { + return ProcessModuleInfoCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pmic ProcessModuleInfoCollection) IsEmpty() bool { + return pmic.Value == nil || len(*pmic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pmic ProcessModuleInfoCollection) hasNextLink() bool { + return pmic.NextLink != nil && len(*pmic.NextLink) != 0 +} + +// processModuleInfoCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pmic ProcessModuleInfoCollection) processModuleInfoCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pmic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pmic.NextLink))) +} + +// ProcessModuleInfoCollectionPage contains a page of ProcessModuleInfo values. +type ProcessModuleInfoCollectionPage struct { + fn func(context.Context, ProcessModuleInfoCollection) (ProcessModuleInfoCollection, error) + pmic ProcessModuleInfoCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProcessModuleInfoCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProcessModuleInfoCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pmic) + if err != nil { + return err + } + page.pmic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProcessModuleInfoCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProcessModuleInfoCollectionPage) NotDone() bool { + return !page.pmic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProcessModuleInfoCollectionPage) Response() ProcessModuleInfoCollection { + return page.pmic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProcessModuleInfoCollectionPage) Values() []ProcessModuleInfo { + if page.pmic.IsEmpty() { + return nil + } + return *page.pmic.Value +} + +// Creates a new instance of the ProcessModuleInfoCollectionPage type. +func NewProcessModuleInfoCollectionPage(cur ProcessModuleInfoCollection, getNextPage func(context.Context, ProcessModuleInfoCollection) (ProcessModuleInfoCollection, error)) ProcessModuleInfoCollectionPage { + return ProcessModuleInfoCollectionPage{ + fn: getNextPage, + pmic: cur, + } +} + +// ProcessModuleInfoProperties processModuleInfo resource specific properties +type ProcessModuleInfoProperties struct { + // BaseAddress - Base address. Used as module identifier in ARM resource URI. + BaseAddress *string `json:"base_address,omitempty"` + // FileName - File name. + FileName *string `json:"file_name,omitempty"` + // Href - HRef URI. + Href *string `json:"href,omitempty"` + // FilePath - File path. + FilePath *string `json:"file_path,omitempty"` + // ModuleMemorySize - Module memory size. + ModuleMemorySize *int32 `json:"module_memory_size,omitempty"` + // FileVersion - File version. + FileVersion *string `json:"file_version,omitempty"` + // FileDescription - File description. + FileDescription *string `json:"file_description,omitempty"` + // Product - Product name. + Product *string `json:"product,omitempty"` + // ProductVersion - Product version. + ProductVersion *string `json:"product_version,omitempty"` + // IsDebug - Is debug? + IsDebug *bool `json:"is_debug,omitempty"` + // Language - Module language (locale). + Language *string `json:"language,omitempty"` +} + +// ProcessThreadInfo process Thread Information. +type ProcessThreadInfo struct { + // ProcessThreadInfoProperties - ProcessThreadInfo resource specific properties + *ProcessThreadInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessThreadInfo. +func (pti ProcessThreadInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pti.ProcessThreadInfoProperties != nil { + objectMap["properties"] = pti.ProcessThreadInfoProperties + } + if pti.Kind != nil { + objectMap["kind"] = pti.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ProcessThreadInfo struct. +func (pti *ProcessThreadInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var processThreadInfoProperties ProcessThreadInfoProperties + err = json.Unmarshal(*v, &processThreadInfoProperties) + if err != nil { + return err + } + pti.ProcessThreadInfoProperties = &processThreadInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pti.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pti.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pti.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pti.Type = &typeVar + } + } + } + + return nil +} + +// ProcessThreadInfoCollection collection of Kudu thread information elements. +type ProcessThreadInfoCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ProcessThreadInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessThreadInfoCollection. +func (ptic ProcessThreadInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ptic.Value != nil { + objectMap["value"] = ptic.Value + } + return json.Marshal(objectMap) +} + +// ProcessThreadInfoCollectionIterator provides access to a complete listing of ProcessThreadInfo values. +type ProcessThreadInfoCollectionIterator struct { + i int + page ProcessThreadInfoCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ProcessThreadInfoCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProcessThreadInfoCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ProcessThreadInfoCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ProcessThreadInfoCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ProcessThreadInfoCollectionIterator) Response() ProcessThreadInfoCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ProcessThreadInfoCollectionIterator) Value() ProcessThreadInfo { + if !iter.page.NotDone() { + return ProcessThreadInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ProcessThreadInfoCollectionIterator type. +func NewProcessThreadInfoCollectionIterator(page ProcessThreadInfoCollectionPage) ProcessThreadInfoCollectionIterator { + return ProcessThreadInfoCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ptic ProcessThreadInfoCollection) IsEmpty() bool { + return ptic.Value == nil || len(*ptic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ptic ProcessThreadInfoCollection) hasNextLink() bool { + return ptic.NextLink != nil && len(*ptic.NextLink) != 0 +} + +// processThreadInfoCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ptic ProcessThreadInfoCollection) processThreadInfoCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ptic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ptic.NextLink))) +} + +// ProcessThreadInfoCollectionPage contains a page of ProcessThreadInfo values. +type ProcessThreadInfoCollectionPage struct { + fn func(context.Context, ProcessThreadInfoCollection) (ProcessThreadInfoCollection, error) + ptic ProcessThreadInfoCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ProcessThreadInfoCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProcessThreadInfoCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ptic) + if err != nil { + return err + } + page.ptic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ProcessThreadInfoCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ProcessThreadInfoCollectionPage) NotDone() bool { + return !page.ptic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ProcessThreadInfoCollectionPage) Response() ProcessThreadInfoCollection { + return page.ptic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ProcessThreadInfoCollectionPage) Values() []ProcessThreadInfo { + if page.ptic.IsEmpty() { + return nil + } + return *page.ptic.Value +} + +// Creates a new instance of the ProcessThreadInfoCollectionPage type. +func NewProcessThreadInfoCollectionPage(cur ProcessThreadInfoCollection, getNextPage func(context.Context, ProcessThreadInfoCollection) (ProcessThreadInfoCollection, error)) ProcessThreadInfoCollectionPage { + return ProcessThreadInfoCollectionPage{ + fn: getNextPage, + ptic: cur, + } +} + +// ProcessThreadInfoProperties processThreadInfo resource specific properties +type ProcessThreadInfoProperties struct { + // Identifier - READ-ONLY; Site extension ID. + Identifier *int32 `json:"identifier,omitempty"` + // Href - HRef URI. + Href *string `json:"href,omitempty"` + // Process - Process URI. + Process *string `json:"process,omitempty"` + // StartAddress - Start address. + StartAddress *string `json:"start_address,omitempty"` + // CurrentPriority - Current thread priority. + CurrentPriority *int32 `json:"current_priority,omitempty"` + // PriorityLevel - Thread priority level. + PriorityLevel *string `json:"priority_level,omitempty"` + // BasePriority - Base priority. + BasePriority *int32 `json:"base_priority,omitempty"` + // StartTime - Start time. + StartTime *date.Time `json:"start_time,omitempty"` + // TotalProcessorTime - Total processor time. + TotalProcessorTime *string `json:"total_processor_time,omitempty"` + // UserProcessorTime - User processor time. + UserProcessorTime *string `json:"user_processor_time,omitempty"` + // State - Thread state. + State *string `json:"state,omitempty"` + // WaitReason - Wait reason. + WaitReason *string `json:"wait_reason,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProcessThreadInfoProperties. +func (pti ProcessThreadInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pti.Href != nil { + objectMap["href"] = pti.Href + } + if pti.Process != nil { + objectMap["process"] = pti.Process + } + if pti.StartAddress != nil { + objectMap["start_address"] = pti.StartAddress + } + if pti.CurrentPriority != nil { + objectMap["current_priority"] = pti.CurrentPriority + } + if pti.PriorityLevel != nil { + objectMap["priority_level"] = pti.PriorityLevel + } + if pti.BasePriority != nil { + objectMap["base_priority"] = pti.BasePriority + } + if pti.StartTime != nil { + objectMap["start_time"] = pti.StartTime + } + if pti.TotalProcessorTime != nil { + objectMap["total_processor_time"] = pti.TotalProcessorTime + } + if pti.UserProcessorTime != nil { + objectMap["user_processor_time"] = pti.UserProcessorTime + } + if pti.State != nil { + objectMap["state"] = pti.State + } + if pti.WaitReason != nil { + objectMap["wait_reason"] = pti.WaitReason + } + return json.Marshal(objectMap) +} + +// ProxyOnlyResource azure proxy only resource. This resource is not tracked by Azure Resource Manager. +type ProxyOnlyResource struct { + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyOnlyResource. +func (por ProxyOnlyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if por.Kind != nil { + objectMap["kind"] = por.Kind + } + return json.Marshal(objectMap) +} + +// PublicCertificate public certificate object +type PublicCertificate struct { + autorest.Response `json:"-"` + // PublicCertificateProperties - PublicCertificate resource specific properties + *PublicCertificateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PublicCertificate. +func (pc PublicCertificate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.PublicCertificateProperties != nil { + objectMap["properties"] = pc.PublicCertificateProperties + } + if pc.Kind != nil { + objectMap["kind"] = pc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PublicCertificate struct. +func (pc *PublicCertificate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var publicCertificateProperties PublicCertificateProperties + err = json.Unmarshal(*v, &publicCertificateProperties) + if err != nil { + return err + } + pc.PublicCertificateProperties = &publicCertificateProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + pc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pc.Type = &typeVar + } + } + } + + return nil +} + +// PublicCertificateCollection collection of public certificates +type PublicCertificateCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]PublicCertificate `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PublicCertificateCollection. +func (pcc PublicCertificateCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcc.Value != nil { + objectMap["value"] = pcc.Value + } + return json.Marshal(objectMap) +} + +// PublicCertificateCollectionIterator provides access to a complete listing of PublicCertificate values. +type PublicCertificateCollectionIterator struct { + i int + page PublicCertificateCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PublicCertificateCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PublicCertificateCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PublicCertificateCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PublicCertificateCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PublicCertificateCollectionIterator) Response() PublicCertificateCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PublicCertificateCollectionIterator) Value() PublicCertificate { + if !iter.page.NotDone() { + return PublicCertificate{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PublicCertificateCollectionIterator type. +func NewPublicCertificateCollectionIterator(page PublicCertificateCollectionPage) PublicCertificateCollectionIterator { + return PublicCertificateCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcc PublicCertificateCollection) IsEmpty() bool { + return pcc.Value == nil || len(*pcc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcc PublicCertificateCollection) hasNextLink() bool { + return pcc.NextLink != nil && len(*pcc.NextLink) != 0 +} + +// publicCertificateCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcc PublicCertificateCollection) publicCertificateCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcc.NextLink))) +} + +// PublicCertificateCollectionPage contains a page of PublicCertificate values. +type PublicCertificateCollectionPage struct { + fn func(context.Context, PublicCertificateCollection) (PublicCertificateCollection, error) + pcc PublicCertificateCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PublicCertificateCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PublicCertificateCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcc) + if err != nil { + return err + } + page.pcc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PublicCertificateCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PublicCertificateCollectionPage) NotDone() bool { + return !page.pcc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PublicCertificateCollectionPage) Response() PublicCertificateCollection { + return page.pcc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PublicCertificateCollectionPage) Values() []PublicCertificate { + if page.pcc.IsEmpty() { + return nil + } + return *page.pcc.Value +} + +// Creates a new instance of the PublicCertificateCollectionPage type. +func NewPublicCertificateCollectionPage(cur PublicCertificateCollection, getNextPage func(context.Context, PublicCertificateCollection) (PublicCertificateCollection, error)) PublicCertificateCollectionPage { + return PublicCertificateCollectionPage{ + fn: getNextPage, + pcc: cur, + } +} + +// PublicCertificateProperties publicCertificate resource specific properties +type PublicCertificateProperties struct { + // Blob - Public Certificate byte array + Blob *[]byte `json:"blob,omitempty"` + // PublicCertificateLocation - Public Certificate Location. Possible values include: 'PublicCertificateLocationCurrentUserMy', 'PublicCertificateLocationLocalMachineMy', 'PublicCertificateLocationUnknown' + PublicCertificateLocation PublicCertificateLocation `json:"publicCertificateLocation,omitempty"` + // Thumbprint - READ-ONLY; Certificate Thumbprint + Thumbprint *string `json:"thumbprint,omitempty"` +} + +// MarshalJSON is the custom marshaler for PublicCertificateProperties. +func (pc PublicCertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pc.Blob != nil { + objectMap["blob"] = pc.Blob + } + if pc.PublicCertificateLocation != "" { + objectMap["publicCertificateLocation"] = pc.PublicCertificateLocation + } + return json.Marshal(objectMap) +} + +// PublishingCredentialsPoliciesCollection publishing Credentials Policies entity collection ARM resource. +type PublishingCredentialsPoliciesCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]CsmPublishingCredentialsPoliciesEntity `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PublishingCredentialsPoliciesCollection. +func (pcpc PublishingCredentialsPoliciesCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pcpc.Value != nil { + objectMap["value"] = pcpc.Value + } + return json.Marshal(objectMap) +} + +// PublishingCredentialsPoliciesCollectionIterator provides access to a complete listing of +// CsmPublishingCredentialsPoliciesEntity values. +type PublishingCredentialsPoliciesCollectionIterator struct { + i int + page PublishingCredentialsPoliciesCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PublishingCredentialsPoliciesCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PublishingCredentialsPoliciesCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PublishingCredentialsPoliciesCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PublishingCredentialsPoliciesCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PublishingCredentialsPoliciesCollectionIterator) Response() PublishingCredentialsPoliciesCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PublishingCredentialsPoliciesCollectionIterator) Value() CsmPublishingCredentialsPoliciesEntity { + if !iter.page.NotDone() { + return CsmPublishingCredentialsPoliciesEntity{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PublishingCredentialsPoliciesCollectionIterator type. +func NewPublishingCredentialsPoliciesCollectionIterator(page PublishingCredentialsPoliciesCollectionPage) PublishingCredentialsPoliciesCollectionIterator { + return PublishingCredentialsPoliciesCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pcpc PublishingCredentialsPoliciesCollection) IsEmpty() bool { + return pcpc.Value == nil || len(*pcpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pcpc PublishingCredentialsPoliciesCollection) hasNextLink() bool { + return pcpc.NextLink != nil && len(*pcpc.NextLink) != 0 +} + +// publishingCredentialsPoliciesCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pcpc PublishingCredentialsPoliciesCollection) publishingCredentialsPoliciesCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !pcpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pcpc.NextLink))) +} + +// PublishingCredentialsPoliciesCollectionPage contains a page of CsmPublishingCredentialsPoliciesEntity +// values. +type PublishingCredentialsPoliciesCollectionPage struct { + fn func(context.Context, PublishingCredentialsPoliciesCollection) (PublishingCredentialsPoliciesCollection, error) + pcpc PublishingCredentialsPoliciesCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PublishingCredentialsPoliciesCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PublishingCredentialsPoliciesCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pcpc) + if err != nil { + return err + } + page.pcpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PublishingCredentialsPoliciesCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PublishingCredentialsPoliciesCollectionPage) NotDone() bool { + return !page.pcpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PublishingCredentialsPoliciesCollectionPage) Response() PublishingCredentialsPoliciesCollection { + return page.pcpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PublishingCredentialsPoliciesCollectionPage) Values() []CsmPublishingCredentialsPoliciesEntity { + if page.pcpc.IsEmpty() { + return nil + } + return *page.pcpc.Value +} + +// Creates a new instance of the PublishingCredentialsPoliciesCollectionPage type. +func NewPublishingCredentialsPoliciesCollectionPage(cur PublishingCredentialsPoliciesCollection, getNextPage func(context.Context, PublishingCredentialsPoliciesCollection) (PublishingCredentialsPoliciesCollection, error)) PublishingCredentialsPoliciesCollectionPage { + return PublishingCredentialsPoliciesCollectionPage{ + fn: getNextPage, + pcpc: cur, + } +} + +// PushSettings push settings for the App. +type PushSettings struct { + autorest.Response `json:"-"` + // PushSettingsProperties - PushSettings resource specific properties + *PushSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for PushSettings. +func (ps PushSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ps.PushSettingsProperties != nil { + objectMap["properties"] = ps.PushSettingsProperties + } + if ps.Kind != nil { + objectMap["kind"] = ps.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PushSettings struct. +func (ps *PushSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var pushSettingsProperties PushSettingsProperties + err = json.Unmarshal(*v, &pushSettingsProperties) + if err != nil { + return err + } + ps.PushSettingsProperties = &pushSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ps.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ps.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ps.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ps.Type = &typeVar + } + } + } + + return nil +} + +// PushSettingsProperties pushSettings resource specific properties +type PushSettingsProperties struct { + // IsPushEnabled - Gets or sets a flag indicating whether the Push endpoint is enabled. + IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + // TagWhitelistJSON - Gets or sets a JSON string containing a list of tags that are whitelisted for use by the push registration endpoint. + TagWhitelistJSON *string `json:"tagWhitelistJson,omitempty"` + // TagsRequiringAuth - Gets or sets a JSON string containing a list of tags that require user authentication to be used in the push registration endpoint. + // Tags can consist of alphanumeric characters and the following: + // '_', '@', '#', '.', ':', '-'. + // Validation should be performed at the PushRequestHandler. + TagsRequiringAuth *string `json:"tagsRequiringAuth,omitempty"` + // DynamicTagsJSON - Gets or sets a JSON string containing a list of dynamic tags that will be evaluated from user claims in the push registration endpoint. + DynamicTagsJSON *string `json:"dynamicTagsJson,omitempty"` +} + +// QueryUtterancesResult result for utterances query. +type QueryUtterancesResult struct { + // SampleUtterance - A sample utterance. + SampleUtterance *SampleUtterance `json:"sampleUtterance,omitempty"` + // Score - Score of a sample utterance. + Score *float64 `json:"score,omitempty"` +} + +// QueryUtterancesResults suggested utterances where the detector can be applicable +type QueryUtterancesResults struct { + // Query - Search Query. + Query *string `json:"query,omitempty"` + // Results - Array of utterance results for search query. + Results *[]QueryUtterancesResult `json:"results,omitempty"` +} + +// QueueScaleRule container App container Azure Queue based scaling rule. +type QueueScaleRule struct { + // QueueName - Queue name. + QueueName *string `json:"queueName,omitempty"` + // QueueLength - Queue length. + QueueLength *int32 `json:"queueLength,omitempty"` + // Auth - Authentication secrets for the queue scale rule. + Auth *[]ScaleRuleAuth `json:"auth,omitempty"` +} + +// RampUpRule routing rules for ramp up testing. This rule allows to redirect static traffic % to a slot or +// to gradually change routing % based on performance. +type RampUpRule struct { + // ActionHostName - Hostname of a slot to which the traffic will be redirected if decided to. E.g. myapp-stage.azurewebsites.net. + ActionHostName *string `json:"actionHostName,omitempty"` + // ReroutePercentage - Percentage of the traffic which will be redirected to ActionHostName. + ReroutePercentage *float64 `json:"reroutePercentage,omitempty"` + // ChangeStep - In auto ramp up scenario this is the step to add/remove from ReroutePercentage until it reaches \nMinReroutePercentage or + // MaxReroutePercentage. Site metrics are checked every N minutes specified in ChangeIntervalInMinutes.\nCustom decision algorithm + // can be provided in TiPCallback site extension which URL can be specified in ChangeDecisionCallbackUrl. + ChangeStep *float64 `json:"changeStep,omitempty"` + // ChangeIntervalInMinutes - Specifies interval in minutes to reevaluate ReroutePercentage. + ChangeIntervalInMinutes *int32 `json:"changeIntervalInMinutes,omitempty"` + // MinReroutePercentage - Specifies lower boundary above which ReroutePercentage will stay. + MinReroutePercentage *float64 `json:"minReroutePercentage,omitempty"` + // MaxReroutePercentage - Specifies upper boundary below which ReroutePercentage will stay. + MaxReroutePercentage *float64 `json:"maxReroutePercentage,omitempty"` + // ChangeDecisionCallbackURL - Custom decision algorithm can be provided in TiPCallback site extension which URL can be specified. See TiPCallback site extension for the scaffold and contracts. + // https://www.siteextensions.net/packages/TiPCallback/ + ChangeDecisionCallbackURL *string `json:"changeDecisionCallbackUrl,omitempty"` + // Name - Name of the routing rule. The recommended name would be to point to the slot which will receive the traffic in the experiment. + Name *string `json:"name,omitempty"` +} + +// ReadCloser ... +type ReadCloser struct { + autorest.Response `json:"-"` + Value *io.ReadCloser `json:"value,omitempty"` +} + +// Recommendation represents a recommendation result generated by the recommendation engine. +type Recommendation struct { + // RecommendationProperties - Recommendation resource specific properties + *RecommendationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Recommendation. +func (r Recommendation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RecommendationProperties != nil { + objectMap["properties"] = r.RecommendationProperties + } + if r.Kind != nil { + objectMap["kind"] = r.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Recommendation struct. +func (r *Recommendation) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recommendationProperties RecommendationProperties + err = json.Unmarshal(*v, &recommendationProperties) + if err != nil { + return err + } + r.RecommendationProperties = &recommendationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + r.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + } + } + + return nil +} + +// RecommendationCollection collection of recommendations. +type RecommendationCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Recommendation `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecommendationCollection. +func (rc RecommendationCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rc.Value != nil { + objectMap["value"] = rc.Value + } + return json.Marshal(objectMap) +} + +// RecommendationCollectionIterator provides access to a complete listing of Recommendation values. +type RecommendationCollectionIterator struct { + i int + page RecommendationCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RecommendationCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RecommendationCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RecommendationCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RecommendationCollectionIterator) Response() RecommendationCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RecommendationCollectionIterator) Value() Recommendation { + if !iter.page.NotDone() { + return Recommendation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RecommendationCollectionIterator type. +func NewRecommendationCollectionIterator(page RecommendationCollectionPage) RecommendationCollectionIterator { + return RecommendationCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rc RecommendationCollection) IsEmpty() bool { + return rc.Value == nil || len(*rc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rc RecommendationCollection) hasNextLink() bool { + return rc.NextLink != nil && len(*rc.NextLink) != 0 +} + +// recommendationCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rc RecommendationCollection) recommendationCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rc.NextLink))) +} + +// RecommendationCollectionPage contains a page of Recommendation values. +type RecommendationCollectionPage struct { + fn func(context.Context, RecommendationCollection) (RecommendationCollection, error) + rc RecommendationCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RecommendationCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rc) + if err != nil { + return err + } + page.rc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RecommendationCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RecommendationCollectionPage) NotDone() bool { + return !page.rc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RecommendationCollectionPage) Response() RecommendationCollection { + return page.rc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RecommendationCollectionPage) Values() []Recommendation { + if page.rc.IsEmpty() { + return nil + } + return *page.rc.Value +} + +// Creates a new instance of the RecommendationCollectionPage type. +func NewRecommendationCollectionPage(cur RecommendationCollection, getNextPage func(context.Context, RecommendationCollection) (RecommendationCollection, error)) RecommendationCollectionPage { + return RecommendationCollectionPage{ + fn: getNextPage, + rc: cur, + } +} + +// RecommendationProperties recommendation resource specific properties +type RecommendationProperties struct { + // CreationTime - Timestamp when this instance was created. + CreationTime *date.Time `json:"creationTime,omitempty"` + // RecommendationID - A GUID value that each recommendation object is associated with. + RecommendationID *uuid.UUID `json:"recommendationId,omitempty"` + // ResourceID - Full ARM resource ID string that this recommendation object is associated with. + ResourceID *string `json:"resourceId,omitempty"` + // ResourceScope - Name of a resource type this recommendation applies, e.g. Subscription, ServerFarm, Site. Possible values include: 'ResourceScopeTypeServerFarm', 'ResourceScopeTypeSubscription', 'ResourceScopeTypeWebSite' + ResourceScope ResourceScopeType `json:"resourceScope,omitempty"` + // RuleName - Unique name of the rule. + RuleName *string `json:"ruleName,omitempty"` + // DisplayName - UI friendly name of the rule (may not be unique). + DisplayName *string `json:"displayName,omitempty"` + // Message - Recommendation text. + Message *string `json:"message,omitempty"` + // Level - Level indicating how critical this recommendation can impact. Possible values include: 'NotificationLevelCritical', 'NotificationLevelWarning', 'NotificationLevelInformation', 'NotificationLevelNonUrgentSuggestion' + Level NotificationLevel `json:"level,omitempty"` + // Channels - List of channels that this recommendation can apply. Possible values include: 'ChannelsNotification', 'ChannelsAPI', 'ChannelsEmail', 'ChannelsWebhook', 'ChannelsAll' + Channels Channels `json:"channels,omitempty"` + // CategoryTags - READ-ONLY; The list of category tags that this recommendation belongs to. + CategoryTags *[]string `json:"categoryTags,omitempty"` + // ActionName - Name of action recommended by this object. + ActionName *string `json:"actionName,omitempty"` + // Enabled - True if this recommendation is still valid (i.e. "actionable"). False if it is invalid. + Enabled *int32 `json:"enabled,omitempty"` + // States - The list of states of this recommendation. If it's null then it should be considered "Active". + States *[]string `json:"states,omitempty"` + // StartTime - The beginning time in UTC of a range that the recommendation refers to. + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - The end time in UTC of a range that the recommendation refers to. + EndTime *date.Time `json:"endTime,omitempty"` + // NextNotificationTime - When to notify this recommendation next in UTC. Null means that this will never be notified anymore. + NextNotificationTime *date.Time `json:"nextNotificationTime,omitempty"` + // NotificationExpirationTime - Date and time in UTC when this notification expires. + NotificationExpirationTime *date.Time `json:"notificationExpirationTime,omitempty"` + // NotifiedTime - Last timestamp in UTC this instance was actually notified. Null means that this recommendation hasn't been notified yet. + NotifiedTime *date.Time `json:"notifiedTime,omitempty"` + // Score - A metric value measured by the rule. + Score *float64 `json:"score,omitempty"` + // IsDynamic - True if this is associated with a dynamically added rule + IsDynamic *bool `json:"isDynamic,omitempty"` + // ExtensionName - Extension name of the portal if exists. + ExtensionName *string `json:"extensionName,omitempty"` + // BladeName - Deep link to a blade on the portal. + BladeName *string `json:"bladeName,omitempty"` + // ForwardLink - Forward link to an external document associated with the rule. + ForwardLink *string `json:"forwardLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecommendationProperties. +func (r RecommendationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.CreationTime != nil { + objectMap["creationTime"] = r.CreationTime + } + if r.RecommendationID != nil { + objectMap["recommendationId"] = r.RecommendationID + } + if r.ResourceID != nil { + objectMap["resourceId"] = r.ResourceID + } + if r.ResourceScope != "" { + objectMap["resourceScope"] = r.ResourceScope + } + if r.RuleName != nil { + objectMap["ruleName"] = r.RuleName + } + if r.DisplayName != nil { + objectMap["displayName"] = r.DisplayName + } + if r.Message != nil { + objectMap["message"] = r.Message + } + if r.Level != "" { + objectMap["level"] = r.Level + } + if r.Channels != "" { + objectMap["channels"] = r.Channels + } + if r.ActionName != nil { + objectMap["actionName"] = r.ActionName + } + if r.Enabled != nil { + objectMap["enabled"] = r.Enabled + } + if r.States != nil { + objectMap["states"] = r.States + } + if r.StartTime != nil { + objectMap["startTime"] = r.StartTime + } + if r.EndTime != nil { + objectMap["endTime"] = r.EndTime + } + if r.NextNotificationTime != nil { + objectMap["nextNotificationTime"] = r.NextNotificationTime + } + if r.NotificationExpirationTime != nil { + objectMap["notificationExpirationTime"] = r.NotificationExpirationTime + } + if r.NotifiedTime != nil { + objectMap["notifiedTime"] = r.NotifiedTime + } + if r.Score != nil { + objectMap["score"] = r.Score + } + if r.IsDynamic != nil { + objectMap["isDynamic"] = r.IsDynamic + } + if r.ExtensionName != nil { + objectMap["extensionName"] = r.ExtensionName + } + if r.BladeName != nil { + objectMap["bladeName"] = r.BladeName + } + if r.ForwardLink != nil { + objectMap["forwardLink"] = r.ForwardLink + } + return json.Marshal(objectMap) +} + +// RecommendationRule represents a recommendation rule that the recommendation engine can perform. +type RecommendationRule struct { + autorest.Response `json:"-"` + // RecommendationRuleProperties - RecommendationRule resource specific properties + *RecommendationRuleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecommendationRule. +func (rr RecommendationRule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RecommendationRuleProperties != nil { + objectMap["properties"] = rr.RecommendationRuleProperties + } + if rr.Kind != nil { + objectMap["kind"] = rr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RecommendationRule struct. +func (rr *RecommendationRule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var recommendationRuleProperties RecommendationRuleProperties + err = json.Unmarshal(*v, &recommendationRuleProperties) + if err != nil { + return err + } + rr.RecommendationRuleProperties = &recommendationRuleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + } + } + + return nil +} + +// RecommendationRuleProperties recommendationRule resource specific properties +type RecommendationRuleProperties struct { + // RecommendationName - Unique name of the rule. + RecommendationName *string `json:"recommendationName,omitempty"` + // DisplayName - UI friendly name of the rule. + DisplayName *string `json:"displayName,omitempty"` + // Message - Localized name of the rule (Good for UI). + Message *string `json:"message,omitempty"` + // RecommendationID - Recommendation ID of an associated recommendation object tied to the rule, if exists. + // If such an object doesn't exist, it is set to null. + RecommendationID *uuid.UUID `json:"recommendationId,omitempty"` + // Description - Localized detailed description of the rule. + Description *string `json:"description,omitempty"` + // ActionName - Name of action that is recommended by this rule in string. + ActionName *string `json:"actionName,omitempty"` + // Level - Level of impact indicating how critical this rule is. Possible values include: 'NotificationLevelCritical', 'NotificationLevelWarning', 'NotificationLevelInformation', 'NotificationLevelNonUrgentSuggestion' + Level NotificationLevel `json:"level,omitempty"` + // Channels - List of available channels that this rule applies. Possible values include: 'ChannelsNotification', 'ChannelsAPI', 'ChannelsEmail', 'ChannelsWebhook', 'ChannelsAll' + Channels Channels `json:"channels,omitempty"` + // CategoryTags - READ-ONLY; The list of category tags that this recommendation rule belongs to. + CategoryTags *[]string `json:"categoryTags,omitempty"` + // IsDynamic - True if this is associated with a dynamically added rule + IsDynamic *bool `json:"isDynamic,omitempty"` + // ExtensionName - Extension name of the portal if exists. Applicable to dynamic rule only. + ExtensionName *string `json:"extensionName,omitempty"` + // BladeName - Deep link to a blade on the portal. Applicable to dynamic rule only. + BladeName *string `json:"bladeName,omitempty"` + // ForwardLink - Forward link to an external document associated with the rule. Applicable to dynamic rule only. + ForwardLink *string `json:"forwardLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for RecommendationRuleProperties. +func (rr RecommendationRuleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RecommendationName != nil { + objectMap["recommendationName"] = rr.RecommendationName + } + if rr.DisplayName != nil { + objectMap["displayName"] = rr.DisplayName + } + if rr.Message != nil { + objectMap["message"] = rr.Message + } + if rr.RecommendationID != nil { + objectMap["recommendationId"] = rr.RecommendationID + } + if rr.Description != nil { + objectMap["description"] = rr.Description + } + if rr.ActionName != nil { + objectMap["actionName"] = rr.ActionName + } + if rr.Level != "" { + objectMap["level"] = rr.Level + } + if rr.Channels != "" { + objectMap["channels"] = rr.Channels + } + if rr.IsDynamic != nil { + objectMap["isDynamic"] = rr.IsDynamic + } + if rr.ExtensionName != nil { + objectMap["extensionName"] = rr.ExtensionName + } + if rr.BladeName != nil { + objectMap["bladeName"] = rr.BladeName + } + if rr.ForwardLink != nil { + objectMap["forwardLink"] = rr.ForwardLink + } + return json.Marshal(objectMap) +} + +// RegistryCredentials container App Private Registry +type RegistryCredentials struct { + // Server - Container Registry Server + Server *string `json:"server,omitempty"` + // Username - Container Registry Username + Username *string `json:"username,omitempty"` + // PasswordSecretRef - The name of the Secret that contains the registry login password + PasswordSecretRef *string `json:"passwordSecretRef,omitempty"` +} + +// ReissueCertificateOrderRequest class representing certificate reissue request. +type ReissueCertificateOrderRequest struct { + // ReissueCertificateOrderRequestProperties - ReissueCertificateOrderRequest resource specific properties + *ReissueCertificateOrderRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReissueCertificateOrderRequest. +func (rcor ReissueCertificateOrderRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcor.ReissueCertificateOrderRequestProperties != nil { + objectMap["properties"] = rcor.ReissueCertificateOrderRequestProperties + } + if rcor.Kind != nil { + objectMap["kind"] = rcor.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReissueCertificateOrderRequest struct. +func (rcor *ReissueCertificateOrderRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var reissueCertificateOrderRequestProperties ReissueCertificateOrderRequestProperties + err = json.Unmarshal(*v, &reissueCertificateOrderRequestProperties) + if err != nil { + return err + } + rcor.ReissueCertificateOrderRequestProperties = &reissueCertificateOrderRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rcor.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcor.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rcor.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rcor.Type = &typeVar + } + } + } + + return nil +} + +// ReissueCertificateOrderRequestProperties reissueCertificateOrderRequest resource specific properties +type ReissueCertificateOrderRequestProperties struct { + // KeySize - Certificate Key Size. + KeySize *int32 `json:"keySize,omitempty"` + // DelayExistingRevokeInHours - Delay in hours to revoke existing certificate after the new certificate is issued. + DelayExistingRevokeInHours *int32 `json:"delayExistingRevokeInHours,omitempty"` + // Csr - Csr to be used for re-key operation. + Csr *string `json:"csr,omitempty"` + // IsPrivateKeyExternal - Should we change the ASC type (from managed private key to external private key and vice versa). + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty"` +} + +// RelayServiceConnectionEntity hybrid Connection for an App Service app. +type RelayServiceConnectionEntity struct { + autorest.Response `json:"-"` + // RelayServiceConnectionEntityProperties - RelayServiceConnectionEntity resource specific properties + *RelayServiceConnectionEntityProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RelayServiceConnectionEntity. +func (rsce RelayServiceConnectionEntity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rsce.RelayServiceConnectionEntityProperties != nil { + objectMap["properties"] = rsce.RelayServiceConnectionEntityProperties + } + if rsce.Kind != nil { + objectMap["kind"] = rsce.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RelayServiceConnectionEntity struct. +func (rsce *RelayServiceConnectionEntity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var relayServiceConnectionEntityProperties RelayServiceConnectionEntityProperties + err = json.Unmarshal(*v, &relayServiceConnectionEntityProperties) + if err != nil { + return err + } + rsce.RelayServiceConnectionEntityProperties = &relayServiceConnectionEntityProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rsce.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rsce.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rsce.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rsce.Type = &typeVar + } + } + } + + return nil +} + +// RelayServiceConnectionEntityProperties relayServiceConnectionEntity resource specific properties +type RelayServiceConnectionEntityProperties struct { + EntityName *string `json:"entityName,omitempty"` + EntityConnectionString *string `json:"entityConnectionString,omitempty"` + ResourceType *string `json:"resourceType,omitempty"` + ResourceConnectionString *string `json:"resourceConnectionString,omitempty"` + Hostname *string `json:"hostname,omitempty"` + Port *int32 `json:"port,omitempty"` + BiztalkURI *string `json:"biztalkUri,omitempty"` +} + +// RemotePrivateEndpointConnection a remote private endpoint connection +type RemotePrivateEndpointConnection struct { + // RemotePrivateEndpointConnectionProperties - RemotePrivateEndpointConnection resource specific properties + *RemotePrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RemotePrivateEndpointConnection. +func (rpec RemotePrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpec.RemotePrivateEndpointConnectionProperties != nil { + objectMap["properties"] = rpec.RemotePrivateEndpointConnectionProperties + } + if rpec.Kind != nil { + objectMap["kind"] = rpec.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RemotePrivateEndpointConnection struct. +func (rpec *RemotePrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var remotePrivateEndpointConnectionProperties RemotePrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &remotePrivateEndpointConnectionProperties) + if err != nil { + return err + } + rpec.RemotePrivateEndpointConnectionProperties = &remotePrivateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rpec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rpec.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rpec.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rpec.Type = &typeVar + } + } + } + + return nil +} + +// RemotePrivateEndpointConnectionARMResource remote Private Endpoint Connection ARM resource. +type RemotePrivateEndpointConnectionARMResource struct { + autorest.Response `json:"-"` + // RemotePrivateEndpointConnectionARMResourceProperties - RemotePrivateEndpointConnectionARMResource resource specific properties + *RemotePrivateEndpointConnectionARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RemotePrivateEndpointConnectionARMResource. +func (rpecar RemotePrivateEndpointConnectionARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpecar.RemotePrivateEndpointConnectionARMResourceProperties != nil { + objectMap["properties"] = rpecar.RemotePrivateEndpointConnectionARMResourceProperties + } + if rpecar.Kind != nil { + objectMap["kind"] = rpecar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RemotePrivateEndpointConnectionARMResource struct. +func (rpecar *RemotePrivateEndpointConnectionARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var remotePrivateEndpointConnectionARMResourceProperties RemotePrivateEndpointConnectionARMResourceProperties + err = json.Unmarshal(*v, &remotePrivateEndpointConnectionARMResourceProperties) + if err != nil { + return err + } + rpecar.RemotePrivateEndpointConnectionARMResourceProperties = &remotePrivateEndpointConnectionARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rpecar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rpecar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rpecar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rpecar.Type = &typeVar + } + } + } + + return nil +} + +// RemotePrivateEndpointConnectionARMResourceProperties remotePrivateEndpointConnectionARMResource resource +// specific properties +type RemotePrivateEndpointConnectionARMResourceProperties struct { + // ProvisioningState - READ-ONLY + ProvisioningState *string `json:"provisioningState,omitempty"` + // PrivateEndpoint - PrivateEndpoint of a remote private endpoint connection + PrivateEndpoint *ArmIDWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // IPAddresses - Private IPAddresses mapped to the remote private endpoint + IPAddresses *[]string `json:"ipAddresses,omitempty"` +} + +// MarshalJSON is the custom marshaler for RemotePrivateEndpointConnectionARMResourceProperties. +func (rpecar RemotePrivateEndpointConnectionARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpecar.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = rpecar.PrivateEndpoint + } + if rpecar.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = rpecar.PrivateLinkServiceConnectionState + } + if rpecar.IPAddresses != nil { + objectMap["ipAddresses"] = rpecar.IPAddresses + } + return json.Marshal(objectMap) +} + +// RemotePrivateEndpointConnectionProperties remotePrivateEndpointConnection resource specific properties +type RemotePrivateEndpointConnectionProperties struct { + // ProvisioningState - READ-ONLY + ProvisioningState *string `json:"provisioningState,omitempty"` + // PrivateEndpoint - PrivateEndpoint of a remote private endpoint connection + PrivateEndpoint *ArmIDWrapper `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // IPAddresses - Private IPAddresses mapped to the remote private endpoint + IPAddresses *[]string `json:"ipAddresses,omitempty"` +} + +// MarshalJSON is the custom marshaler for RemotePrivateEndpointConnectionProperties. +func (rpec RemotePrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rpec.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = rpec.PrivateEndpoint + } + if rpec.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = rpec.PrivateLinkServiceConnectionState + } + if rpec.IPAddresses != nil { + objectMap["ipAddresses"] = rpec.IPAddresses + } + return json.Marshal(objectMap) +} + +// Rendering instructions for rendering the data +type Rendering struct { + // Type - Rendering Type. Possible values include: 'RenderingTypeNoGraph', 'RenderingTypeTable', 'RenderingTypeTimeSeries', 'RenderingTypeTimeSeriesPerInstance', 'RenderingTypePieChart', 'RenderingTypeDataSummary', 'RenderingTypeEmail', 'RenderingTypeInsights', 'RenderingTypeDynamicInsight', 'RenderingTypeMarkdown', 'RenderingTypeDetector', 'RenderingTypeDropDown', 'RenderingTypeCard', 'RenderingTypeSolution', 'RenderingTypeGuage', 'RenderingTypeForm', 'RenderingTypeChangeSets', 'RenderingTypeChangeAnalysisOnboarding', 'RenderingTypeChangesView', 'RenderingTypeAppInsight', 'RenderingTypeDependencyGraph', 'RenderingTypeDownTime', 'RenderingTypeSummaryCard', 'RenderingTypeSearchComponent', 'RenderingTypeAppInsightEnablement' + Type RenderingType `json:"type,omitempty"` + // Title - Title of data + Title *string `json:"title,omitempty"` + // Description - Description of the data that will help it be interpreted + Description *string `json:"description,omitempty"` +} + +// RenewCertificateOrderRequest class representing certificate renew request. +type RenewCertificateOrderRequest struct { + // RenewCertificateOrderRequestProperties - RenewCertificateOrderRequest resource specific properties + *RenewCertificateOrderRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RenewCertificateOrderRequest. +func (rcor RenewCertificateOrderRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rcor.RenewCertificateOrderRequestProperties != nil { + objectMap["properties"] = rcor.RenewCertificateOrderRequestProperties + } + if rcor.Kind != nil { + objectMap["kind"] = rcor.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RenewCertificateOrderRequest struct. +func (rcor *RenewCertificateOrderRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var renewCertificateOrderRequestProperties RenewCertificateOrderRequestProperties + err = json.Unmarshal(*v, &renewCertificateOrderRequestProperties) + if err != nil { + return err + } + rcor.RenewCertificateOrderRequestProperties = &renewCertificateOrderRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rcor.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rcor.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rcor.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rcor.Type = &typeVar + } + } + } + + return nil +} + +// RenewCertificateOrderRequestProperties renewCertificateOrderRequest resource specific properties +type RenewCertificateOrderRequestProperties struct { + // KeySize - Certificate Key Size. + KeySize *int32 `json:"keySize,omitempty"` + // Csr - Csr to be used for re-key operation. + Csr *string `json:"csr,omitempty"` + // IsPrivateKeyExternal - Should we change the ASC type (from managed private key to external private key and vice versa). + IsPrivateKeyExternal *bool `json:"isPrivateKeyExternal,omitempty"` +} + +// RequestsBasedTrigger trigger based on total requests. +type RequestsBasedTrigger struct { + // Count - Request Count. + Count *int32 `json:"count,omitempty"` + // TimeInterval - Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` +} + +// Resource azure resource. This resource is tracked in Azure Resource Manager +type Resource struct { + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Kind != nil { + objectMap["kind"] = r.Kind + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// ResourceCollection collection of resources. +type ResourceCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]string `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceCollection. +func (rc ResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rc.Value != nil { + objectMap["value"] = rc.Value + } + return json.Marshal(objectMap) +} + +// ResourceCollectionIterator provides access to a complete listing of string values. +type ResourceCollectionIterator struct { + i int + page ResourceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceCollectionIterator) Response() ResourceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceCollectionIterator) Value() string { + if !iter.page.NotDone() { + return "" + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceCollectionIterator type. +func NewResourceCollectionIterator(page ResourceCollectionPage) ResourceCollectionIterator { + return ResourceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rc ResourceCollection) IsEmpty() bool { + return rc.Value == nil || len(*rc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rc ResourceCollection) hasNextLink() bool { + return rc.NextLink != nil && len(*rc.NextLink) != 0 +} + +// resourceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rc ResourceCollection) resourceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rc.NextLink))) +} + +// ResourceCollectionPage contains a page of string values. +type ResourceCollectionPage struct { + fn func(context.Context, ResourceCollection) (ResourceCollection, error) + rc ResourceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rc) + if err != nil { + return err + } + page.rc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceCollectionPage) NotDone() bool { + return !page.rc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceCollectionPage) Response() ResourceCollection { + return page.rc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceCollectionPage) Values() []string { + if page.rc.IsEmpty() { + return nil + } + return *page.rc.Value +} + +// Creates a new instance of the ResourceCollectionPage type. +func NewResourceCollectionPage(cur ResourceCollection, getNextPage func(context.Context, ResourceCollection) (ResourceCollection, error)) ResourceCollectionPage { + return ResourceCollectionPage{ + fn: getNextPage, + rc: cur, + } +} + +// ResourceHealthMetadata used for getting ResourceHealthCheck settings. +type ResourceHealthMetadata struct { + autorest.Response `json:"-"` + // ResourceHealthMetadataProperties - ResourceHealthMetadata resource specific properties + *ResourceHealthMetadataProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthMetadata. +func (rhm ResourceHealthMetadata) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rhm.ResourceHealthMetadataProperties != nil { + objectMap["properties"] = rhm.ResourceHealthMetadataProperties + } + if rhm.Kind != nil { + objectMap["kind"] = rhm.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ResourceHealthMetadata struct. +func (rhm *ResourceHealthMetadata) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var resourceHealthMetadataProperties ResourceHealthMetadataProperties + err = json.Unmarshal(*v, &resourceHealthMetadataProperties) + if err != nil { + return err + } + rhm.ResourceHealthMetadataProperties = &resourceHealthMetadataProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rhm.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rhm.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rhm.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rhm.Type = &typeVar + } + } + } + + return nil +} + +// ResourceHealthMetadataCollection collection of resource health metadata. +type ResourceHealthMetadataCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ResourceHealthMetadata `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceHealthMetadataCollection. +func (rhmc ResourceHealthMetadataCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rhmc.Value != nil { + objectMap["value"] = rhmc.Value + } + return json.Marshal(objectMap) +} + +// ResourceHealthMetadataCollectionIterator provides access to a complete listing of ResourceHealthMetadata +// values. +type ResourceHealthMetadataCollectionIterator struct { + i int + page ResourceHealthMetadataCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceHealthMetadataCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceHealthMetadataCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceHealthMetadataCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceHealthMetadataCollectionIterator) Response() ResourceHealthMetadataCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceHealthMetadataCollectionIterator) Value() ResourceHealthMetadata { + if !iter.page.NotDone() { + return ResourceHealthMetadata{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceHealthMetadataCollectionIterator type. +func NewResourceHealthMetadataCollectionIterator(page ResourceHealthMetadataCollectionPage) ResourceHealthMetadataCollectionIterator { + return ResourceHealthMetadataCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rhmc ResourceHealthMetadataCollection) IsEmpty() bool { + return rhmc.Value == nil || len(*rhmc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rhmc ResourceHealthMetadataCollection) hasNextLink() bool { + return rhmc.NextLink != nil && len(*rhmc.NextLink) != 0 +} + +// resourceHealthMetadataCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rhmc ResourceHealthMetadataCollection) resourceHealthMetadataCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rhmc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rhmc.NextLink))) +} + +// ResourceHealthMetadataCollectionPage contains a page of ResourceHealthMetadata values. +type ResourceHealthMetadataCollectionPage struct { + fn func(context.Context, ResourceHealthMetadataCollection) (ResourceHealthMetadataCollection, error) + rhmc ResourceHealthMetadataCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceHealthMetadataCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rhmc) + if err != nil { + return err + } + page.rhmc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceHealthMetadataCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceHealthMetadataCollectionPage) NotDone() bool { + return !page.rhmc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceHealthMetadataCollectionPage) Response() ResourceHealthMetadataCollection { + return page.rhmc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceHealthMetadataCollectionPage) Values() []ResourceHealthMetadata { + if page.rhmc.IsEmpty() { + return nil + } + return *page.rhmc.Value +} + +// Creates a new instance of the ResourceHealthMetadataCollectionPage type. +func NewResourceHealthMetadataCollectionPage(cur ResourceHealthMetadataCollection, getNextPage func(context.Context, ResourceHealthMetadataCollection) (ResourceHealthMetadataCollection, error)) ResourceHealthMetadataCollectionPage { + return ResourceHealthMetadataCollectionPage{ + fn: getNextPage, + rhmc: cur, + } +} + +// ResourceHealthMetadataProperties resourceHealthMetadata resource specific properties +type ResourceHealthMetadataProperties struct { + // Category - The category that the resource matches in the RHC Policy File + Category *string `json:"category,omitempty"` + // SignalAvailability - Is there a health signal for the resource + SignalAvailability *bool `json:"signalAvailability,omitempty"` +} + +// ResourceMetricAvailability metrics availability and retention. +type ResourceMetricAvailability struct { + // TimeGrain - READ-ONLY; Time grain . + TimeGrain *string `json:"timeGrain,omitempty"` + // Retention - READ-ONLY; Retention period for the current time grain. + Retention *string `json:"retention,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceMetricAvailability. +func (rma ResourceMetricAvailability) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceMetricDefinition metadata for the metrics. +type ResourceMetricDefinition struct { + // ResourceMetricDefinitionProperties - ResourceMetricDefinition resource specific properties + *ResourceMetricDefinitionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceMetricDefinition. +func (rmd ResourceMetricDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmd.ResourceMetricDefinitionProperties != nil { + objectMap["properties"] = rmd.ResourceMetricDefinitionProperties + } + if rmd.Kind != nil { + objectMap["kind"] = rmd.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ResourceMetricDefinition struct. +func (rmd *ResourceMetricDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var resourceMetricDefinitionProperties ResourceMetricDefinitionProperties + err = json.Unmarshal(*v, &resourceMetricDefinitionProperties) + if err != nil { + return err + } + rmd.ResourceMetricDefinitionProperties = &resourceMetricDefinitionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rmd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rmd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rmd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rmd.Type = &typeVar + } + } + } + + return nil +} + +// ResourceMetricDefinitionCollection collection of metric definitions. +type ResourceMetricDefinitionCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ResourceMetricDefinition `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceMetricDefinitionCollection. +func (rmdc ResourceMetricDefinitionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmdc.Value != nil { + objectMap["value"] = rmdc.Value + } + return json.Marshal(objectMap) +} + +// ResourceMetricDefinitionCollectionIterator provides access to a complete listing of +// ResourceMetricDefinition values. +type ResourceMetricDefinitionCollectionIterator struct { + i int + page ResourceMetricDefinitionCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ResourceMetricDefinitionCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceMetricDefinitionCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ResourceMetricDefinitionCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ResourceMetricDefinitionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ResourceMetricDefinitionCollectionIterator) Response() ResourceMetricDefinitionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ResourceMetricDefinitionCollectionIterator) Value() ResourceMetricDefinition { + if !iter.page.NotDone() { + return ResourceMetricDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ResourceMetricDefinitionCollectionIterator type. +func NewResourceMetricDefinitionCollectionIterator(page ResourceMetricDefinitionCollectionPage) ResourceMetricDefinitionCollectionIterator { + return ResourceMetricDefinitionCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rmdc ResourceMetricDefinitionCollection) IsEmpty() bool { + return rmdc.Value == nil || len(*rmdc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rmdc ResourceMetricDefinitionCollection) hasNextLink() bool { + return rmdc.NextLink != nil && len(*rmdc.NextLink) != 0 +} + +// resourceMetricDefinitionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rmdc ResourceMetricDefinitionCollection) resourceMetricDefinitionCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rmdc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rmdc.NextLink))) +} + +// ResourceMetricDefinitionCollectionPage contains a page of ResourceMetricDefinition values. +type ResourceMetricDefinitionCollectionPage struct { + fn func(context.Context, ResourceMetricDefinitionCollection) (ResourceMetricDefinitionCollection, error) + rmdc ResourceMetricDefinitionCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ResourceMetricDefinitionCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceMetricDefinitionCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rmdc) + if err != nil { + return err + } + page.rmdc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ResourceMetricDefinitionCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ResourceMetricDefinitionCollectionPage) NotDone() bool { + return !page.rmdc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ResourceMetricDefinitionCollectionPage) Response() ResourceMetricDefinitionCollection { + return page.rmdc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ResourceMetricDefinitionCollectionPage) Values() []ResourceMetricDefinition { + if page.rmdc.IsEmpty() { + return nil + } + return *page.rmdc.Value +} + +// Creates a new instance of the ResourceMetricDefinitionCollectionPage type. +func NewResourceMetricDefinitionCollectionPage(cur ResourceMetricDefinitionCollection, getNextPage func(context.Context, ResourceMetricDefinitionCollection) (ResourceMetricDefinitionCollection, error)) ResourceMetricDefinitionCollectionPage { + return ResourceMetricDefinitionCollectionPage{ + fn: getNextPage, + rmdc: cur, + } +} + +// ResourceMetricDefinitionProperties resourceMetricDefinition resource specific properties +type ResourceMetricDefinitionProperties struct { + // Unit - READ-ONLY; Unit of the metric. + Unit *string `json:"unit,omitempty"` + // PrimaryAggregationType - READ-ONLY; Primary aggregation type. + PrimaryAggregationType *string `json:"primaryAggregationType,omitempty"` + // MetricAvailabilities - READ-ONLY; List of time grains supported for the metric together with retention period. + MetricAvailabilities *[]ResourceMetricAvailability `json:"metricAvailabilities,omitempty"` + // ResourceURI - READ-ONLY; Resource URI. + ResourceURI *string `json:"resourceUri,omitempty"` + // Properties - READ-ONLY; Resource metric definition properties. + Properties map[string]*string `json:"properties"` +} + +// MarshalJSON is the custom marshaler for ResourceMetricDefinitionProperties. +func (rmd ResourceMetricDefinitionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceNameAvailability information regarding availability of a resource name. +type ResourceNameAvailability struct { + autorest.Response `json:"-"` + // NameAvailable - true indicates name is valid and available. false indicates the name is invalid, unavailable, or both. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - Invalid indicates the name provided does not match Azure App Service naming requirements. AlreadyExists indicates that the name is already in use and is therefore unavailable. Possible values include: 'InAvailabilityReasonTypeInvalid', 'InAvailabilityReasonTypeAlreadyExists' + Reason InAvailabilityReasonType `json:"reason,omitempty"` + // Message - If reason == invalid, provide the user with the reason why the given name is invalid, and provide the resource naming requirements so that the user can select a valid name. If reason == AlreadyExists, explain that resource name is already in use, and direct them to select a different name. + Message *string `json:"message,omitempty"` +} + +// ResourceNameAvailabilityRequest resource name availability request content. +type ResourceNameAvailabilityRequest struct { + // Name - Resource name to verify. + Name *string `json:"name,omitempty"` + // Type - Resource type used for verification. Possible values include: 'CheckNameResourceTypesSite', 'CheckNameResourceTypesSlot', 'CheckNameResourceTypesHostingEnvironment', 'CheckNameResourceTypesPublishingUser', 'CheckNameResourceTypesMicrosoftWebsites', 'CheckNameResourceTypesMicrosoftWebsitesslots', 'CheckNameResourceTypesMicrosoftWebhostingEnvironments', 'CheckNameResourceTypesMicrosoftWebpublishingUsers' + Type CheckNameResourceTypes `json:"type,omitempty"` + // IsFqdn - Is fully qualified domain name. + IsFqdn *bool `json:"isFqdn,omitempty"` +} + +// ResponseMessageEnvelopeRemotePrivateEndpointConnection message envelope that contains the common Azure +// resource manager properties and the resource provider specific content. +type ResponseMessageEnvelopeRemotePrivateEndpointConnection struct { + // ID - Resource Id. Typically ID is populated only for responses to GET requests. Caller is responsible for passing in this + // value for GET requests only. + // For example: /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupId}/providers/Microsoft.Web/sites/{sitename} + ID *string `json:"id,omitempty"` + // Name - Name of resource. + Name *string `json:"name,omitempty"` + // Type - Type of resource e.g "Microsoft.Web/sites". + Type *string `json:"type,omitempty"` + // Location - Geographical region resource belongs to e.g. SouthCentralUS, SouthEastAsia. + Location *string `json:"location,omitempty"` + // Tags - Tags associated with resource. + Tags map[string]*string `json:"tags"` + // Plan - Azure resource manager plan. + Plan *ArmPlan `json:"plan,omitempty"` + // Properties - Resource specific properties. + Properties *RemotePrivateEndpointConnection `json:"properties,omitempty"` + // Sku - SKU description of the resource. + Sku *SkuDescription `json:"sku,omitempty"` + // Status - Azure-AsyncOperation Status info. + Status *string `json:"status,omitempty"` + // Error - Azure-AsyncOperation Error info. + Error *ErrorEntity `json:"error,omitempty"` + // Identity - MSI resource + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // Zones - Logical Availability Zones the service is hosted in + Zones *[]string `json:"zones,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResponseMessageEnvelopeRemotePrivateEndpointConnection. +func (rmeRpec ResponseMessageEnvelopeRemotePrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmeRpec.ID != nil { + objectMap["id"] = rmeRpec.ID + } + if rmeRpec.Name != nil { + objectMap["name"] = rmeRpec.Name + } + if rmeRpec.Type != nil { + objectMap["type"] = rmeRpec.Type + } + if rmeRpec.Location != nil { + objectMap["location"] = rmeRpec.Location + } + if rmeRpec.Tags != nil { + objectMap["tags"] = rmeRpec.Tags + } + if rmeRpec.Plan != nil { + objectMap["plan"] = rmeRpec.Plan + } + if rmeRpec.Properties != nil { + objectMap["properties"] = rmeRpec.Properties + } + if rmeRpec.Sku != nil { + objectMap["sku"] = rmeRpec.Sku + } + if rmeRpec.Status != nil { + objectMap["status"] = rmeRpec.Status + } + if rmeRpec.Error != nil { + objectMap["error"] = rmeRpec.Error + } + if rmeRpec.Identity != nil { + objectMap["identity"] = rmeRpec.Identity + } + if rmeRpec.Zones != nil { + objectMap["zones"] = rmeRpec.Zones + } + return json.Marshal(objectMap) +} + +// ResponseMetaData ... +type ResponseMetaData struct { + // DataSource - Source of the Data + DataSource *DataSource `json:"dataSource,omitempty"` +} + +// RestoreRequest description of a restore request. +type RestoreRequest struct { + autorest.Response `json:"-"` + // RestoreRequestProperties - RestoreRequest resource specific properties + *RestoreRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for RestoreRequest. +func (rr RestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rr.RestoreRequestProperties != nil { + objectMap["properties"] = rr.RestoreRequestProperties + } + if rr.Kind != nil { + objectMap["kind"] = rr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RestoreRequest struct. +func (rr *RestoreRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var restoreRequestProperties RestoreRequestProperties + err = json.Unmarshal(*v, &restoreRequestProperties) + if err != nil { + return err + } + rr.RestoreRequestProperties = &restoreRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rr.Type = &typeVar + } + } + } + + return nil +} + +// RestoreRequestProperties restoreRequest resource specific properties +type RestoreRequestProperties struct { + // StorageAccountURL - SAS URL to the container. + StorageAccountURL *string `json:"storageAccountUrl,omitempty"` + // BlobName - Name of a blob which contains the backup. + BlobName *string `json:"blobName,omitempty"` + // Overwrite - true if the restore operation can overwrite target app; otherwise, false. true is needed if trying to restore over an existing app. + Overwrite *bool `json:"overwrite,omitempty"` + // SiteName - Name of an app. + SiteName *string `json:"siteName,omitempty"` + // Databases - Collection of databases which should be restored. This list has to match the list of databases included in the backup. + Databases *[]DatabaseBackupSetting `json:"databases,omitempty"` + // IgnoreConflictingHostNames - Changes a logic when restoring an app with custom domains. true to remove custom domains automatically. If false, custom domains are added to + // the app's object when it is being restored, but that might fail due to conflicts during the operation. + IgnoreConflictingHostNames *bool `json:"ignoreConflictingHostNames,omitempty"` + // IgnoreDatabases - Ignore the databases and only restore the site content + IgnoreDatabases *bool `json:"ignoreDatabases,omitempty"` + // AppServicePlan - Specify app service plan that will own restored site. + AppServicePlan *string `json:"appServicePlan,omitempty"` + // OperationType - Operation type. Possible values include: 'BackupRestoreOperationTypeDefault', 'BackupRestoreOperationTypeClone', 'BackupRestoreOperationTypeRelocation', 'BackupRestoreOperationTypeSnapshot', 'BackupRestoreOperationTypeCloudFS' + OperationType BackupRestoreOperationType `json:"operationType,omitempty"` + // AdjustConnectionStrings - true if SiteConfig.ConnectionStrings should be set in new app; otherwise, false. + AdjustConnectionStrings *bool `json:"adjustConnectionStrings,omitempty"` + // HostingEnvironment - App Service Environment name, if needed (only when restoring an app to an App Service Environment). + HostingEnvironment *string `json:"hostingEnvironment,omitempty"` +} + +// Revision container App Revision. +type Revision struct { + autorest.Response `json:"-"` + // RevisionProperties - Revision resource specific properties + *RevisionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Revision. +func (r Revision) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RevisionProperties != nil { + objectMap["properties"] = r.RevisionProperties + } + if r.Kind != nil { + objectMap["kind"] = r.Kind + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Revision struct. +func (r *Revision) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var revisionProperties RevisionProperties + err = json.Unmarshal(*v, &revisionProperties) + if err != nil { + return err + } + r.RevisionProperties = &revisionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + r.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + } + } + + return nil +} + +// RevisionCollection container App Revisions collection ARM resource. +type RevisionCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Revision `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for RevisionCollection. +func (rc RevisionCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rc.Value != nil { + objectMap["value"] = rc.Value + } + return json.Marshal(objectMap) +} + +// RevisionCollectionIterator provides access to a complete listing of Revision values. +type RevisionCollectionIterator struct { + i int + page RevisionCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RevisionCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RevisionCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RevisionCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RevisionCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RevisionCollectionIterator) Response() RevisionCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RevisionCollectionIterator) Value() Revision { + if !iter.page.NotDone() { + return Revision{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RevisionCollectionIterator type. +func NewRevisionCollectionIterator(page RevisionCollectionPage) RevisionCollectionIterator { + return RevisionCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rc RevisionCollection) IsEmpty() bool { + return rc.Value == nil || len(*rc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rc RevisionCollection) hasNextLink() bool { + return rc.NextLink != nil && len(*rc.NextLink) != 0 +} + +// revisionCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rc RevisionCollection) revisionCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !rc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rc.NextLink))) +} + +// RevisionCollectionPage contains a page of Revision values. +type RevisionCollectionPage struct { + fn func(context.Context, RevisionCollection) (RevisionCollection, error) + rc RevisionCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RevisionCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RevisionCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rc) + if err != nil { + return err + } + page.rc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RevisionCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RevisionCollectionPage) NotDone() bool { + return !page.rc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RevisionCollectionPage) Response() RevisionCollection { + return page.rc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RevisionCollectionPage) Values() []Revision { + if page.rc.IsEmpty() { + return nil + } + return *page.rc.Value +} + +// Creates a new instance of the RevisionCollectionPage type. +func NewRevisionCollectionPage(cur RevisionCollection, getNextPage func(context.Context, RevisionCollection) (RevisionCollection, error)) RevisionCollectionPage { + return RevisionCollectionPage{ + fn: getNextPage, + rc: cur, + } +} + +// RevisionProperties revision resource specific properties +type RevisionProperties struct { + // CreatedTime - READ-ONLY; Timestamp describing when the revision was created + // by controller + CreatedTime *date.Time `json:"createdTime,omitempty"` + // Fqdn - READ-ONLY; Fully qualified domain name of the revision + Fqdn *string `json:"fqdn,omitempty"` + // Template - READ-ONLY; Container App Revision Template with all possible settings and the + // defaults if user did not provide them. The defaults are populated + // as they were at the creation time + Template *Template `json:"template,omitempty"` + // Active - READ-ONLY; Boolean describing if the Revision is Active + Active *bool `json:"active,omitempty"` + // Replicas - READ-ONLY; Number of pods currently running for this revision + Replicas *int32 `json:"replicas,omitempty"` + // TrafficWeight - READ-ONLY; Traffic weight assigned to this revision + TrafficWeight *int32 `json:"trafficWeight,omitempty"` + // ProvisioningError - READ-ONLY; Optional Field - Platform Error Message + ProvisioningError *string `json:"provisioningError,omitempty"` + // HealthState - READ-ONLY; Current health State of the revision. Possible values include: 'RevisionHealthStateHealthy', 'RevisionHealthStateUnhealthy', 'RevisionHealthStateNone' + HealthState RevisionHealthState `json:"healthState,omitempty"` + // ProvisioningState - READ-ONLY; Current provisioning State of the revision. Possible values include: 'RevisionProvisioningStateProvisioning', 'RevisionProvisioningStateProvisioned', 'RevisionProvisioningStateFailed', 'RevisionProvisioningStateDeprovisioning', 'RevisionProvisioningStateDeprovisioned' + ProvisioningState RevisionProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for RevisionProperties. +func (r RevisionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SampleUtterance sample utterance. +type SampleUtterance struct { + // Text - Text attribute of sample utterance. + Text *string `json:"text,omitempty"` + // Links - Links attribute of sample utterance. + Links *[]string `json:"links,omitempty"` + // Qid - Question id of sample utterance (for stackoverflow questions titles). + Qid *string `json:"qid,omitempty"` +} + +// Scale container App scaling configurations. +type Scale struct { + // MinReplicas - Optional. Minimum number of container replicas. + MinReplicas *int32 `json:"minReplicas,omitempty"` + // MaxReplicas - Optional. Maximum number of container replicas. Defaults to 10 if not set. + MaxReplicas *int32 `json:"maxReplicas,omitempty"` + // Rules - Scaling rules. + Rules *[]ScaleRule `json:"rules,omitempty"` +} + +// ScaleRule container App container scaling rule. +type ScaleRule struct { + // Name - Scale Rule Name + Name *string `json:"name,omitempty"` + // AzureQueue - Azure Queue based scaling. + AzureQueue *QueueScaleRule `json:"azureQueue,omitempty"` + // Custom - Custom scale rule. + Custom *CustomScaleRule `json:"custom,omitempty"` + // HTTP - HTTP requests based scaling. + HTTP *HTTPScaleRule `json:"http,omitempty"` +} + +// ScaleRuleAuth auth Secrets for Container App Scale Rule +type ScaleRuleAuth struct { + // SecretRef - Name of the Container App secret from which to pull the auth params. + SecretRef *string `json:"secretRef,omitempty"` + // TriggerParameter - Trigger Parameter that uses the secret + TriggerParameter *string `json:"triggerParameter,omitempty"` +} + +// Secret container App Secret. +type Secret struct { + // Name - Secret Name. + Name *string `json:"name,omitempty"` + // Value - Secret Value. + Value *string `json:"value,omitempty"` +} + +// SecretsCollection container App Secrets Collection ARM resource. +type SecretsCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]ContainerAppSecret `json:"value,omitempty"` +} + +// ServiceSpecification resource metrics service provided by Microsoft.Insights resource provider. +type ServiceSpecification struct { + MetricSpecifications *[]MetricSpecification `json:"metricSpecifications,omitempty"` + LogSpecifications *[]LogSpecification `json:"logSpecifications,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// Site a web app, a mobile app backend, or an API app. +type Site struct { + autorest.Response `json:"-"` + // SiteProperties - Site resource specific properties + *SiteProperties `json:"properties,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + ExtendedLocation *ExtendedLocation `json:"extendedLocation,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Site. +func (s Site) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SiteProperties != nil { + objectMap["properties"] = s.SiteProperties + } + if s.Identity != nil { + objectMap["identity"] = s.Identity + } + if s.ExtendedLocation != nil { + objectMap["extendedLocation"] = s.ExtendedLocation + } + if s.Kind != nil { + objectMap["kind"] = s.Kind + } + if s.Location != nil { + objectMap["location"] = s.Location + } + if s.Tags != nil { + objectMap["tags"] = s.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Site struct. +func (s *Site) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteProperties SiteProperties + err = json.Unmarshal(*v, &siteProperties) + if err != nil { + return err + } + s.SiteProperties = &siteProperties + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + s.Identity = &identity + } + case "extendedLocation": + if v != nil { + var extendedLocation ExtendedLocation + err = json.Unmarshal(*v, &extendedLocation) + if err != nil { + return err + } + s.ExtendedLocation = &extendedLocation + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + s.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + s.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + s.Tags = tags + } + } + } + + return nil +} + +// SiteAuthSettings configuration settings for the Azure App Service Authentication / Authorization +// feature. +type SiteAuthSettings struct { + autorest.Response `json:"-"` + // SiteAuthSettingsProperties - SiteAuthSettings resource specific properties + *SiteAuthSettingsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteAuthSettings. +func (sas SiteAuthSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sas.SiteAuthSettingsProperties != nil { + objectMap["properties"] = sas.SiteAuthSettingsProperties + } + if sas.Kind != nil { + objectMap["kind"] = sas.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteAuthSettings struct. +func (sas *SiteAuthSettings) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteAuthSettingsProperties SiteAuthSettingsProperties + err = json.Unmarshal(*v, &siteAuthSettingsProperties) + if err != nil { + return err + } + sas.SiteAuthSettingsProperties = &siteAuthSettingsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sas.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sas.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sas.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sas.Type = &typeVar + } + } + } + + return nil +} + +// SiteAuthSettingsProperties siteAuthSettings resource specific properties +type SiteAuthSettingsProperties struct { + // Enabled - true if the Authentication / Authorization feature is enabled for the current app; otherwise, false. + Enabled *bool `json:"enabled,omitempty"` + // RuntimeVersion - The RuntimeVersion of the Authentication / Authorization feature in use for the current app. + // The setting in this value can control the behavior of certain features in the Authentication / Authorization module. + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // UnauthenticatedClientAction - The action to take when an unauthenticated client attempts to access the app. Possible values include: 'UnauthenticatedClientActionRedirectToLoginPage', 'UnauthenticatedClientActionAllowAnonymous' + UnauthenticatedClientAction UnauthenticatedClientAction `json:"unauthenticatedClientAction,omitempty"` + // TokenStoreEnabled - true to durably store platform-specific security tokens that are obtained during login flows; otherwise, false. + // The default is false. + TokenStoreEnabled *bool `json:"tokenStoreEnabled,omitempty"` + // AllowedExternalRedirectUrls - External URLs that can be redirected to as part of logging in or logging out of the app. Note that the query string part of the URL is ignored. + // This is an advanced setting typically only needed by Windows Store application backends. + // Note that URLs within the current domain are always implicitly allowed. + AllowedExternalRedirectUrls *[]string `json:"allowedExternalRedirectUrls,omitempty"` + // DefaultProvider - The default authentication provider to use when multiple providers are configured. + // This setting is only needed if multiple providers are configured and the unauthenticated client + // action is set to "RedirectToLoginPage". Possible values include: 'BuiltInAuthenticationProviderAzureActiveDirectory', 'BuiltInAuthenticationProviderFacebook', 'BuiltInAuthenticationProviderGoogle', 'BuiltInAuthenticationProviderMicrosoftAccount', 'BuiltInAuthenticationProviderTwitter', 'BuiltInAuthenticationProviderGithub' + DefaultProvider BuiltInAuthenticationProvider `json:"defaultProvider,omitempty"` + // TokenRefreshExtensionHours - The number of hours after session token expiration that a session token can be used to + // call the token refresh API. The default is 72 hours. + TokenRefreshExtensionHours *float64 `json:"tokenRefreshExtensionHours,omitempty"` + // ClientID - The Client ID of this relying party application, known as the client_id. + // This setting is required for enabling OpenID Connection authentication with Azure Active Directory or + // other 3rd party OpenID Connect providers. + // More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html + ClientID *string `json:"clientId,omitempty"` + // ClientSecret - The Client Secret of this relying party application (in Azure Active Directory, this is also referred to as the Key). + // This setting is optional. If no client secret is configured, the OpenID Connect implicit auth flow is used to authenticate end users. + // Otherwise, the OpenID Connect Authorization Code Flow is used to authenticate end users. + // More information on OpenID Connect: http://openid.net/specs/openid-connect-core-1_0.html + ClientSecret *string `json:"clientSecret,omitempty"` + // ClientSecretSettingName - The app setting name that contains the client secret of the relying party application. + ClientSecretSettingName *string `json:"clientSecretSettingName,omitempty"` + // ClientSecretCertificateThumbprint - An alternative to the client secret, that is the thumbprint of a certificate used for signing purposes. This property acts as + // a replacement for the Client Secret. It is also optional. + ClientSecretCertificateThumbprint *string `json:"clientSecretCertificateThumbprint,omitempty"` + // Issuer - The OpenID Connect Issuer URI that represents the entity which issues access tokens for this application. + // When using Azure Active Directory, this value is the URI of the directory tenant, e.g. https://sts.windows.net/{tenant-guid}/. + // This URI is a case-sensitive identifier for the token issuer. + // More information on OpenID Connect Discovery: http://openid.net/specs/openid-connect-discovery-1_0.html + Issuer *string `json:"issuer,omitempty"` + // ValidateIssuer - Gets a value indicating whether the issuer should be a valid HTTPS url and be validated as such. + ValidateIssuer *bool `json:"validateIssuer,omitempty"` + // AllowedAudiences - Allowed audience values to consider when validating JWTs issued by + // Azure Active Directory. Note that the ClientID value is always considered an + // allowed audience, regardless of this setting. + AllowedAudiences *[]string `json:"allowedAudiences,omitempty"` + // AdditionalLoginParams - Login parameters to send to the OpenID Connect authorization endpoint when + // a user logs in. Each parameter must be in the form "key=value". + AdditionalLoginParams *[]string `json:"additionalLoginParams,omitempty"` + // AadClaimsAuthorization - Gets a JSON string containing the Azure AD Acl settings. + AadClaimsAuthorization *string `json:"aadClaimsAuthorization,omitempty"` + // GoogleClientID - The OpenID Connect Client ID for the Google web application. + // This setting is required for enabling Google Sign-In. + // Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + GoogleClientID *string `json:"googleClientId,omitempty"` + // GoogleClientSecret - The client secret associated with the Google web application. + // This setting is required for enabling Google Sign-In. + // Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + GoogleClientSecret *string `json:"googleClientSecret,omitempty"` + // GoogleClientSecretSettingName - The app setting name that contains the client secret associated with + // the Google web application. + GoogleClientSecretSettingName *string `json:"googleClientSecretSettingName,omitempty"` + // GoogleOAuthScopes - The OAuth 2.0 scopes that will be requested as part of Google Sign-In authentication. + // This setting is optional. If not specified, "openid", "profile", and "email" are used as default scopes. + // Google Sign-In documentation: https://developers.google.com/identity/sign-in/web/ + GoogleOAuthScopes *[]string `json:"googleOAuthScopes,omitempty"` + // FacebookAppID - The App ID of the Facebook app used for login. + // This setting is required for enabling Facebook Login. + // Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + FacebookAppID *string `json:"facebookAppId,omitempty"` + // FacebookAppSecret - The App Secret of the Facebook app used for Facebook Login. + // This setting is required for enabling Facebook Login. + // Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + FacebookAppSecret *string `json:"facebookAppSecret,omitempty"` + // FacebookAppSecretSettingName - The app setting name that contains the app secret used for Facebook Login. + FacebookAppSecretSettingName *string `json:"facebookAppSecretSettingName,omitempty"` + // FacebookOAuthScopes - The OAuth 2.0 scopes that will be requested as part of Facebook Login authentication. + // This setting is optional. + // Facebook Login documentation: https://developers.facebook.com/docs/facebook-login + FacebookOAuthScopes *[]string `json:"facebookOAuthScopes,omitempty"` + // GitHubClientID - The Client Id of the GitHub app used for login. + // This setting is required for enabling Github login + GitHubClientID *string `json:"gitHubClientId,omitempty"` + // GitHubClientSecret - The Client Secret of the GitHub app used for Github Login. + // This setting is required for enabling Github login. + GitHubClientSecret *string `json:"gitHubClientSecret,omitempty"` + // GitHubClientSecretSettingName - The app setting name that contains the client secret of the Github + // app used for GitHub Login. + GitHubClientSecretSettingName *string `json:"gitHubClientSecretSettingName,omitempty"` + // GitHubOAuthScopes - The OAuth 2.0 scopes that will be requested as part of GitHub Login authentication. + // This setting is optional + GitHubOAuthScopes *[]string `json:"gitHubOAuthScopes,omitempty"` + // TwitterConsumerKey - The OAuth 1.0a consumer key of the Twitter application used for sign-in. + // This setting is required for enabling Twitter Sign-In. + // Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + TwitterConsumerKey *string `json:"twitterConsumerKey,omitempty"` + // TwitterConsumerSecret - The OAuth 1.0a consumer secret of the Twitter application used for sign-in. + // This setting is required for enabling Twitter Sign-In. + // Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + TwitterConsumerSecret *string `json:"twitterConsumerSecret,omitempty"` + // TwitterConsumerSecretSettingName - The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + // application used for sign-in. + TwitterConsumerSecretSettingName *string `json:"twitterConsumerSecretSettingName,omitempty"` + // MicrosoftAccountClientID - The OAuth 2.0 client ID that was created for the app used for authentication. + // This setting is required for enabling Microsoft Account authentication. + // Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm + MicrosoftAccountClientID *string `json:"microsoftAccountClientId,omitempty"` + // MicrosoftAccountClientSecret - The OAuth 2.0 client secret that was created for the app used for authentication. + // This setting is required for enabling Microsoft Account authentication. + // Microsoft Account OAuth documentation: https://dev.onedrive.com/auth/msa_oauth.htm + MicrosoftAccountClientSecret *string `json:"microsoftAccountClientSecret,omitempty"` + // MicrosoftAccountClientSecretSettingName - The app setting name containing the OAuth 2.0 client secret that was created for the + // app used for authentication. + MicrosoftAccountClientSecretSettingName *string `json:"microsoftAccountClientSecretSettingName,omitempty"` + // MicrosoftAccountOAuthScopes - The OAuth 2.0 scopes that will be requested as part of Microsoft Account authentication. + // This setting is optional. If not specified, "wl.basic" is used as the default scope. + // Microsoft Account Scopes and permissions documentation: https://msdn.microsoft.com/en-us/library/dn631845.aspx + MicrosoftAccountOAuthScopes *[]string `json:"microsoftAccountOAuthScopes,omitempty"` + // IsAuthFromFile - "true" if the auth config settings should be read from a file, + // "false" otherwise + IsAuthFromFile *string `json:"isAuthFromFile,omitempty"` + // AuthFilePath - The path of the config file containing auth settings. + // If the path is relative, base will the site's root directory. + AuthFilePath *string `json:"authFilePath,omitempty"` + // ConfigVersion - The ConfigVersion of the Authentication / Authorization feature in use for the current app. + // The setting in this value can control the behavior of the control plane for Authentication / Authorization. + ConfigVersion *string `json:"configVersion,omitempty"` +} + +// SiteAuthSettingsV2 configuration settings for the Azure App Service Authentication / Authorization V2 +// feature. +type SiteAuthSettingsV2 struct { + autorest.Response `json:"-"` + // SiteAuthSettingsV2Properties - SiteAuthSettingsV2 resource specific properties + *SiteAuthSettingsV2Properties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteAuthSettingsV2. +func (sasv SiteAuthSettingsV2) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sasv.SiteAuthSettingsV2Properties != nil { + objectMap["properties"] = sasv.SiteAuthSettingsV2Properties + } + if sasv.Kind != nil { + objectMap["kind"] = sasv.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteAuthSettingsV2 struct. +func (sasv *SiteAuthSettingsV2) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteAuthSettingsV2Properties SiteAuthSettingsV2Properties + err = json.Unmarshal(*v, &siteAuthSettingsV2Properties) + if err != nil { + return err + } + sasv.SiteAuthSettingsV2Properties = &siteAuthSettingsV2Properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sasv.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sasv.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sasv.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sasv.Type = &typeVar + } + } + } + + return nil +} + +// SiteAuthSettingsV2Properties siteAuthSettingsV2 resource specific properties +type SiteAuthSettingsV2Properties struct { + // Platform - The configuration settings of the platform of App Service Authentication/Authorization. + Platform *AuthPlatform `json:"platform,omitempty"` + // GlobalValidation - The configuration settings that determines the validation flow of users using App Service Authentication/Authorization. + GlobalValidation *GlobalValidation `json:"globalValidation,omitempty"` + // IdentityProviders - The configuration settings of each of the identity providers used to configure App Service Authentication/Authorization. + IdentityProviders *IdentityProviders `json:"identityProviders,omitempty"` + // Login - The configuration settings of the login flow of users using App Service Authentication/Authorization. + Login *Login `json:"login,omitempty"` + // HTTPSettings - The configuration settings of the HTTP requests for authentication and authorization requests made against App Service Authentication/Authorization. + HTTPSettings *HTTPSettings `json:"httpSettings,omitempty"` +} + +// SiteCloneability represents whether or not an app is cloneable. +type SiteCloneability struct { + autorest.Response `json:"-"` + // Result - Name of app. Possible values include: 'CloneAbilityResultCloneable', 'CloneAbilityResultPartiallyCloneable', 'CloneAbilityResultNotCloneable' + Result CloneAbilityResult `json:"result,omitempty"` + // BlockingFeatures - List of features enabled on app that prevent cloning. + BlockingFeatures *[]SiteCloneabilityCriterion `json:"blockingFeatures,omitempty"` + // UnsupportedFeatures - List of features enabled on app that are non-blocking but cannot be cloned. The app can still be cloned + // but the features in this list will not be set up on cloned app. + UnsupportedFeatures *[]SiteCloneabilityCriterion `json:"unsupportedFeatures,omitempty"` + // BlockingCharacteristics - List of blocking application characteristics. + BlockingCharacteristics *[]SiteCloneabilityCriterion `json:"blockingCharacteristics,omitempty"` +} + +// SiteCloneabilityCriterion an app cloneability criterion. +type SiteCloneabilityCriterion struct { + // Name - Name of criterion. + Name *string `json:"name,omitempty"` + // Description - Description of criterion. + Description *string `json:"description,omitempty"` +} + +// SiteConfig configuration of an App Service app. +type SiteConfig struct { + // NumberOfWorkers - Number of workers. + NumberOfWorkers *int32 `json:"numberOfWorkers,omitempty"` + // DefaultDocuments - Default documents. + DefaultDocuments *[]string `json:"defaultDocuments,omitempty"` + // NetFrameworkVersion - .NET Framework version. + NetFrameworkVersion *string `json:"netFrameworkVersion,omitempty"` + // PhpVersion - Version of PHP. + PhpVersion *string `json:"phpVersion,omitempty"` + // PythonVersion - Version of Python. + PythonVersion *string `json:"pythonVersion,omitempty"` + // NodeVersion - Version of Node.js. + NodeVersion *string `json:"nodeVersion,omitempty"` + // PowerShellVersion - Version of PowerShell. + PowerShellVersion *string `json:"powerShellVersion,omitempty"` + // LinuxFxVersion - Linux App Framework and version + LinuxFxVersion *string `json:"linuxFxVersion,omitempty"` + // WindowsFxVersion - Xenon App Framework and version + WindowsFxVersion *string `json:"windowsFxVersion,omitempty"` + // RequestTracingEnabled - true if request tracing is enabled; otherwise, false. + RequestTracingEnabled *bool `json:"requestTracingEnabled,omitempty"` + // RequestTracingExpirationTime - Request tracing expiration time. + RequestTracingExpirationTime *date.Time `json:"requestTracingExpirationTime,omitempty"` + // RemoteDebuggingEnabled - true if remote debugging is enabled; otherwise, false. + RemoteDebuggingEnabled *bool `json:"remoteDebuggingEnabled,omitempty"` + // RemoteDebuggingVersion - Remote debugging version. + RemoteDebuggingVersion *string `json:"remoteDebuggingVersion,omitempty"` + // HTTPLoggingEnabled - true if HTTP logging is enabled; otherwise, false. + HTTPLoggingEnabled *bool `json:"httpLoggingEnabled,omitempty"` + // AcrUseManagedIdentityCreds - Flag to use Managed Identity Creds for ACR pull + AcrUseManagedIdentityCreds *bool `json:"acrUseManagedIdentityCreds,omitempty"` + // AcrUserManagedIdentityID - If using user managed identity, the user managed identity ClientId + AcrUserManagedIdentityID *string `json:"acrUserManagedIdentityID,omitempty"` + // LogsDirectorySizeLimit - HTTP logs directory size limit. + LogsDirectorySizeLimit *int32 `json:"logsDirectorySizeLimit,omitempty"` + // DetailedErrorLoggingEnabled - true if detailed error logging is enabled; otherwise, false. + DetailedErrorLoggingEnabled *bool `json:"detailedErrorLoggingEnabled,omitempty"` + // PublishingUsername - Publishing user name. + PublishingUsername *string `json:"publishingUsername,omitempty"` + // AppSettings - Application settings. + AppSettings *[]NameValuePair `json:"appSettings,omitempty"` + // ConnectionStrings - Connection strings. + ConnectionStrings *[]ConnStringInfo `json:"connectionStrings,omitempty"` + // MachineKey - READ-ONLY; Site MachineKey. + MachineKey *SiteMachineKey `json:"machineKey,omitempty"` + // HandlerMappings - Handler mappings. + HandlerMappings *[]HandlerMapping `json:"handlerMappings,omitempty"` + // DocumentRoot - Document root. + DocumentRoot *string `json:"documentRoot,omitempty"` + // ScmType - SCM type. Possible values include: 'ScmTypeNone', 'ScmTypeDropbox', 'ScmTypeTfs', 'ScmTypeLocalGit', 'ScmTypeGitHub', 'ScmTypeCodePlexGit', 'ScmTypeCodePlexHg', 'ScmTypeBitbucketGit', 'ScmTypeBitbucketHg', 'ScmTypeExternalGit', 'ScmTypeExternalHg', 'ScmTypeOneDrive', 'ScmTypeVSO', 'ScmTypeVSTSRM' + ScmType ScmType `json:"scmType,omitempty"` + // Use32BitWorkerProcess - true to use 32-bit worker process; otherwise, false. + Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty"` + // WebSocketsEnabled - true if WebSocket is enabled; otherwise, false. + WebSocketsEnabled *bool `json:"webSocketsEnabled,omitempty"` + // AlwaysOn - true if Always On is enabled; otherwise, false. + AlwaysOn *bool `json:"alwaysOn,omitempty"` + // JavaVersion - Java version. + JavaVersion *string `json:"javaVersion,omitempty"` + // JavaContainer - Java container. + JavaContainer *string `json:"javaContainer,omitempty"` + // JavaContainerVersion - Java container version. + JavaContainerVersion *string `json:"javaContainerVersion,omitempty"` + // AppCommandLine - App command line to launch. + AppCommandLine *string `json:"appCommandLine,omitempty"` + // ManagedPipelineMode - Managed pipeline mode. Possible values include: 'ManagedPipelineModeIntegrated', 'ManagedPipelineModeClassic' + ManagedPipelineMode ManagedPipelineMode `json:"managedPipelineMode,omitempty"` + // VirtualApplications - Virtual applications. + VirtualApplications *[]VirtualApplication `json:"virtualApplications,omitempty"` + // LoadBalancing - Site load balancing. Possible values include: 'SiteLoadBalancingWeightedRoundRobin', 'SiteLoadBalancingLeastRequests', 'SiteLoadBalancingLeastResponseTime', 'SiteLoadBalancingWeightedTotalTraffic', 'SiteLoadBalancingRequestHash', 'SiteLoadBalancingPerSiteRoundRobin' + LoadBalancing SiteLoadBalancing `json:"loadBalancing,omitempty"` + // Experiments - This is work around for polymorphic types. + Experiments *Experiments `json:"experiments,omitempty"` + // Limits - Site limits. + Limits *SiteLimits `json:"limits,omitempty"` + // AutoHealEnabled - true if Auto Heal is enabled; otherwise, false. + AutoHealEnabled *bool `json:"autoHealEnabled,omitempty"` + // AutoHealRules - Auto Heal rules. + AutoHealRules *AutoHealRules `json:"autoHealRules,omitempty"` + // TracingOptions - Tracing options. + TracingOptions *string `json:"tracingOptions,omitempty"` + // VnetName - Virtual Network name. + VnetName *string `json:"vnetName,omitempty"` + // VnetRouteAllEnabled - Virtual Network Route All enabled. This causes all outbound traffic to have Virtual Network Security Groups and User Defined Routes applied. + VnetRouteAllEnabled *bool `json:"vnetRouteAllEnabled,omitempty"` + // VnetPrivatePortsCount - The number of private ports assigned to this app. These will be assigned dynamically on runtime. + VnetPrivatePortsCount *int32 `json:"vnetPrivatePortsCount,omitempty"` + // Cors - Cross-Origin Resource Sharing (CORS) settings. + Cors *CorsSettings `json:"cors,omitempty"` + // Push - Push endpoint settings. + Push *PushSettings `json:"push,omitempty"` + // APIDefinition - Information about the formal API definition for the app. + APIDefinition *APIDefinitionInfo `json:"apiDefinition,omitempty"` + // APIManagementConfig - Azure API management settings linked to the app. + APIManagementConfig *APIManagementConfig `json:"apiManagementConfig,omitempty"` + // AutoSwapSlotName - Auto-swap slot name. + AutoSwapSlotName *string `json:"autoSwapSlotName,omitempty"` + // LocalMySQLEnabled - true to enable local MySQL; otherwise, false. + LocalMySQLEnabled *bool `json:"localMySqlEnabled,omitempty"` + // ManagedServiceIdentityID - Managed Service Identity Id + ManagedServiceIdentityID *int32 `json:"managedServiceIdentityId,omitempty"` + // XManagedServiceIdentityID - Explicit Managed Service Identity Id + XManagedServiceIdentityID *int32 `json:"xManagedServiceIdentityId,omitempty"` + // KeyVaultReferenceIdentity - Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + // IPSecurityRestrictions - IP security restrictions for main. + IPSecurityRestrictions *[]IPSecurityRestriction `json:"ipSecurityRestrictions,omitempty"` + // ScmIPSecurityRestrictions - IP security restrictions for scm. + ScmIPSecurityRestrictions *[]IPSecurityRestriction `json:"scmIpSecurityRestrictions,omitempty"` + // ScmIPSecurityRestrictionsUseMain - IP security restrictions for scm to use main. + ScmIPSecurityRestrictionsUseMain *bool `json:"scmIpSecurityRestrictionsUseMain,omitempty"` + // HTTP20Enabled - Http20Enabled: configures a web site to allow clients to connect over http2.0 + HTTP20Enabled *bool `json:"http20Enabled,omitempty"` + // MinTLSVersion - MinTlsVersion: configures the minimum version of TLS required for SSL requests. Possible values include: 'SupportedTLSVersionsOneFullStopZero', 'SupportedTLSVersionsOneFullStopOne', 'SupportedTLSVersionsOneFullStopTwo' + MinTLSVersion SupportedTLSVersions `json:"minTlsVersion,omitempty"` + // ScmMinTLSVersion - ScmMinTlsVersion: configures the minimum version of TLS required for SSL requests for SCM site. Possible values include: 'SupportedTLSVersionsOneFullStopZero', 'SupportedTLSVersionsOneFullStopOne', 'SupportedTLSVersionsOneFullStopTwo' + ScmMinTLSVersion SupportedTLSVersions `json:"scmMinTlsVersion,omitempty"` + // FtpsState - State of FTP / FTPS service. Possible values include: 'FtpsStateAllAllowed', 'FtpsStateFtpsOnly', 'FtpsStateDisabled' + FtpsState FtpsState `json:"ftpsState,omitempty"` + // PreWarmedInstanceCount - Number of preWarmed instances. + // This setting only applies to the Consumption and Elastic Plans + PreWarmedInstanceCount *int32 `json:"preWarmedInstanceCount,omitempty"` + // FunctionAppScaleLimit - Maximum number of workers that a site can scale out to. + // This setting only applies to the Consumption and Elastic Premium Plans + FunctionAppScaleLimit *int32 `json:"functionAppScaleLimit,omitempty"` + // HealthCheckPath - Health check path + HealthCheckPath *string `json:"healthCheckPath,omitempty"` + // FunctionsRuntimeScaleMonitoringEnabled - Gets or sets a value indicating whether functions runtime scale monitoring is enabled. When enabled, + // the ScaleController will not monitor event sources directly, but will instead call to the + // runtime to get scale status. + FunctionsRuntimeScaleMonitoringEnabled *bool `json:"functionsRuntimeScaleMonitoringEnabled,omitempty"` + // WebsiteTimeZone - Sets the time zone a site uses for generating timestamps. Compatible with Linux and Windows App Service. Setting the WEBSITE_TIME_ZONE app setting takes precedence over this config. For Linux, expects tz database values https://www.iana.org/time-zones (for a quick reference see https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For Windows, expects one of the time zones listed under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones + WebsiteTimeZone *string `json:"websiteTimeZone,omitempty"` + // MinimumElasticInstanceCount - Number of minimum instance count for a site + // This setting only applies to the Elastic Plans + MinimumElasticInstanceCount *int32 `json:"minimumElasticInstanceCount,omitempty"` + // AzureStorageAccounts - List of Azure Storage Accounts. + AzureStorageAccounts map[string]*AzureStorageInfoValue `json:"azureStorageAccounts"` + // PublicNetworkAccess - Property to allow or block all public traffic. + PublicNetworkAccess *string `json:"publicNetworkAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfig. +func (sc SiteConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.NumberOfWorkers != nil { + objectMap["numberOfWorkers"] = sc.NumberOfWorkers + } + if sc.DefaultDocuments != nil { + objectMap["defaultDocuments"] = sc.DefaultDocuments + } + if sc.NetFrameworkVersion != nil { + objectMap["netFrameworkVersion"] = sc.NetFrameworkVersion + } + if sc.PhpVersion != nil { + objectMap["phpVersion"] = sc.PhpVersion + } + if sc.PythonVersion != nil { + objectMap["pythonVersion"] = sc.PythonVersion + } + if sc.NodeVersion != nil { + objectMap["nodeVersion"] = sc.NodeVersion + } + if sc.PowerShellVersion != nil { + objectMap["powerShellVersion"] = sc.PowerShellVersion + } + if sc.LinuxFxVersion != nil { + objectMap["linuxFxVersion"] = sc.LinuxFxVersion + } + if sc.WindowsFxVersion != nil { + objectMap["windowsFxVersion"] = sc.WindowsFxVersion + } + if sc.RequestTracingEnabled != nil { + objectMap["requestTracingEnabled"] = sc.RequestTracingEnabled + } + if sc.RequestTracingExpirationTime != nil { + objectMap["requestTracingExpirationTime"] = sc.RequestTracingExpirationTime + } + if sc.RemoteDebuggingEnabled != nil { + objectMap["remoteDebuggingEnabled"] = sc.RemoteDebuggingEnabled + } + if sc.RemoteDebuggingVersion != nil { + objectMap["remoteDebuggingVersion"] = sc.RemoteDebuggingVersion + } + if sc.HTTPLoggingEnabled != nil { + objectMap["httpLoggingEnabled"] = sc.HTTPLoggingEnabled + } + if sc.AcrUseManagedIdentityCreds != nil { + objectMap["acrUseManagedIdentityCreds"] = sc.AcrUseManagedIdentityCreds + } + if sc.AcrUserManagedIdentityID != nil { + objectMap["acrUserManagedIdentityID"] = sc.AcrUserManagedIdentityID + } + if sc.LogsDirectorySizeLimit != nil { + objectMap["logsDirectorySizeLimit"] = sc.LogsDirectorySizeLimit + } + if sc.DetailedErrorLoggingEnabled != nil { + objectMap["detailedErrorLoggingEnabled"] = sc.DetailedErrorLoggingEnabled + } + if sc.PublishingUsername != nil { + objectMap["publishingUsername"] = sc.PublishingUsername + } + if sc.AppSettings != nil { + objectMap["appSettings"] = sc.AppSettings + } + if sc.ConnectionStrings != nil { + objectMap["connectionStrings"] = sc.ConnectionStrings + } + if sc.HandlerMappings != nil { + objectMap["handlerMappings"] = sc.HandlerMappings + } + if sc.DocumentRoot != nil { + objectMap["documentRoot"] = sc.DocumentRoot + } + if sc.ScmType != "" { + objectMap["scmType"] = sc.ScmType + } + if sc.Use32BitWorkerProcess != nil { + objectMap["use32BitWorkerProcess"] = sc.Use32BitWorkerProcess + } + if sc.WebSocketsEnabled != nil { + objectMap["webSocketsEnabled"] = sc.WebSocketsEnabled + } + if sc.AlwaysOn != nil { + objectMap["alwaysOn"] = sc.AlwaysOn + } + if sc.JavaVersion != nil { + objectMap["javaVersion"] = sc.JavaVersion + } + if sc.JavaContainer != nil { + objectMap["javaContainer"] = sc.JavaContainer + } + if sc.JavaContainerVersion != nil { + objectMap["javaContainerVersion"] = sc.JavaContainerVersion + } + if sc.AppCommandLine != nil { + objectMap["appCommandLine"] = sc.AppCommandLine + } + if sc.ManagedPipelineMode != "" { + objectMap["managedPipelineMode"] = sc.ManagedPipelineMode + } + if sc.VirtualApplications != nil { + objectMap["virtualApplications"] = sc.VirtualApplications + } + if sc.LoadBalancing != "" { + objectMap["loadBalancing"] = sc.LoadBalancing + } + if sc.Experiments != nil { + objectMap["experiments"] = sc.Experiments + } + if sc.Limits != nil { + objectMap["limits"] = sc.Limits + } + if sc.AutoHealEnabled != nil { + objectMap["autoHealEnabled"] = sc.AutoHealEnabled + } + if sc.AutoHealRules != nil { + objectMap["autoHealRules"] = sc.AutoHealRules + } + if sc.TracingOptions != nil { + objectMap["tracingOptions"] = sc.TracingOptions + } + if sc.VnetName != nil { + objectMap["vnetName"] = sc.VnetName + } + if sc.VnetRouteAllEnabled != nil { + objectMap["vnetRouteAllEnabled"] = sc.VnetRouteAllEnabled + } + if sc.VnetPrivatePortsCount != nil { + objectMap["vnetPrivatePortsCount"] = sc.VnetPrivatePortsCount + } + if sc.Cors != nil { + objectMap["cors"] = sc.Cors + } + if sc.Push != nil { + objectMap["push"] = sc.Push + } + if sc.APIDefinition != nil { + objectMap["apiDefinition"] = sc.APIDefinition + } + if sc.APIManagementConfig != nil { + objectMap["apiManagementConfig"] = sc.APIManagementConfig + } + if sc.AutoSwapSlotName != nil { + objectMap["autoSwapSlotName"] = sc.AutoSwapSlotName + } + if sc.LocalMySQLEnabled != nil { + objectMap["localMySqlEnabled"] = sc.LocalMySQLEnabled + } + if sc.ManagedServiceIdentityID != nil { + objectMap["managedServiceIdentityId"] = sc.ManagedServiceIdentityID + } + if sc.XManagedServiceIdentityID != nil { + objectMap["xManagedServiceIdentityId"] = sc.XManagedServiceIdentityID + } + if sc.KeyVaultReferenceIdentity != nil { + objectMap["keyVaultReferenceIdentity"] = sc.KeyVaultReferenceIdentity + } + if sc.IPSecurityRestrictions != nil { + objectMap["ipSecurityRestrictions"] = sc.IPSecurityRestrictions + } + if sc.ScmIPSecurityRestrictions != nil { + objectMap["scmIpSecurityRestrictions"] = sc.ScmIPSecurityRestrictions + } + if sc.ScmIPSecurityRestrictionsUseMain != nil { + objectMap["scmIpSecurityRestrictionsUseMain"] = sc.ScmIPSecurityRestrictionsUseMain + } + if sc.HTTP20Enabled != nil { + objectMap["http20Enabled"] = sc.HTTP20Enabled + } + if sc.MinTLSVersion != "" { + objectMap["minTlsVersion"] = sc.MinTLSVersion + } + if sc.ScmMinTLSVersion != "" { + objectMap["scmMinTlsVersion"] = sc.ScmMinTLSVersion + } + if sc.FtpsState != "" { + objectMap["ftpsState"] = sc.FtpsState + } + if sc.PreWarmedInstanceCount != nil { + objectMap["preWarmedInstanceCount"] = sc.PreWarmedInstanceCount + } + if sc.FunctionAppScaleLimit != nil { + objectMap["functionAppScaleLimit"] = sc.FunctionAppScaleLimit + } + if sc.HealthCheckPath != nil { + objectMap["healthCheckPath"] = sc.HealthCheckPath + } + if sc.FunctionsRuntimeScaleMonitoringEnabled != nil { + objectMap["functionsRuntimeScaleMonitoringEnabled"] = sc.FunctionsRuntimeScaleMonitoringEnabled + } + if sc.WebsiteTimeZone != nil { + objectMap["websiteTimeZone"] = sc.WebsiteTimeZone + } + if sc.MinimumElasticInstanceCount != nil { + objectMap["minimumElasticInstanceCount"] = sc.MinimumElasticInstanceCount + } + if sc.AzureStorageAccounts != nil { + objectMap["azureStorageAccounts"] = sc.AzureStorageAccounts + } + if sc.PublicNetworkAccess != nil { + objectMap["publicNetworkAccess"] = sc.PublicNetworkAccess + } + return json.Marshal(objectMap) +} + +// SiteConfigPropertiesDictionary site config properties dictionary. +type SiteConfigPropertiesDictionary struct { + // Use32BitWorkerProcess - READ-ONLY; true if use32BitWorkerProcess should be set to true for the stack; otherwise, false. + Use32BitWorkerProcess *bool `json:"use32BitWorkerProcess,omitempty"` + // LinuxFxVersion - READ-ONLY; LinuxFxVersion configuration setting. + LinuxFxVersion *string `json:"linuxFxVersion,omitempty"` + // JavaVersion - READ-ONLY; JavaVersion configuration setting. + JavaVersion *string `json:"javaVersion,omitempty"` + // PowerShellVersion - READ-ONLY; PowerShellVersion configuration setting. + PowerShellVersion *string `json:"powerShellVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigPropertiesDictionary. +func (scpd SiteConfigPropertiesDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SiteConfigResource web app configuration ARM resource. +type SiteConfigResource struct { + autorest.Response `json:"-"` + // SiteConfig - Core resource properties + *SiteConfig `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigResource. +func (scr SiteConfigResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scr.SiteConfig != nil { + objectMap["properties"] = scr.SiteConfig + } + if scr.Kind != nil { + objectMap["kind"] = scr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteConfigResource struct. +func (scr *SiteConfigResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteConfig SiteConfig + err = json.Unmarshal(*v, &siteConfig) + if err != nil { + return err + } + scr.SiteConfig = &siteConfig + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scr.Type = &typeVar + } + } + } + + return nil +} + +// SiteConfigResourceCollection collection of site configurations. +type SiteConfigResourceCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SiteConfigResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigResourceCollection. +func (scrc SiteConfigResourceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scrc.Value != nil { + objectMap["value"] = scrc.Value + } + return json.Marshal(objectMap) +} + +// SiteConfigResourceCollectionIterator provides access to a complete listing of SiteConfigResource values. +type SiteConfigResourceCollectionIterator struct { + i int + page SiteConfigResourceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SiteConfigResourceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SiteConfigResourceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SiteConfigResourceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SiteConfigResourceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SiteConfigResourceCollectionIterator) Response() SiteConfigResourceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SiteConfigResourceCollectionIterator) Value() SiteConfigResource { + if !iter.page.NotDone() { + return SiteConfigResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SiteConfigResourceCollectionIterator type. +func NewSiteConfigResourceCollectionIterator(page SiteConfigResourceCollectionPage) SiteConfigResourceCollectionIterator { + return SiteConfigResourceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scrc SiteConfigResourceCollection) IsEmpty() bool { + return scrc.Value == nil || len(*scrc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scrc SiteConfigResourceCollection) hasNextLink() bool { + return scrc.NextLink != nil && len(*scrc.NextLink) != 0 +} + +// siteConfigResourceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scrc SiteConfigResourceCollection) siteConfigResourceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scrc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scrc.NextLink))) +} + +// SiteConfigResourceCollectionPage contains a page of SiteConfigResource values. +type SiteConfigResourceCollectionPage struct { + fn func(context.Context, SiteConfigResourceCollection) (SiteConfigResourceCollection, error) + scrc SiteConfigResourceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SiteConfigResourceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SiteConfigResourceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scrc) + if err != nil { + return err + } + page.scrc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SiteConfigResourceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SiteConfigResourceCollectionPage) NotDone() bool { + return !page.scrc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SiteConfigResourceCollectionPage) Response() SiteConfigResourceCollection { + return page.scrc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SiteConfigResourceCollectionPage) Values() []SiteConfigResource { + if page.scrc.IsEmpty() { + return nil + } + return *page.scrc.Value +} + +// Creates a new instance of the SiteConfigResourceCollectionPage type. +func NewSiteConfigResourceCollectionPage(cur SiteConfigResourceCollection, getNextPage func(context.Context, SiteConfigResourceCollection) (SiteConfigResourceCollection, error)) SiteConfigResourceCollectionPage { + return SiteConfigResourceCollectionPage{ + fn: getNextPage, + scrc: cur, + } +} + +// SiteConfigurationSnapshotInfo a snapshot of a web app configuration. +type SiteConfigurationSnapshotInfo struct { + // SiteConfigurationSnapshotInfoProperties - SiteConfigurationSnapshotInfo resource specific properties + *SiteConfigurationSnapshotInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigurationSnapshotInfo. +func (scsi SiteConfigurationSnapshotInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsi.SiteConfigurationSnapshotInfoProperties != nil { + objectMap["properties"] = scsi.SiteConfigurationSnapshotInfoProperties + } + if scsi.Kind != nil { + objectMap["kind"] = scsi.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteConfigurationSnapshotInfo struct. +func (scsi *SiteConfigurationSnapshotInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteConfigurationSnapshotInfoProperties SiteConfigurationSnapshotInfoProperties + err = json.Unmarshal(*v, &siteConfigurationSnapshotInfoProperties) + if err != nil { + return err + } + scsi.SiteConfigurationSnapshotInfoProperties = &siteConfigurationSnapshotInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scsi.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scsi.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scsi.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scsi.Type = &typeVar + } + } + } + + return nil +} + +// SiteConfigurationSnapshotInfoCollection collection of metadata for the app configuration snapshots that +// can be restored. +type SiteConfigurationSnapshotInfoCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SiteConfigurationSnapshotInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigurationSnapshotInfoCollection. +func (scsic SiteConfigurationSnapshotInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scsic.Value != nil { + objectMap["value"] = scsic.Value + } + return json.Marshal(objectMap) +} + +// SiteConfigurationSnapshotInfoCollectionIterator provides access to a complete listing of +// SiteConfigurationSnapshotInfo values. +type SiteConfigurationSnapshotInfoCollectionIterator struct { + i int + page SiteConfigurationSnapshotInfoCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SiteConfigurationSnapshotInfoCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SiteConfigurationSnapshotInfoCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SiteConfigurationSnapshotInfoCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SiteConfigurationSnapshotInfoCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SiteConfigurationSnapshotInfoCollectionIterator) Response() SiteConfigurationSnapshotInfoCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SiteConfigurationSnapshotInfoCollectionIterator) Value() SiteConfigurationSnapshotInfo { + if !iter.page.NotDone() { + return SiteConfigurationSnapshotInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SiteConfigurationSnapshotInfoCollectionIterator type. +func NewSiteConfigurationSnapshotInfoCollectionIterator(page SiteConfigurationSnapshotInfoCollectionPage) SiteConfigurationSnapshotInfoCollectionIterator { + return SiteConfigurationSnapshotInfoCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scsic SiteConfigurationSnapshotInfoCollection) IsEmpty() bool { + return scsic.Value == nil || len(*scsic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scsic SiteConfigurationSnapshotInfoCollection) hasNextLink() bool { + return scsic.NextLink != nil && len(*scsic.NextLink) != 0 +} + +// siteConfigurationSnapshotInfoCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scsic SiteConfigurationSnapshotInfoCollection) siteConfigurationSnapshotInfoCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scsic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scsic.NextLink))) +} + +// SiteConfigurationSnapshotInfoCollectionPage contains a page of SiteConfigurationSnapshotInfo values. +type SiteConfigurationSnapshotInfoCollectionPage struct { + fn func(context.Context, SiteConfigurationSnapshotInfoCollection) (SiteConfigurationSnapshotInfoCollection, error) + scsic SiteConfigurationSnapshotInfoCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SiteConfigurationSnapshotInfoCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SiteConfigurationSnapshotInfoCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scsic) + if err != nil { + return err + } + page.scsic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SiteConfigurationSnapshotInfoCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SiteConfigurationSnapshotInfoCollectionPage) NotDone() bool { + return !page.scsic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SiteConfigurationSnapshotInfoCollectionPage) Response() SiteConfigurationSnapshotInfoCollection { + return page.scsic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SiteConfigurationSnapshotInfoCollectionPage) Values() []SiteConfigurationSnapshotInfo { + if page.scsic.IsEmpty() { + return nil + } + return *page.scsic.Value +} + +// Creates a new instance of the SiteConfigurationSnapshotInfoCollectionPage type. +func NewSiteConfigurationSnapshotInfoCollectionPage(cur SiteConfigurationSnapshotInfoCollection, getNextPage func(context.Context, SiteConfigurationSnapshotInfoCollection) (SiteConfigurationSnapshotInfoCollection, error)) SiteConfigurationSnapshotInfoCollectionPage { + return SiteConfigurationSnapshotInfoCollectionPage{ + fn: getNextPage, + scsic: cur, + } +} + +// SiteConfigurationSnapshotInfoProperties siteConfigurationSnapshotInfo resource specific properties +type SiteConfigurationSnapshotInfoProperties struct { + // Time - READ-ONLY; The time the snapshot was taken. + Time *date.Time `json:"time,omitempty"` + // SnapshotID - READ-ONLY; The id of the snapshot + SnapshotID *int32 `json:"snapshotId,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteConfigurationSnapshotInfoProperties. +func (scsi SiteConfigurationSnapshotInfoProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SiteExtensionInfo site Extension Information. +type SiteExtensionInfo struct { + autorest.Response `json:"-"` + // SiteExtensionInfoProperties - SiteExtensionInfo resource specific properties + *SiteExtensionInfoProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteExtensionInfo. +func (sei SiteExtensionInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sei.SiteExtensionInfoProperties != nil { + objectMap["properties"] = sei.SiteExtensionInfoProperties + } + if sei.Kind != nil { + objectMap["kind"] = sei.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteExtensionInfo struct. +func (sei *SiteExtensionInfo) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteExtensionInfoProperties SiteExtensionInfoProperties + err = json.Unmarshal(*v, &siteExtensionInfoProperties) + if err != nil { + return err + } + sei.SiteExtensionInfoProperties = &siteExtensionInfoProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sei.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sei.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sei.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sei.Type = &typeVar + } + } + } + + return nil +} + +// SiteExtensionInfoCollection collection of Kudu site extension information elements. +type SiteExtensionInfoCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SiteExtensionInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteExtensionInfoCollection. +func (seic SiteExtensionInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if seic.Value != nil { + objectMap["value"] = seic.Value + } + return json.Marshal(objectMap) +} + +// SiteExtensionInfoCollectionIterator provides access to a complete listing of SiteExtensionInfo values. +type SiteExtensionInfoCollectionIterator struct { + i int + page SiteExtensionInfoCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SiteExtensionInfoCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SiteExtensionInfoCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SiteExtensionInfoCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SiteExtensionInfoCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SiteExtensionInfoCollectionIterator) Response() SiteExtensionInfoCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SiteExtensionInfoCollectionIterator) Value() SiteExtensionInfo { + if !iter.page.NotDone() { + return SiteExtensionInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SiteExtensionInfoCollectionIterator type. +func NewSiteExtensionInfoCollectionIterator(page SiteExtensionInfoCollectionPage) SiteExtensionInfoCollectionIterator { + return SiteExtensionInfoCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (seic SiteExtensionInfoCollection) IsEmpty() bool { + return seic.Value == nil || len(*seic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (seic SiteExtensionInfoCollection) hasNextLink() bool { + return seic.NextLink != nil && len(*seic.NextLink) != 0 +} + +// siteExtensionInfoCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (seic SiteExtensionInfoCollection) siteExtensionInfoCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !seic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(seic.NextLink))) +} + +// SiteExtensionInfoCollectionPage contains a page of SiteExtensionInfo values. +type SiteExtensionInfoCollectionPage struct { + fn func(context.Context, SiteExtensionInfoCollection) (SiteExtensionInfoCollection, error) + seic SiteExtensionInfoCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SiteExtensionInfoCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SiteExtensionInfoCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.seic) + if err != nil { + return err + } + page.seic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SiteExtensionInfoCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SiteExtensionInfoCollectionPage) NotDone() bool { + return !page.seic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SiteExtensionInfoCollectionPage) Response() SiteExtensionInfoCollection { + return page.seic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SiteExtensionInfoCollectionPage) Values() []SiteExtensionInfo { + if page.seic.IsEmpty() { + return nil + } + return *page.seic.Value +} + +// Creates a new instance of the SiteExtensionInfoCollectionPage type. +func NewSiteExtensionInfoCollectionPage(cur SiteExtensionInfoCollection, getNextPage func(context.Context, SiteExtensionInfoCollection) (SiteExtensionInfoCollection, error)) SiteExtensionInfoCollectionPage { + return SiteExtensionInfoCollectionPage{ + fn: getNextPage, + seic: cur, + } +} + +// SiteExtensionInfoProperties siteExtensionInfo resource specific properties +type SiteExtensionInfoProperties struct { + // ExtensionID - Site extension ID. + ExtensionID *string `json:"extension_id,omitempty"` + Title *string `json:"title,omitempty"` + // ExtensionType - Site extension type. Possible values include: 'SiteExtensionTypeGallery', 'SiteExtensionTypeWebRoot' + ExtensionType SiteExtensionType `json:"extension_type,omitempty"` + // Summary - Summary description. + Summary *string `json:"summary,omitempty"` + // Description - Detailed description. + Description *string `json:"description,omitempty"` + // Version - Version information. + Version *string `json:"version,omitempty"` + // ExtensionURL - Extension URL. + ExtensionURL *string `json:"extension_url,omitempty"` + // ProjectURL - Project URL. + ProjectURL *string `json:"project_url,omitempty"` + // IconURL - Icon URL. + IconURL *string `json:"icon_url,omitempty"` + // LicenseURL - License URL. + LicenseURL *string `json:"license_url,omitempty"` + // FeedURL - Feed URL. + FeedURL *string `json:"feed_url,omitempty"` + // Authors - List of authors. + Authors *[]string `json:"authors,omitempty"` + // InstallerCommandLineParams - Installer command line parameters. + InstallerCommandLineParams *string `json:"installer_command_line_params,omitempty"` + // PublishedDateTime - Published timestamp. + PublishedDateTime *date.Time `json:"published_date_time,omitempty"` + // DownloadCount - Count of downloads. + DownloadCount *int32 `json:"download_count,omitempty"` + // LocalIsLatestVersion - true if the local version is the latest version; false otherwise. + LocalIsLatestVersion *bool `json:"local_is_latest_version,omitempty"` + // LocalPath - Local path. + LocalPath *string `json:"local_path,omitempty"` + // InstalledDateTime - Installed timestamp. + InstalledDateTime *date.Time `json:"installed_date_time,omitempty"` + // ProvisioningState - Provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // Comment - Site Extension comment. + Comment *string `json:"comment,omitempty"` +} + +// SiteInstanceStatus ... +type SiteInstanceStatus struct { + autorest.Response `json:"-"` + // SiteInstanceStatusProperties - WebSiteInstanceStatus resource specific properties + *SiteInstanceStatusProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteInstanceStatus. +func (sis SiteInstanceStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sis.SiteInstanceStatusProperties != nil { + objectMap["properties"] = sis.SiteInstanceStatusProperties + } + if sis.Kind != nil { + objectMap["kind"] = sis.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteInstanceStatus struct. +func (sis *SiteInstanceStatus) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteInstanceStatusProperties SiteInstanceStatusProperties + err = json.Unmarshal(*v, &siteInstanceStatusProperties) + if err != nil { + return err + } + sis.SiteInstanceStatusProperties = &siteInstanceStatusProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sis.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sis.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sis.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sis.Type = &typeVar + } + } + } + + return nil +} + +// SiteInstanceStatusProperties webSiteInstanceStatus resource specific properties +type SiteInstanceStatusProperties struct { + // State - Possible values include: 'SiteRuntimeStateREADY', 'SiteRuntimeStateSTOPPED', 'SiteRuntimeStateUNKNOWN' + State SiteRuntimeState `json:"state,omitempty"` + // StatusURL - Link to the GetStatusApi in Kudu + StatusURL *string `json:"statusUrl,omitempty"` + // DetectorURL - Link to the Diagnose and Solve Portal + DetectorURL *string `json:"detectorUrl,omitempty"` + // ConsoleURL - Link to the console to web app instance + ConsoleURL *string `json:"consoleUrl,omitempty"` + // HealthCheckURL - Link to the console to web app instance + HealthCheckURL *string `json:"healthCheckUrl,omitempty"` + Containers map[string]*ContainerInfo `json:"containers"` +} + +// MarshalJSON is the custom marshaler for SiteInstanceStatusProperties. +func (sis SiteInstanceStatusProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sis.State != "" { + objectMap["state"] = sis.State + } + if sis.StatusURL != nil { + objectMap["statusUrl"] = sis.StatusURL + } + if sis.DetectorURL != nil { + objectMap["detectorUrl"] = sis.DetectorURL + } + if sis.ConsoleURL != nil { + objectMap["consoleUrl"] = sis.ConsoleURL + } + if sis.HealthCheckURL != nil { + objectMap["healthCheckUrl"] = sis.HealthCheckURL + } + if sis.Containers != nil { + objectMap["containers"] = sis.Containers + } + return json.Marshal(objectMap) +} + +// SiteLimits metric limits set on an app. +type SiteLimits struct { + // MaxPercentageCPU - Maximum allowed CPU usage percentage. + MaxPercentageCPU *float64 `json:"maxPercentageCpu,omitempty"` + // MaxMemoryInMb - Maximum allowed memory usage in MB. + MaxMemoryInMb *int64 `json:"maxMemoryInMb,omitempty"` + // MaxDiskSizeInMb - Maximum allowed disk size usage in MB. + MaxDiskSizeInMb *int64 `json:"maxDiskSizeInMb,omitempty"` +} + +// SiteLogsConfig configuration of App Service site logs. +type SiteLogsConfig struct { + autorest.Response `json:"-"` + // SiteLogsConfigProperties - SiteLogsConfig resource specific properties + *SiteLogsConfigProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteLogsConfig. +func (slc SiteLogsConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if slc.SiteLogsConfigProperties != nil { + objectMap["properties"] = slc.SiteLogsConfigProperties + } + if slc.Kind != nil { + objectMap["kind"] = slc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteLogsConfig struct. +func (slc *SiteLogsConfig) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteLogsConfigProperties SiteLogsConfigProperties + err = json.Unmarshal(*v, &siteLogsConfigProperties) + if err != nil { + return err + } + slc.SiteLogsConfigProperties = &siteLogsConfigProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + slc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + slc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + slc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + slc.Type = &typeVar + } + } + } + + return nil +} + +// SiteLogsConfigProperties siteLogsConfig resource specific properties +type SiteLogsConfigProperties struct { + // ApplicationLogs - Application logs configuration. + ApplicationLogs *ApplicationLogsConfig `json:"applicationLogs,omitempty"` + // HTTPLogs - HTTP logs configuration. + HTTPLogs *HTTPLogsConfig `json:"httpLogs,omitempty"` + // FailedRequestsTracing - Failed requests tracing configuration. + FailedRequestsTracing *EnabledConfig `json:"failedRequestsTracing,omitempty"` + // DetailedErrorMessages - Detailed error messages configuration. + DetailedErrorMessages *EnabledConfig `json:"detailedErrorMessages,omitempty"` +} + +// SiteMachineKey machineKey of an app. +type SiteMachineKey struct { + // Validation - MachineKey validation. + Validation *string `json:"validation,omitempty"` + // ValidationKey - Validation key. + ValidationKey *string `json:"validationKey,omitempty"` + // Decryption - Algorithm used for decryption. + Decryption *string `json:"decryption,omitempty"` + // DecryptionKey - Decryption key. + DecryptionKey *string `json:"decryptionKey,omitempty"` +} + +// SitePatchResource ARM resource for a site. +type SitePatchResource struct { + // SitePatchResourceProperties - SitePatchResource resource specific properties + *SitePatchResourceProperties `json:"properties,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SitePatchResource. +func (spr SitePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spr.SitePatchResourceProperties != nil { + objectMap["properties"] = spr.SitePatchResourceProperties + } + if spr.Identity != nil { + objectMap["identity"] = spr.Identity + } + if spr.Kind != nil { + objectMap["kind"] = spr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SitePatchResource struct. +func (spr *SitePatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sitePatchResourceProperties SitePatchResourceProperties + err = json.Unmarshal(*v, &sitePatchResourceProperties) + if err != nil { + return err + } + spr.SitePatchResourceProperties = &sitePatchResourceProperties + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + spr.Identity = &identity + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + spr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spr.Type = &typeVar + } + } + } + + return nil +} + +// SitePatchResourceProperties sitePatchResource resource specific properties +type SitePatchResourceProperties struct { + // State - READ-ONLY; Current state of the app. + State *string `json:"state,omitempty"` + // HostNames - READ-ONLY; Hostnames associated with the app. + HostNames *[]string `json:"hostNames,omitempty"` + // RepositorySiteName - READ-ONLY; Name of the repository site. + RepositorySiteName *string `json:"repositorySiteName,omitempty"` + // UsageState - READ-ONLY; State indicating whether the app has exceeded its quota usage. Read-only. Possible values include: 'UsageStateNormal', 'UsageStateExceeded' + UsageState UsageState `json:"usageState,omitempty"` + // Enabled - true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). + Enabled *bool `json:"enabled,omitempty"` + // EnabledHostNames - READ-ONLY; Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + // the app is not served on those hostnames. + EnabledHostNames *[]string `json:"enabledHostNames,omitempty"` + // AvailabilityState - READ-ONLY; Management information availability state for the app. Possible values include: 'SiteAvailabilityStateNormal', 'SiteAvailabilityStateLimited', 'SiteAvailabilityStateDisasterRecoveryMode' + AvailabilityState SiteAvailabilityState `json:"availabilityState,omitempty"` + // HostNameSslStates - Hostname SSL states are used to manage the SSL bindings for app's hostnames. + HostNameSslStates *[]HostNameSslState `json:"hostNameSslStates,omitempty"` + // ServerFarmID - Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + // Reserved - true if reserved; otherwise, false. + Reserved *bool `json:"reserved,omitempty"` + // IsXenon - Obsolete: Hyper-V sandbox. + IsXenon *bool `json:"isXenon,omitempty"` + // HyperV - Hyper-V sandbox. + HyperV *bool `json:"hyperV,omitempty"` + // LastModifiedTimeUtc - READ-ONLY; Last time the app was modified, in UTC. Read-only. + LastModifiedTimeUtc *date.Time `json:"lastModifiedTimeUtc,omitempty"` + // SiteConfig - Configuration of the app. + SiteConfig *SiteConfig `json:"siteConfig,omitempty"` + // TrafficManagerHostNames - READ-ONLY; Azure Traffic Manager hostnames associated with the app. Read-only. + TrafficManagerHostNames *[]string `json:"trafficManagerHostNames,omitempty"` + // ScmSiteAlsoStopped - true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. + ScmSiteAlsoStopped *bool `json:"scmSiteAlsoStopped,omitempty"` + // TargetSwapSlot - READ-ONLY; Specifies which deployment slot this app will swap into. Read-only. + TargetSwapSlot *string `json:"targetSwapSlot,omitempty"` + // HostingEnvironmentProfile - App Service Environment to use for the app. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + // ClientAffinityEnabled - true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true. + ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"` + // ClientCertEnabled - true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. + ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` + // ClientCertMode - This composes with ClientCertEnabled setting. + // - ClientCertEnabled: false means ClientCert is ignored. + // - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + // - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. Possible values include: 'ClientCertModeRequired', 'ClientCertModeOptional', 'ClientCertModeOptionalInteractiveUser' + ClientCertMode ClientCertMode `json:"clientCertMode,omitempty"` + // ClientCertExclusionPaths - client certificate authentication comma-separated exclusion paths + ClientCertExclusionPaths *string `json:"clientCertExclusionPaths,omitempty"` + // HostNamesDisabled - true to disable the public hostnames of the app; otherwise, false. + // If true, the app is only accessible via API management process. + HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` + // CustomDomainVerificationID - Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + CustomDomainVerificationID *string `json:"customDomainVerificationId,omitempty"` + // OutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"` + // PossibleOutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + PossibleOutboundIPAddresses *string `json:"possibleOutboundIpAddresses,omitempty"` + // ContainerSize - Size of the function container. + ContainerSize *int32 `json:"containerSize,omitempty"` + // DailyMemoryTimeQuota - Maximum allowed daily memory-time quota (applicable on dynamic apps only). + DailyMemoryTimeQuota *int32 `json:"dailyMemoryTimeQuota,omitempty"` + // SuspendedTill - READ-ONLY; App suspended till in case memory-time quota is exceeded. + SuspendedTill *date.Time `json:"suspendedTill,omitempty"` + // MaxNumberOfWorkers - READ-ONLY; Maximum number of workers. + // This only applies to Functions container. + MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty"` + // CloningInfo - If specified during app creation, the app is cloned from a source app. + CloningInfo *CloningInfo `json:"cloningInfo,omitempty"` + // ResourceGroup - READ-ONLY; Name of the resource group the app belongs to. Read-only. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // IsDefaultContainer - READ-ONLY; true if the app is a default container; otherwise, false. + IsDefaultContainer *bool `json:"isDefaultContainer,omitempty"` + // DefaultHostName - READ-ONLY; Default hostname of the app. Read-only. + DefaultHostName *string `json:"defaultHostName,omitempty"` + // SlotSwapStatus - READ-ONLY; Status of the last deployment slot swap operation. + SlotSwapStatus *SlotSwapStatus `json:"slotSwapStatus,omitempty"` + // HTTPSOnly - HttpsOnly: configures a web site to accept only https requests. Issues redirect for + // http requests + HTTPSOnly *bool `json:"httpsOnly,omitempty"` + // RedundancyMode - Site redundancy mode. Possible values include: 'RedundancyModeNone', 'RedundancyModeManual', 'RedundancyModeFailover', 'RedundancyModeActiveActive', 'RedundancyModeGeoRedundant' + RedundancyMode RedundancyMode `json:"redundancyMode,omitempty"` + // InProgressOperationID - READ-ONLY; Specifies an operation id if this site has a pending operation. + InProgressOperationID *uuid.UUID `json:"inProgressOperationId,omitempty"` + // StorageAccountRequired - Checks if Customer provided storage account is required + StorageAccountRequired *bool `json:"storageAccountRequired,omitempty"` + // KeyVaultReferenceIdentity - Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + // VirtualNetworkSubnetID - Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + // This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` +} + +// MarshalJSON is the custom marshaler for SitePatchResourceProperties. +func (spr SitePatchResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spr.Enabled != nil { + objectMap["enabled"] = spr.Enabled + } + if spr.HostNameSslStates != nil { + objectMap["hostNameSslStates"] = spr.HostNameSslStates + } + if spr.ServerFarmID != nil { + objectMap["serverFarmId"] = spr.ServerFarmID + } + if spr.Reserved != nil { + objectMap["reserved"] = spr.Reserved + } + if spr.IsXenon != nil { + objectMap["isXenon"] = spr.IsXenon + } + if spr.HyperV != nil { + objectMap["hyperV"] = spr.HyperV + } + if spr.SiteConfig != nil { + objectMap["siteConfig"] = spr.SiteConfig + } + if spr.ScmSiteAlsoStopped != nil { + objectMap["scmSiteAlsoStopped"] = spr.ScmSiteAlsoStopped + } + if spr.HostingEnvironmentProfile != nil { + objectMap["hostingEnvironmentProfile"] = spr.HostingEnvironmentProfile + } + if spr.ClientAffinityEnabled != nil { + objectMap["clientAffinityEnabled"] = spr.ClientAffinityEnabled + } + if spr.ClientCertEnabled != nil { + objectMap["clientCertEnabled"] = spr.ClientCertEnabled + } + if spr.ClientCertMode != "" { + objectMap["clientCertMode"] = spr.ClientCertMode + } + if spr.ClientCertExclusionPaths != nil { + objectMap["clientCertExclusionPaths"] = spr.ClientCertExclusionPaths + } + if spr.HostNamesDisabled != nil { + objectMap["hostNamesDisabled"] = spr.HostNamesDisabled + } + if spr.CustomDomainVerificationID != nil { + objectMap["customDomainVerificationId"] = spr.CustomDomainVerificationID + } + if spr.ContainerSize != nil { + objectMap["containerSize"] = spr.ContainerSize + } + if spr.DailyMemoryTimeQuota != nil { + objectMap["dailyMemoryTimeQuota"] = spr.DailyMemoryTimeQuota + } + if spr.CloningInfo != nil { + objectMap["cloningInfo"] = spr.CloningInfo + } + if spr.HTTPSOnly != nil { + objectMap["httpsOnly"] = spr.HTTPSOnly + } + if spr.RedundancyMode != "" { + objectMap["redundancyMode"] = spr.RedundancyMode + } + if spr.StorageAccountRequired != nil { + objectMap["storageAccountRequired"] = spr.StorageAccountRequired + } + if spr.KeyVaultReferenceIdentity != nil { + objectMap["keyVaultReferenceIdentity"] = spr.KeyVaultReferenceIdentity + } + if spr.VirtualNetworkSubnetID != nil { + objectMap["virtualNetworkSubnetId"] = spr.VirtualNetworkSubnetID + } + return json.Marshal(objectMap) +} + +// SitePhpErrorLogFlag used for getting PHP error logging flag. +type SitePhpErrorLogFlag struct { + autorest.Response `json:"-"` + // SitePhpErrorLogFlagProperties - SitePhpErrorLogFlag resource specific properties + *SitePhpErrorLogFlagProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SitePhpErrorLogFlag. +func (spelf SitePhpErrorLogFlag) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if spelf.SitePhpErrorLogFlagProperties != nil { + objectMap["properties"] = spelf.SitePhpErrorLogFlagProperties + } + if spelf.Kind != nil { + objectMap["kind"] = spelf.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SitePhpErrorLogFlag struct. +func (spelf *SitePhpErrorLogFlag) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sitePhpErrorLogFlagProperties SitePhpErrorLogFlagProperties + err = json.Unmarshal(*v, &sitePhpErrorLogFlagProperties) + if err != nil { + return err + } + spelf.SitePhpErrorLogFlagProperties = &sitePhpErrorLogFlagProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + spelf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + spelf.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + spelf.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + spelf.Type = &typeVar + } + } + } + + return nil +} + +// SitePhpErrorLogFlagProperties sitePhpErrorLogFlag resource specific properties +type SitePhpErrorLogFlagProperties struct { + // LocalLogErrors - Local log_errors setting. + LocalLogErrors *string `json:"localLogErrors,omitempty"` + // MasterLogErrors - Master log_errors setting. + MasterLogErrors *string `json:"masterLogErrors,omitempty"` + // LocalLogErrorsMaxLength - Local log_errors_max_len setting. + LocalLogErrorsMaxLength *string `json:"localLogErrorsMaxLength,omitempty"` + // MasterLogErrorsMaxLength - Master log_errors_max_len setting. + MasterLogErrorsMaxLength *string `json:"masterLogErrorsMaxLength,omitempty"` +} + +// SiteProperties site resource specific properties +type SiteProperties struct { + // State - READ-ONLY; Current state of the app. + State *string `json:"state,omitempty"` + // HostNames - READ-ONLY; Hostnames associated with the app. + HostNames *[]string `json:"hostNames,omitempty"` + // RepositorySiteName - READ-ONLY; Name of the repository site. + RepositorySiteName *string `json:"repositorySiteName,omitempty"` + // UsageState - READ-ONLY; State indicating whether the app has exceeded its quota usage. Read-only. Possible values include: 'UsageStateNormal', 'UsageStateExceeded' + UsageState UsageState `json:"usageState,omitempty"` + // Enabled - true if the app is enabled; otherwise, false. Setting this value to false disables the app (takes the app offline). + Enabled *bool `json:"enabled,omitempty"` + // EnabledHostNames - READ-ONLY; Enabled hostnames for the app.Hostnames need to be assigned (see HostNames) AND enabled. Otherwise, + // the app is not served on those hostnames. + EnabledHostNames *[]string `json:"enabledHostNames,omitempty"` + // AvailabilityState - READ-ONLY; Management information availability state for the app. Possible values include: 'SiteAvailabilityStateNormal', 'SiteAvailabilityStateLimited', 'SiteAvailabilityStateDisasterRecoveryMode' + AvailabilityState SiteAvailabilityState `json:"availabilityState,omitempty"` + // HostNameSslStates - Hostname SSL states are used to manage the SSL bindings for app's hostnames. + HostNameSslStates *[]HostNameSslState `json:"hostNameSslStates,omitempty"` + // ServerFarmID - Resource ID of the associated App Service plan, formatted as: "/subscriptions/{subscriptionID}/resourceGroups/{groupName}/providers/Microsoft.Web/serverfarms/{appServicePlanName}". + ServerFarmID *string `json:"serverFarmId,omitempty"` + // Reserved - true if reserved; otherwise, false. + Reserved *bool `json:"reserved,omitempty"` + // IsXenon - Obsolete: Hyper-V sandbox. + IsXenon *bool `json:"isXenon,omitempty"` + // HyperV - Hyper-V sandbox. + HyperV *bool `json:"hyperV,omitempty"` + // LastModifiedTimeUtc - READ-ONLY; Last time the app was modified, in UTC. Read-only. + LastModifiedTimeUtc *date.Time `json:"lastModifiedTimeUtc,omitempty"` + // SiteConfig - Configuration of the app. + SiteConfig *SiteConfig `json:"siteConfig,omitempty"` + // TrafficManagerHostNames - READ-ONLY; Azure Traffic Manager hostnames associated with the app. Read-only. + TrafficManagerHostNames *[]string `json:"trafficManagerHostNames,omitempty"` + // ScmSiteAlsoStopped - true to stop SCM (KUDU) site when the app is stopped; otherwise, false. The default is false. + ScmSiteAlsoStopped *bool `json:"scmSiteAlsoStopped,omitempty"` + // TargetSwapSlot - READ-ONLY; Specifies which deployment slot this app will swap into. Read-only. + TargetSwapSlot *string `json:"targetSwapSlot,omitempty"` + // HostingEnvironmentProfile - App Service Environment to use for the app. + HostingEnvironmentProfile *HostingEnvironmentProfile `json:"hostingEnvironmentProfile,omitempty"` + // ClientAffinityEnabled - true to enable client affinity; false to stop sending session affinity cookies, which route client requests in the same session to the same instance. Default is true. + ClientAffinityEnabled *bool `json:"clientAffinityEnabled,omitempty"` + // ClientCertEnabled - true to enable client certificate authentication (TLS mutual authentication); otherwise, false. Default is false. + ClientCertEnabled *bool `json:"clientCertEnabled,omitempty"` + // ClientCertMode - This composes with ClientCertEnabled setting. + // - ClientCertEnabled: false means ClientCert is ignored. + // - ClientCertEnabled: true and ClientCertMode: Required means ClientCert is required. + // - ClientCertEnabled: true and ClientCertMode: Optional means ClientCert is optional or accepted. Possible values include: 'ClientCertModeRequired', 'ClientCertModeOptional', 'ClientCertModeOptionalInteractiveUser' + ClientCertMode ClientCertMode `json:"clientCertMode,omitempty"` + // ClientCertExclusionPaths - client certificate authentication comma-separated exclusion paths + ClientCertExclusionPaths *string `json:"clientCertExclusionPaths,omitempty"` + // HostNamesDisabled - true to disable the public hostnames of the app; otherwise, false. + // If true, the app is only accessible via API management process. + HostNamesDisabled *bool `json:"hostNamesDisabled,omitempty"` + // CustomDomainVerificationID - Unique identifier that verifies the custom domains assigned to the app. Customer will add this id to a txt record for verification. + CustomDomainVerificationID *string `json:"customDomainVerificationId,omitempty"` + // OutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from tenants that site can be hosted with current settings. Read-only. + OutboundIPAddresses *string `json:"outboundIpAddresses,omitempty"` + // PossibleOutboundIPAddresses - READ-ONLY; List of IP addresses that the app uses for outbound connections (e.g. database access). Includes VIPs from all tenants except dataComponent. Read-only. + PossibleOutboundIPAddresses *string `json:"possibleOutboundIpAddresses,omitempty"` + // ContainerSize - Size of the function container. + ContainerSize *int32 `json:"containerSize,omitempty"` + // DailyMemoryTimeQuota - Maximum allowed daily memory-time quota (applicable on dynamic apps only). + DailyMemoryTimeQuota *int32 `json:"dailyMemoryTimeQuota,omitempty"` + // SuspendedTill - READ-ONLY; App suspended till in case memory-time quota is exceeded. + SuspendedTill *date.Time `json:"suspendedTill,omitempty"` + // MaxNumberOfWorkers - READ-ONLY; Maximum number of workers. + // This only applies to Functions container. + MaxNumberOfWorkers *int32 `json:"maxNumberOfWorkers,omitempty"` + // CloningInfo - If specified during app creation, the app is cloned from a source app. + CloningInfo *CloningInfo `json:"cloningInfo,omitempty"` + // ResourceGroup - READ-ONLY; Name of the resource group the app belongs to. Read-only. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // IsDefaultContainer - READ-ONLY; true if the app is a default container; otherwise, false. + IsDefaultContainer *bool `json:"isDefaultContainer,omitempty"` + // DefaultHostName - READ-ONLY; Default hostname of the app. Read-only. + DefaultHostName *string `json:"defaultHostName,omitempty"` + // SlotSwapStatus - READ-ONLY; Status of the last deployment slot swap operation. + SlotSwapStatus *SlotSwapStatus `json:"slotSwapStatus,omitempty"` + // HTTPSOnly - HttpsOnly: configures a web site to accept only https requests. Issues redirect for + // http requests + HTTPSOnly *bool `json:"httpsOnly,omitempty"` + // RedundancyMode - Site redundancy mode. Possible values include: 'RedundancyModeNone', 'RedundancyModeManual', 'RedundancyModeFailover', 'RedundancyModeActiveActive', 'RedundancyModeGeoRedundant' + RedundancyMode RedundancyMode `json:"redundancyMode,omitempty"` + // InProgressOperationID - READ-ONLY; Specifies an operation id if this site has a pending operation. + InProgressOperationID *uuid.UUID `json:"inProgressOperationId,omitempty"` + // StorageAccountRequired - Checks if Customer provided storage account is required + StorageAccountRequired *bool `json:"storageAccountRequired,omitempty"` + // KeyVaultReferenceIdentity - Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + // VirtualNetworkSubnetID - Azure Resource Manager ID of the Virtual network and subnet to be joined by Regional VNET Integration. + // This must be of the form /subscriptions/{subscriptionName}/resourceGroups/{resourceGroupName}/providers/Microsoft.Network/virtualNetworks/{vnetName}/subnets/{subnetName} + VirtualNetworkSubnetID *string `json:"virtualNetworkSubnetId,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteProperties. +func (s SiteProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Enabled != nil { + objectMap["enabled"] = s.Enabled + } + if s.HostNameSslStates != nil { + objectMap["hostNameSslStates"] = s.HostNameSslStates + } + if s.ServerFarmID != nil { + objectMap["serverFarmId"] = s.ServerFarmID + } + if s.Reserved != nil { + objectMap["reserved"] = s.Reserved + } + if s.IsXenon != nil { + objectMap["isXenon"] = s.IsXenon + } + if s.HyperV != nil { + objectMap["hyperV"] = s.HyperV + } + if s.SiteConfig != nil { + objectMap["siteConfig"] = s.SiteConfig + } + if s.ScmSiteAlsoStopped != nil { + objectMap["scmSiteAlsoStopped"] = s.ScmSiteAlsoStopped + } + if s.HostingEnvironmentProfile != nil { + objectMap["hostingEnvironmentProfile"] = s.HostingEnvironmentProfile + } + if s.ClientAffinityEnabled != nil { + objectMap["clientAffinityEnabled"] = s.ClientAffinityEnabled + } + if s.ClientCertEnabled != nil { + objectMap["clientCertEnabled"] = s.ClientCertEnabled + } + if s.ClientCertMode != "" { + objectMap["clientCertMode"] = s.ClientCertMode + } + if s.ClientCertExclusionPaths != nil { + objectMap["clientCertExclusionPaths"] = s.ClientCertExclusionPaths + } + if s.HostNamesDisabled != nil { + objectMap["hostNamesDisabled"] = s.HostNamesDisabled + } + if s.CustomDomainVerificationID != nil { + objectMap["customDomainVerificationId"] = s.CustomDomainVerificationID + } + if s.ContainerSize != nil { + objectMap["containerSize"] = s.ContainerSize + } + if s.DailyMemoryTimeQuota != nil { + objectMap["dailyMemoryTimeQuota"] = s.DailyMemoryTimeQuota + } + if s.CloningInfo != nil { + objectMap["cloningInfo"] = s.CloningInfo + } + if s.HTTPSOnly != nil { + objectMap["httpsOnly"] = s.HTTPSOnly + } + if s.RedundancyMode != "" { + objectMap["redundancyMode"] = s.RedundancyMode + } + if s.StorageAccountRequired != nil { + objectMap["storageAccountRequired"] = s.StorageAccountRequired + } + if s.KeyVaultReferenceIdentity != nil { + objectMap["keyVaultReferenceIdentity"] = s.KeyVaultReferenceIdentity + } + if s.VirtualNetworkSubnetID != nil { + objectMap["virtualNetworkSubnetId"] = s.VirtualNetworkSubnetID + } + return json.Marshal(objectMap) +} + +// SiteSeal site seal +type SiteSeal struct { + autorest.Response `json:"-"` + // HTML - HTML snippet + HTML *string `json:"html,omitempty"` +} + +// SiteSealRequest site seal request. +type SiteSealRequest struct { + // LightTheme - If true use the light color theme for site seal; otherwise, use the default color theme. + LightTheme *bool `json:"lightTheme,omitempty"` + // Locale - Locale of site seal. + Locale *string `json:"locale,omitempty"` +} + +// SiteSourceControl source control configuration for an app. +type SiteSourceControl struct { + autorest.Response `json:"-"` + // SiteSourceControlProperties - SiteSourceControl resource specific properties + *SiteSourceControlProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SiteSourceControl. +func (ssc SiteSourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssc.SiteSourceControlProperties != nil { + objectMap["properties"] = ssc.SiteSourceControlProperties + } + if ssc.Kind != nil { + objectMap["kind"] = ssc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SiteSourceControl struct. +func (ssc *SiteSourceControl) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var siteSourceControlProperties SiteSourceControlProperties + err = json.Unmarshal(*v, &siteSourceControlProperties) + if err != nil { + return err + } + ssc.SiteSourceControlProperties = &siteSourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssc.Type = &typeVar + } + } + } + + return nil +} + +// SiteSourceControlProperties siteSourceControl resource specific properties +type SiteSourceControlProperties struct { + // RepoURL - Repository or source control URL. + RepoURL *string `json:"repoUrl,omitempty"` + // Branch - Name of branch to use for deployment. + Branch *string `json:"branch,omitempty"` + // IsManualIntegration - true to limit to manual integration; false to enable continuous integration (which configures webhooks into online repos like GitHub). + IsManualIntegration *bool `json:"isManualIntegration,omitempty"` + // IsGitHubAction - true if this is deployed via GitHub action. + IsGitHubAction *bool `json:"isGitHubAction,omitempty"` + // DeploymentRollbackEnabled - true to enable deployment rollback; otherwise, false. + DeploymentRollbackEnabled *bool `json:"deploymentRollbackEnabled,omitempty"` + // IsMercurial - true for a Mercurial repository; false for a Git repository. + IsMercurial *bool `json:"isMercurial,omitempty"` + // GitHubActionConfiguration - If GitHub Action is selected, than the associated configuration. + GitHubActionConfiguration *GitHubActionConfiguration `json:"gitHubActionConfiguration,omitempty"` +} + +// SkuCapacity description of the App Service plan scale options. +type SkuCapacity struct { + // Minimum - Minimum number of workers for this App Service plan SKU. + Minimum *int32 `json:"minimum,omitempty"` + // Maximum - Maximum number of workers for this App Service plan SKU. + Maximum *int32 `json:"maximum,omitempty"` + // ElasticMaximum - Maximum number of Elastic workers for this App Service plan SKU. + ElasticMaximum *int32 `json:"elasticMaximum,omitempty"` + // Default - Default number of workers for this App Service plan SKU. + Default *int32 `json:"default,omitempty"` + // ScaleType - Available scale configurations for an App Service plan. + ScaleType *string `json:"scaleType,omitempty"` +} + +// SkuDescription description of a SKU for a scalable resource. +type SkuDescription struct { + // Name - Name of the resource SKU. + Name *string `json:"name,omitempty"` + // Tier - Service tier of the resource SKU. + Tier *string `json:"tier,omitempty"` + // Size - Size specifier of the resource SKU. + Size *string `json:"size,omitempty"` + // Family - Family code of the resource SKU. + Family *string `json:"family,omitempty"` + // Capacity - Current number of instances assigned to the resource. + Capacity *int32 `json:"capacity,omitempty"` + // SkuCapacity - Min, max, and default scale values of the SKU. + SkuCapacity *SkuCapacity `json:"skuCapacity,omitempty"` + // Locations - Locations of the SKU. + Locations *[]string `json:"locations,omitempty"` + // Capabilities - Capabilities of the SKU, e.g., is traffic manager enabled? + Capabilities *[]Capability `json:"capabilities,omitempty"` +} + +// SkuInfo SKU discovery information. +type SkuInfo struct { + // ResourceType - Resource type that this SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + // Sku - Name and tier of the SKU. + Sku *SkuDescription `json:"sku,omitempty"` + // Capacity - Min, max, and default scale values of the SKU. + Capacity *SkuCapacity `json:"capacity,omitempty"` +} + +// SkuInfoCollection collection of SKU information. +type SkuInfoCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SkuInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuInfoCollection. +func (sic SkuInfoCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sic.Value != nil { + objectMap["value"] = sic.Value + } + return json.Marshal(objectMap) +} + +// SkuInfoCollectionIterator provides access to a complete listing of SkuInfo values. +type SkuInfoCollectionIterator struct { + i int + page SkuInfoCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SkuInfoCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuInfoCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SkuInfoCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SkuInfoCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SkuInfoCollectionIterator) Response() SkuInfoCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SkuInfoCollectionIterator) Value() SkuInfo { + if !iter.page.NotDone() { + return SkuInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SkuInfoCollectionIterator type. +func NewSkuInfoCollectionIterator(page SkuInfoCollectionPage) SkuInfoCollectionIterator { + return SkuInfoCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sic SkuInfoCollection) IsEmpty() bool { + return sic.Value == nil || len(*sic.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sic SkuInfoCollection) hasNextLink() bool { + return sic.NextLink != nil && len(*sic.NextLink) != 0 +} + +// skuInfoCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sic SkuInfoCollection) skuInfoCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !sic.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sic.NextLink))) +} + +// SkuInfoCollectionPage contains a page of SkuInfo values. +type SkuInfoCollectionPage struct { + fn func(context.Context, SkuInfoCollection) (SkuInfoCollection, error) + sic SkuInfoCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SkuInfoCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkuInfoCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sic) + if err != nil { + return err + } + page.sic = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SkuInfoCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SkuInfoCollectionPage) NotDone() bool { + return !page.sic.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SkuInfoCollectionPage) Response() SkuInfoCollection { + return page.sic +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SkuInfoCollectionPage) Values() []SkuInfo { + if page.sic.IsEmpty() { + return nil + } + return *page.sic.Value +} + +// Creates a new instance of the SkuInfoCollectionPage type. +func NewSkuInfoCollectionPage(cur SkuInfoCollection, getNextPage func(context.Context, SkuInfoCollection) (SkuInfoCollection, error)) SkuInfoCollectionPage { + return SkuInfoCollectionPage{ + fn: getNextPage, + sic: cur, + } +} + +// SkuInfos collection of SKU information. +type SkuInfos struct { + autorest.Response `json:"-"` + // ResourceType - Resource type that this SKU applies to. + ResourceType *string `json:"resourceType,omitempty"` + // Skus - List of SKUs the subscription is able to use. + Skus *[]GlobalCsmSkuDescription `json:"skus,omitempty"` +} + +// SlotConfigNames names for connection strings, application settings, and external Azure storage account +// configuration +// identifiers to be marked as sticky to the deployment slot and not moved during a swap operation. +// This is valid for all deployment slots in an app. +type SlotConfigNames struct { + // ConnectionStringNames - List of connection string names. + ConnectionStringNames *[]string `json:"connectionStringNames,omitempty"` + // AppSettingNames - List of application settings names. + AppSettingNames *[]string `json:"appSettingNames,omitempty"` + // AzureStorageConfigNames - List of external Azure storage account identifiers. + AzureStorageConfigNames *[]string `json:"azureStorageConfigNames,omitempty"` +} + +// SlotConfigNamesResource slot Config names azure resource. +type SlotConfigNamesResource struct { + autorest.Response `json:"-"` + // SlotConfigNames - Core resource properties + *SlotConfigNames `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SlotConfigNamesResource. +func (scnr SlotConfigNamesResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scnr.SlotConfigNames != nil { + objectMap["properties"] = scnr.SlotConfigNames + } + if scnr.Kind != nil { + objectMap["kind"] = scnr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SlotConfigNamesResource struct. +func (scnr *SlotConfigNamesResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var slotConfigNames SlotConfigNames + err = json.Unmarshal(*v, &slotConfigNames) + if err != nil { + return err + } + scnr.SlotConfigNames = &slotConfigNames + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + scnr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + scnr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + scnr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + scnr.Type = &typeVar + } + } + } + + return nil +} + +// SlotDifference a setting difference between two deployment slots of an app. +type SlotDifference struct { + // SlotDifferenceProperties - SlotDifference resource specific properties + *SlotDifferenceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SlotDifference. +func (sd SlotDifference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.SlotDifferenceProperties != nil { + objectMap["properties"] = sd.SlotDifferenceProperties + } + if sd.Kind != nil { + objectMap["kind"] = sd.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SlotDifference struct. +func (sd *SlotDifference) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var slotDifferenceProperties SlotDifferenceProperties + err = json.Unmarshal(*v, &slotDifferenceProperties) + if err != nil { + return err + } + sd.SlotDifferenceProperties = &slotDifferenceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sd.Type = &typeVar + } + } + } + + return nil +} + +// SlotDifferenceCollection collection of slot differences. +type SlotDifferenceCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SlotDifference `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SlotDifferenceCollection. +func (sdc SlotDifferenceCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sdc.Value != nil { + objectMap["value"] = sdc.Value + } + return json.Marshal(objectMap) +} + +// SlotDifferenceCollectionIterator provides access to a complete listing of SlotDifference values. +type SlotDifferenceCollectionIterator struct { + i int + page SlotDifferenceCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SlotDifferenceCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SlotDifferenceCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SlotDifferenceCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SlotDifferenceCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SlotDifferenceCollectionIterator) Response() SlotDifferenceCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SlotDifferenceCollectionIterator) Value() SlotDifference { + if !iter.page.NotDone() { + return SlotDifference{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SlotDifferenceCollectionIterator type. +func NewSlotDifferenceCollectionIterator(page SlotDifferenceCollectionPage) SlotDifferenceCollectionIterator { + return SlotDifferenceCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sdc SlotDifferenceCollection) IsEmpty() bool { + return sdc.Value == nil || len(*sdc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sdc SlotDifferenceCollection) hasNextLink() bool { + return sdc.NextLink != nil && len(*sdc.NextLink) != 0 +} + +// slotDifferenceCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sdc SlotDifferenceCollection) slotDifferenceCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !sdc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sdc.NextLink))) +} + +// SlotDifferenceCollectionPage contains a page of SlotDifference values. +type SlotDifferenceCollectionPage struct { + fn func(context.Context, SlotDifferenceCollection) (SlotDifferenceCollection, error) + sdc SlotDifferenceCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SlotDifferenceCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SlotDifferenceCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sdc) + if err != nil { + return err + } + page.sdc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SlotDifferenceCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SlotDifferenceCollectionPage) NotDone() bool { + return !page.sdc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SlotDifferenceCollectionPage) Response() SlotDifferenceCollection { + return page.sdc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SlotDifferenceCollectionPage) Values() []SlotDifference { + if page.sdc.IsEmpty() { + return nil + } + return *page.sdc.Value +} + +// Creates a new instance of the SlotDifferenceCollectionPage type. +func NewSlotDifferenceCollectionPage(cur SlotDifferenceCollection, getNextPage func(context.Context, SlotDifferenceCollection) (SlotDifferenceCollection, error)) SlotDifferenceCollectionPage { + return SlotDifferenceCollectionPage{ + fn: getNextPage, + sdc: cur, + } +} + +// SlotDifferenceProperties slotDifference resource specific properties +type SlotDifferenceProperties struct { + // Level - READ-ONLY; Level of the difference: Information, Warning or Error. + Level *string `json:"level,omitempty"` + // SettingType - READ-ONLY; The type of the setting: General, AppSetting or ConnectionString. + SettingType *string `json:"settingType,omitempty"` + // DiffRule - READ-ONLY; Rule that describes how to process the setting difference during a slot swap. + DiffRule *string `json:"diffRule,omitempty"` + // SettingName - READ-ONLY; Name of the setting. + SettingName *string `json:"settingName,omitempty"` + // ValueInCurrentSlot - READ-ONLY; Value of the setting in the current slot. + ValueInCurrentSlot *string `json:"valueInCurrentSlot,omitempty"` + // ValueInTargetSlot - READ-ONLY; Value of the setting in the target slot. + ValueInTargetSlot *string `json:"valueInTargetSlot,omitempty"` + // Description - READ-ONLY; Description of the setting difference. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for SlotDifferenceProperties. +func (sd SlotDifferenceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SlotSwapStatus the status of the last successful slot swap operation. +type SlotSwapStatus struct { + // TimestampUtc - READ-ONLY; The time the last successful slot swap completed. + TimestampUtc *date.Time `json:"timestampUtc,omitempty"` + // SourceSlotName - READ-ONLY; The source slot of the last swap operation. + SourceSlotName *string `json:"sourceSlotName,omitempty"` + // DestinationSlotName - READ-ONLY; The destination slot of the last swap operation. + DestinationSlotName *string `json:"destinationSlotName,omitempty"` +} + +// MarshalJSON is the custom marshaler for SlotSwapStatus. +func (sss SlotSwapStatus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SlowRequestsBasedTrigger trigger based on request execution time. +type SlowRequestsBasedTrigger struct { + // TimeTaken - Time taken. + TimeTaken *string `json:"timeTaken,omitempty"` + // Path - Request Path. + Path *string `json:"path,omitempty"` + // Count - Request Count. + Count *int32 `json:"count,omitempty"` + // TimeInterval - Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` +} + +// Snapshot a snapshot of an app. +type Snapshot struct { + // SnapshotProperties - Snapshot resource specific properties + *SnapshotProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Snapshot. +func (s Snapshot) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SnapshotProperties != nil { + objectMap["properties"] = s.SnapshotProperties + } + if s.Kind != nil { + objectMap["kind"] = s.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Snapshot struct. +func (s *Snapshot) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var snapshotProperties SnapshotProperties + err = json.Unmarshal(*v, &snapshotProperties) + if err != nil { + return err + } + s.SnapshotProperties = &snapshotProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + s.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// SnapshotCollection collection of snapshots which can be used to revert an app to a previous time. +type SnapshotCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Snapshot `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotCollection. +func (sc SnapshotCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.Value != nil { + objectMap["value"] = sc.Value + } + return json.Marshal(objectMap) +} + +// SnapshotCollectionIterator provides access to a complete listing of Snapshot values. +type SnapshotCollectionIterator struct { + i int + page SnapshotCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SnapshotCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SnapshotCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SnapshotCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SnapshotCollectionIterator) Response() SnapshotCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SnapshotCollectionIterator) Value() Snapshot { + if !iter.page.NotDone() { + return Snapshot{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SnapshotCollectionIterator type. +func NewSnapshotCollectionIterator(page SnapshotCollectionPage) SnapshotCollectionIterator { + return SnapshotCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sc SnapshotCollection) IsEmpty() bool { + return sc.Value == nil || len(*sc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sc SnapshotCollection) hasNextLink() bool { + return sc.NextLink != nil && len(*sc.NextLink) != 0 +} + +// snapshotCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sc SnapshotCollection) snapshotCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !sc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sc.NextLink))) +} + +// SnapshotCollectionPage contains a page of Snapshot values. +type SnapshotCollectionPage struct { + fn func(context.Context, SnapshotCollection) (SnapshotCollection, error) + sc SnapshotCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SnapshotCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SnapshotCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sc) + if err != nil { + return err + } + page.sc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SnapshotCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SnapshotCollectionPage) NotDone() bool { + return !page.sc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SnapshotCollectionPage) Response() SnapshotCollection { + return page.sc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SnapshotCollectionPage) Values() []Snapshot { + if page.sc.IsEmpty() { + return nil + } + return *page.sc.Value +} + +// Creates a new instance of the SnapshotCollectionPage type. +func NewSnapshotCollectionPage(cur SnapshotCollection, getNextPage func(context.Context, SnapshotCollection) (SnapshotCollection, error)) SnapshotCollectionPage { + return SnapshotCollectionPage{ + fn: getNextPage, + sc: cur, + } +} + +// SnapshotProperties snapshot resource specific properties +type SnapshotProperties struct { + // Time - READ-ONLY; The time the snapshot was taken. + Time *string `json:"time,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotProperties. +func (s SnapshotProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SnapshotRecoverySource specifies the web app that snapshot contents will be retrieved from. +type SnapshotRecoverySource struct { + // Location - Geographical location of the source web app, e.g. SouthEastAsia, SouthCentralUS + Location *string `json:"location,omitempty"` + // ID - ARM resource ID of the source app. + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName} for production slots and + // /subscriptions/{subId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/slots/{slotName} for other slots. + ID *string `json:"id,omitempty"` +} + +// SnapshotRestoreRequest details about app recovery operation. +type SnapshotRestoreRequest struct { + // SnapshotRestoreRequestProperties - SnapshotRestoreRequest resource specific properties + *SnapshotRestoreRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SnapshotRestoreRequest. +func (srr SnapshotRestoreRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if srr.SnapshotRestoreRequestProperties != nil { + objectMap["properties"] = srr.SnapshotRestoreRequestProperties + } + if srr.Kind != nil { + objectMap["kind"] = srr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SnapshotRestoreRequest struct. +func (srr *SnapshotRestoreRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var snapshotRestoreRequestProperties SnapshotRestoreRequestProperties + err = json.Unmarshal(*v, &snapshotRestoreRequestProperties) + if err != nil { + return err + } + srr.SnapshotRestoreRequestProperties = &snapshotRestoreRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + srr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + srr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + srr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + srr.Type = &typeVar + } + } + } + + return nil +} + +// SnapshotRestoreRequestProperties snapshotRestoreRequest resource specific properties +type SnapshotRestoreRequestProperties struct { + // SnapshotTime - Point in time in which the app restore should be done, formatted as a DateTime string. + SnapshotTime *string `json:"snapshotTime,omitempty"` + // RecoverySource - Optional. Specifies the web app that snapshot contents will be retrieved from. + // If empty, the targeted web app will be used as the source. + RecoverySource *SnapshotRecoverySource `json:"recoverySource,omitempty"` + // Overwrite - If true the restore operation can overwrite source app; otherwise, false. + Overwrite *bool `json:"overwrite,omitempty"` + // RecoverConfiguration - If true, site configuration, in addition to content, will be reverted. + RecoverConfiguration *bool `json:"recoverConfiguration,omitempty"` + // IgnoreConflictingHostNames - If true, custom hostname conflicts will be ignored when recovering to a target web app. + // This setting is only necessary when RecoverConfiguration is enabled. + IgnoreConflictingHostNames *bool `json:"ignoreConflictingHostNames,omitempty"` + // UseDRSecondary - If true, the snapshot is retrieved from DRSecondary endpoint. + UseDRSecondary *bool `json:"useDRSecondary,omitempty"` +} + +// Solution class Representing Solution for problems detected. +type Solution struct { + // ID - Solution Id. + ID *float64 `json:"id,omitempty"` + // DisplayName - Display Name of the solution + DisplayName *string `json:"displayName,omitempty"` + // Order - Order of the solution. + Order *float64 `json:"order,omitempty"` + // Description - Description of the solution + Description *string `json:"description,omitempty"` + // Type - Type of Solution. Possible values include: 'SolutionTypeQuickSolution', 'SolutionTypeDeepInvestigation', 'SolutionTypeBestPractices' + Type SolutionType `json:"type,omitempty"` + // Data - Solution Data. + Data *[][]NameValuePair `json:"data,omitempty"` + // Metadata - Solution Metadata. + Metadata *[][]NameValuePair `json:"metadata,omitempty"` +} + +// SourceControl the source control OAuth token. +type SourceControl struct { + autorest.Response `json:"-"` + // SourceControlProperties - SourceControl resource specific properties + *SourceControlProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControl. +func (sc SourceControl) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sc.SourceControlProperties != nil { + objectMap["properties"] = sc.SourceControlProperties + } + if sc.Kind != nil { + objectMap["kind"] = sc.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SourceControl struct. +func (sc *SourceControl) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var sourceControlProperties SourceControlProperties + err = json.Unmarshal(*v, &sourceControlProperties) + if err != nil { + return err + } + sc.SourceControlProperties = &sourceControlProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sc.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sc.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sc.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sc.Type = &typeVar + } + } + } + + return nil +} + +// SourceControlCollection collection of source controls. +type SourceControlCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]SourceControl `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SourceControlCollection. +func (scc SourceControlCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scc.Value != nil { + objectMap["value"] = scc.Value + } + return json.Marshal(objectMap) +} + +// SourceControlCollectionIterator provides access to a complete listing of SourceControl values. +type SourceControlCollectionIterator struct { + i int + page SourceControlCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SourceControlCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SourceControlCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SourceControlCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SourceControlCollectionIterator) Response() SourceControlCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SourceControlCollectionIterator) Value() SourceControl { + if !iter.page.NotDone() { + return SourceControl{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SourceControlCollectionIterator type. +func NewSourceControlCollectionIterator(page SourceControlCollectionPage) SourceControlCollectionIterator { + return SourceControlCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc SourceControlCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc SourceControlCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// sourceControlCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc SourceControlCollection) sourceControlCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// SourceControlCollectionPage contains a page of SourceControl values. +type SourceControlCollectionPage struct { + fn func(context.Context, SourceControlCollection) (SourceControlCollection, error) + scc SourceControlCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SourceControlCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SourceControlCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SourceControlCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SourceControlCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SourceControlCollectionPage) Response() SourceControlCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SourceControlCollectionPage) Values() []SourceControl { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the SourceControlCollectionPage type. +func NewSourceControlCollectionPage(cur SourceControlCollection, getNextPage func(context.Context, SourceControlCollection) (SourceControlCollection, error)) SourceControlCollectionPage { + return SourceControlCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// SourceControlProperties sourceControl resource specific properties +type SourceControlProperties struct { + // Token - OAuth access token. + Token *string `json:"token,omitempty"` + // TokenSecret - OAuth access token secret. + TokenSecret *string `json:"tokenSecret,omitempty"` + // RefreshToken - OAuth refresh token. + RefreshToken *string `json:"refreshToken,omitempty"` + // ExpirationTime - OAuth token expiration. + ExpirationTime *date.Time `json:"expirationTime,omitempty"` +} + +// StackMajorVersion application stack major version. +type StackMajorVersion struct { + // DisplayVersion - Application stack major version (display only). + DisplayVersion *string `json:"displayVersion,omitempty"` + // RuntimeVersion - Application stack major version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // IsDefault - true if this is the default major version; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` + // MinorVersions - Minor versions associated with the major version. + MinorVersions *[]StackMinorVersion `json:"minorVersions,omitempty"` + // ApplicationInsights - true if this supports Application Insights; otherwise, false. + ApplicationInsights *bool `json:"applicationInsights,omitempty"` + // IsPreview - true if this stack is in Preview, otherwise false. + IsPreview *bool `json:"isPreview,omitempty"` + // IsDeprecated - true if this stack has been deprecated, otherwise false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + // IsHidden - true if this stack should be hidden for new customers on portal, otherwise false. + IsHidden *bool `json:"isHidden,omitempty"` + // AppSettingsDictionary - + // + // + // Example: All the function apps need AppSetting: "FUNCTIONS_WORKER_RUNTIME" to be set stack name + AppSettingsDictionary map[string]interface{} `json:"appSettingsDictionary"` + // SiteConfigPropertiesDictionary - + // + // + // Example: All Linux Function Apps, need Use32BitWorkerProcess to be set to 0 + SiteConfigPropertiesDictionary map[string]interface{} `json:"siteConfigPropertiesDictionary"` +} + +// MarshalJSON is the custom marshaler for StackMajorVersion. +func (smv StackMajorVersion) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smv.DisplayVersion != nil { + objectMap["displayVersion"] = smv.DisplayVersion + } + if smv.RuntimeVersion != nil { + objectMap["runtimeVersion"] = smv.RuntimeVersion + } + if smv.IsDefault != nil { + objectMap["isDefault"] = smv.IsDefault + } + if smv.MinorVersions != nil { + objectMap["minorVersions"] = smv.MinorVersions + } + if smv.ApplicationInsights != nil { + objectMap["applicationInsights"] = smv.ApplicationInsights + } + if smv.IsPreview != nil { + objectMap["isPreview"] = smv.IsPreview + } + if smv.IsDeprecated != nil { + objectMap["isDeprecated"] = smv.IsDeprecated + } + if smv.IsHidden != nil { + objectMap["isHidden"] = smv.IsHidden + } + if smv.AppSettingsDictionary != nil { + objectMap["appSettingsDictionary"] = smv.AppSettingsDictionary + } + if smv.SiteConfigPropertiesDictionary != nil { + objectMap["siteConfigPropertiesDictionary"] = smv.SiteConfigPropertiesDictionary + } + return json.Marshal(objectMap) +} + +// StackMinorVersion application stack minor version. +type StackMinorVersion struct { + // DisplayVersion - Application stack minor version (display only). + DisplayVersion *string `json:"displayVersion,omitempty"` + // RuntimeVersion - Application stack minor version (runtime only). + RuntimeVersion *string `json:"runtimeVersion,omitempty"` + // IsDefault - true if this is the default minor version; otherwise, false. + IsDefault *bool `json:"isDefault,omitempty"` + // IsRemoteDebuggingEnabled - true if this supports Remote Debugging, otherwise false. + IsRemoteDebuggingEnabled *bool `json:"isRemoteDebuggingEnabled,omitempty"` +} + +// StampCapacity stamp capacity information. +type StampCapacity struct { + // Name - Name of the stamp. + Name *string `json:"name,omitempty"` + // AvailableCapacity - Available capacity (# of machines, bytes of storage etc...). + AvailableCapacity *int64 `json:"availableCapacity,omitempty"` + // TotalCapacity - Total capacity (# of machines, bytes of storage etc...). + TotalCapacity *int64 `json:"totalCapacity,omitempty"` + // Unit - Name of the unit. + Unit *string `json:"unit,omitempty"` + // ComputeMode - Shared/dedicated workers. Possible values include: 'ComputeModeOptionsShared', 'ComputeModeOptionsDedicated', 'ComputeModeOptionsDynamic' + ComputeMode ComputeModeOptions `json:"computeMode,omitempty"` + // WorkerSize - Size of the machines. Possible values include: 'WorkerSizeOptionsSmall', 'WorkerSizeOptionsMedium', 'WorkerSizeOptionsLarge', 'WorkerSizeOptionsD1', 'WorkerSizeOptionsD2', 'WorkerSizeOptionsD3', 'WorkerSizeOptionsSmallV3', 'WorkerSizeOptionsMediumV3', 'WorkerSizeOptionsLargeV3', 'WorkerSizeOptionsNestedSmall', 'WorkerSizeOptionsNestedSmallLinux', 'WorkerSizeOptionsDefault' + WorkerSize WorkerSizeOptions `json:"workerSize,omitempty"` + // WorkerSizeID - Size ID of machines: + // 0 - Small + // 1 - Medium + // 2 - Large + WorkerSizeID *int32 `json:"workerSizeId,omitempty"` + // ExcludeFromCapacityAllocation - If true, it includes basic apps. + // Basic apps are not used for capacity allocation. + ExcludeFromCapacityAllocation *bool `json:"excludeFromCapacityAllocation,omitempty"` + // IsApplicableForAllComputeModes - true if capacity is applicable for all apps; otherwise, false. + IsApplicableForAllComputeModes *bool `json:"isApplicableForAllComputeModes,omitempty"` + // SiteMode - Shared or Dedicated. + SiteMode *string `json:"siteMode,omitempty"` + // IsLinux - Is this a linux stamp capacity + IsLinux *bool `json:"isLinux,omitempty"` +} + +// StampCapacityCollection collection of stamp capacities. +type StampCapacityCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StampCapacity `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StampCapacityCollection. +func (scc StampCapacityCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if scc.Value != nil { + objectMap["value"] = scc.Value + } + return json.Marshal(objectMap) +} + +// StampCapacityCollectionIterator provides access to a complete listing of StampCapacity values. +type StampCapacityCollectionIterator struct { + i int + page StampCapacityCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StampCapacityCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StampCapacityCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StampCapacityCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StampCapacityCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StampCapacityCollectionIterator) Response() StampCapacityCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StampCapacityCollectionIterator) Value() StampCapacity { + if !iter.page.NotDone() { + return StampCapacity{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StampCapacityCollectionIterator type. +func NewStampCapacityCollectionIterator(page StampCapacityCollectionPage) StampCapacityCollectionIterator { + return StampCapacityCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (scc StampCapacityCollection) IsEmpty() bool { + return scc.Value == nil || len(*scc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (scc StampCapacityCollection) hasNextLink() bool { + return scc.NextLink != nil && len(*scc.NextLink) != 0 +} + +// stampCapacityCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (scc StampCapacityCollection) stampCapacityCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !scc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(scc.NextLink))) +} + +// StampCapacityCollectionPage contains a page of StampCapacity values. +type StampCapacityCollectionPage struct { + fn func(context.Context, StampCapacityCollection) (StampCapacityCollection, error) + scc StampCapacityCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StampCapacityCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StampCapacityCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.scc) + if err != nil { + return err + } + page.scc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StampCapacityCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StampCapacityCollectionPage) NotDone() bool { + return !page.scc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StampCapacityCollectionPage) Response() StampCapacityCollection { + return page.scc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StampCapacityCollectionPage) Values() []StampCapacity { + if page.scc.IsEmpty() { + return nil + } + return *page.scc.Value +} + +// Creates a new instance of the StampCapacityCollectionPage type. +func NewStampCapacityCollectionPage(cur StampCapacityCollection, getNextPage func(context.Context, StampCapacityCollection) (StampCapacityCollection, error)) StampCapacityCollectionPage { + return StampCapacityCollectionPage{ + fn: getNextPage, + scc: cur, + } +} + +// StaticSite a static site. +type StaticSite struct { + // DefaultHostname - READ-ONLY; The default autogenerated hostname for the static site. + DefaultHostname *string `json:"defaultHostname,omitempty"` + // RepositoryURL - URL for the repository of the static site. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The target branch in the repository. + Branch *string `json:"branch,omitempty"` + // CustomDomains - READ-ONLY; The custom domains associated with this static site. + CustomDomains *[]string `json:"customDomains,omitempty"` + // RepositoryToken - A user's github repository token. This is used to setup the Github Actions workflow file and API secrets. + RepositoryToken *string `json:"repositoryToken,omitempty"` + // BuildProperties - Build properties to configure on the repository. + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` + // PrivateEndpointConnections - READ-ONLY; Private endpoint connections + PrivateEndpointConnections *[]ResponseMessageEnvelopeRemotePrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // StagingEnvironmentPolicy - State indicating whether staging environments are allowed or not allowed for a static web app. Possible values include: 'StagingEnvironmentPolicyEnabled', 'StagingEnvironmentPolicyDisabled' + StagingEnvironmentPolicy StagingEnvironmentPolicy `json:"stagingEnvironmentPolicy,omitempty"` + // AllowConfigFileUpdates - false if config file is locked for this static web app; otherwise, true. + AllowConfigFileUpdates *bool `json:"allowConfigFileUpdates,omitempty"` + // TemplateProperties - Template options for generating a new repository. + TemplateProperties *StaticSiteTemplateOptions `json:"templateProperties,omitempty"` + // ContentDistributionEndpoint - READ-ONLY; The content distribution endpoint for the static site. + ContentDistributionEndpoint *string `json:"contentDistributionEndpoint,omitempty"` + // KeyVaultReferenceIdentity - READ-ONLY; Identity to use for Key Vault Reference authentication. + KeyVaultReferenceIdentity *string `json:"keyVaultReferenceIdentity,omitempty"` + // UserProvidedFunctionApps - READ-ONLY; User provided function apps registered with the static site + UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` + // Provider - The provider that submitted the last deployment to the primary environment of the static site. + Provider *string `json:"provider,omitempty"` + // EnterpriseGradeCdnStatus - State indicating the status of the enterprise grade CDN serving traffic to the static web app. Possible values include: 'EnterpriseGradeCdnStatusEnabled', 'EnterpriseGradeCdnStatusEnabling', 'EnterpriseGradeCdnStatusDisabled', 'EnterpriseGradeCdnStatusDisabling' + EnterpriseGradeCdnStatus EnterpriseGradeCdnStatus `json:"enterpriseGradeCdnStatus,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSite. +func (ss StaticSite) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ss.RepositoryURL != nil { + objectMap["repositoryUrl"] = ss.RepositoryURL + } + if ss.Branch != nil { + objectMap["branch"] = ss.Branch + } + if ss.RepositoryToken != nil { + objectMap["repositoryToken"] = ss.RepositoryToken + } + if ss.BuildProperties != nil { + objectMap["buildProperties"] = ss.BuildProperties + } + if ss.StagingEnvironmentPolicy != "" { + objectMap["stagingEnvironmentPolicy"] = ss.StagingEnvironmentPolicy + } + if ss.AllowConfigFileUpdates != nil { + objectMap["allowConfigFileUpdates"] = ss.AllowConfigFileUpdates + } + if ss.TemplateProperties != nil { + objectMap["templateProperties"] = ss.TemplateProperties + } + if ss.Provider != nil { + objectMap["provider"] = ss.Provider + } + if ss.EnterpriseGradeCdnStatus != "" { + objectMap["enterpriseGradeCdnStatus"] = ss.EnterpriseGradeCdnStatus + } + return json.Marshal(objectMap) +} + +// StaticSiteARMResource static Site ARM resource. +type StaticSiteARMResource struct { + autorest.Response `json:"-"` + // StaticSite - Core resource properties + *StaticSite `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + Identity *ManagedServiceIdentity `json:"identity,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Location - Resource Location. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for StaticSiteARMResource. +func (ssar StaticSiteARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssar.StaticSite != nil { + objectMap["properties"] = ssar.StaticSite + } + if ssar.Sku != nil { + objectMap["sku"] = ssar.Sku + } + if ssar.Identity != nil { + objectMap["identity"] = ssar.Identity + } + if ssar.Kind != nil { + objectMap["kind"] = ssar.Kind + } + if ssar.Location != nil { + objectMap["location"] = ssar.Location + } + if ssar.Tags != nil { + objectMap["tags"] = ssar.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteARMResource struct. +func (ssar *StaticSiteARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSite StaticSite + err = json.Unmarshal(*v, &staticSite) + if err != nil { + return err + } + ssar.StaticSite = &staticSite + } + case "sku": + if v != nil { + var sku SkuDescription + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + ssar.Sku = &sku + } + case "identity": + if v != nil { + var identity ManagedServiceIdentity + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + ssar.Identity = &identity + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssar.Kind = &kind + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ssar.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssar.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ssar.Tags = tags + } + } + } + + return nil +} + +// StaticSiteBuildARMResource static Site Build ARM resource. +type StaticSiteBuildARMResource struct { + autorest.Response `json:"-"` + // StaticSiteBuildARMResourceProperties - StaticSiteBuildARMResource resource specific properties + *StaticSiteBuildARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteBuildARMResource. +func (ssbar StaticSiteBuildARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssbar.StaticSiteBuildARMResourceProperties != nil { + objectMap["properties"] = ssbar.StaticSiteBuildARMResourceProperties + } + if ssbar.Kind != nil { + objectMap["kind"] = ssbar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteBuildARMResource struct. +func (ssbar *StaticSiteBuildARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteBuildARMResourceProperties StaticSiteBuildARMResourceProperties + err = json.Unmarshal(*v, &staticSiteBuildARMResourceProperties) + if err != nil { + return err + } + ssbar.StaticSiteBuildARMResourceProperties = &staticSiteBuildARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssbar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssbar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssbar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssbar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteBuildARMResourceProperties staticSiteBuildARMResource resource specific properties +type StaticSiteBuildARMResourceProperties struct { + // BuildID - READ-ONLY; An identifier for the static site build. + BuildID *string `json:"buildId,omitempty"` + // SourceBranch - READ-ONLY; The source branch. + SourceBranch *string `json:"sourceBranch,omitempty"` + // PullRequestTitle - READ-ONLY; The title of a pull request that a static site build is related to. + PullRequestTitle *string `json:"pullRequestTitle,omitempty"` + // Hostname - READ-ONLY; The hostname for a static site build. + Hostname *string `json:"hostname,omitempty"` + // CreatedTimeUtc - READ-ONLY; When this build was created. + CreatedTimeUtc *date.Time `json:"createdTimeUtc,omitempty"` + // LastUpdatedOn - READ-ONLY; When this build was updated. + LastUpdatedOn *date.Time `json:"lastUpdatedOn,omitempty"` + // Status - READ-ONLY; The status of the static site build. Possible values include: 'BuildStatusWaitingForDeployment', 'BuildStatusUploading', 'BuildStatusDeploying', 'BuildStatusReady', 'BuildStatusFailed', 'BuildStatusDeleting', 'BuildStatusDetached' + Status BuildStatus `json:"status,omitempty"` + // UserProvidedFunctionApps - READ-ONLY; User provided function apps registered with the static site build + UserProvidedFunctionApps *[]StaticSiteUserProvidedFunctionApp `json:"userProvidedFunctionApps,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteBuildARMResourceProperties. +func (ssbar StaticSiteBuildARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StaticSiteBuildCollection collection of static site builds. +type StaticSiteBuildCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteBuildARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteBuildCollection. +func (ssbc StaticSiteBuildCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssbc.Value != nil { + objectMap["value"] = ssbc.Value + } + return json.Marshal(objectMap) +} + +// StaticSiteBuildCollectionIterator provides access to a complete listing of StaticSiteBuildARMResource +// values. +type StaticSiteBuildCollectionIterator struct { + i int + page StaticSiteBuildCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticSiteBuildCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteBuildCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticSiteBuildCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteBuildCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StaticSiteBuildCollectionIterator) Response() StaticSiteBuildCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StaticSiteBuildCollectionIterator) Value() StaticSiteBuildARMResource { + if !iter.page.NotDone() { + return StaticSiteBuildARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteBuildCollectionIterator type. +func NewStaticSiteBuildCollectionIterator(page StaticSiteBuildCollectionPage) StaticSiteBuildCollectionIterator { + return StaticSiteBuildCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssbc StaticSiteBuildCollection) IsEmpty() bool { + return ssbc.Value == nil || len(*ssbc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ssbc StaticSiteBuildCollection) hasNextLink() bool { + return ssbc.NextLink != nil && len(*ssbc.NextLink) != 0 +} + +// staticSiteBuildCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssbc StaticSiteBuildCollection) staticSiteBuildCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ssbc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssbc.NextLink))) +} + +// StaticSiteBuildCollectionPage contains a page of StaticSiteBuildARMResource values. +type StaticSiteBuildCollectionPage struct { + fn func(context.Context, StaticSiteBuildCollection) (StaticSiteBuildCollection, error) + ssbc StaticSiteBuildCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StaticSiteBuildCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteBuildCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ssbc) + if err != nil { + return err + } + page.ssbc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StaticSiteBuildCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteBuildCollectionPage) NotDone() bool { + return !page.ssbc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteBuildCollectionPage) Response() StaticSiteBuildCollection { + return page.ssbc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteBuildCollectionPage) Values() []StaticSiteBuildARMResource { + if page.ssbc.IsEmpty() { + return nil + } + return *page.ssbc.Value +} + +// Creates a new instance of the StaticSiteBuildCollectionPage type. +func NewStaticSiteBuildCollectionPage(cur StaticSiteBuildCollection, getNextPage func(context.Context, StaticSiteBuildCollection) (StaticSiteBuildCollection, error)) StaticSiteBuildCollectionPage { + return StaticSiteBuildCollectionPage{ + fn: getNextPage, + ssbc: cur, + } +} + +// StaticSiteBuildProperties build properties for the static site. +type StaticSiteBuildProperties struct { + // AppLocation - The path to the app code within the repository. + AppLocation *string `json:"appLocation,omitempty"` + // APILocation - The path to the api code within the repository. + APILocation *string `json:"apiLocation,omitempty"` + // AppArtifactLocation - Deprecated: The path of the app artifacts after building (deprecated in favor of OutputLocation) + AppArtifactLocation *string `json:"appArtifactLocation,omitempty"` + // OutputLocation - The output path of the app after building. + OutputLocation *string `json:"outputLocation,omitempty"` + // AppBuildCommand - A custom command to run during deployment of the static content application. + AppBuildCommand *string `json:"appBuildCommand,omitempty"` + // APIBuildCommand - A custom command to run during deployment of the Azure Functions API application. + APIBuildCommand *string `json:"apiBuildCommand,omitempty"` + // SkipGithubActionWorkflowGeneration - Skip Github Action workflow generation. + SkipGithubActionWorkflowGeneration *bool `json:"skipGithubActionWorkflowGeneration,omitempty"` + // GithubActionSecretNameOverride - Github Action secret name override. + GithubActionSecretNameOverride *string `json:"githubActionSecretNameOverride,omitempty"` +} + +// StaticSiteCollection collection of static sites. +type StaticSiteCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteCollection. +func (ssc StaticSiteCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssc.Value != nil { + objectMap["value"] = ssc.Value + } + return json.Marshal(objectMap) +} + +// StaticSiteCollectionIterator provides access to a complete listing of StaticSiteARMResource values. +type StaticSiteCollectionIterator struct { + i int + page StaticSiteCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticSiteCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticSiteCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StaticSiteCollectionIterator) Response() StaticSiteCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StaticSiteCollectionIterator) Value() StaticSiteARMResource { + if !iter.page.NotDone() { + return StaticSiteARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteCollectionIterator type. +func NewStaticSiteCollectionIterator(page StaticSiteCollectionPage) StaticSiteCollectionIterator { + return StaticSiteCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssc StaticSiteCollection) IsEmpty() bool { + return ssc.Value == nil || len(*ssc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ssc StaticSiteCollection) hasNextLink() bool { + return ssc.NextLink != nil && len(*ssc.NextLink) != 0 +} + +// staticSiteCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssc StaticSiteCollection) staticSiteCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ssc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssc.NextLink))) +} + +// StaticSiteCollectionPage contains a page of StaticSiteARMResource values. +type StaticSiteCollectionPage struct { + fn func(context.Context, StaticSiteCollection) (StaticSiteCollection, error) + ssc StaticSiteCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StaticSiteCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ssc) + if err != nil { + return err + } + page.ssc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StaticSiteCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteCollectionPage) NotDone() bool { + return !page.ssc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteCollectionPage) Response() StaticSiteCollection { + return page.ssc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteCollectionPage) Values() []StaticSiteARMResource { + if page.ssc.IsEmpty() { + return nil + } + return *page.ssc.Value +} + +// Creates a new instance of the StaticSiteCollectionPage type. +func NewStaticSiteCollectionPage(cur StaticSiteCollection, getNextPage func(context.Context, StaticSiteCollection) (StaticSiteCollection, error)) StaticSiteCollectionPage { + return StaticSiteCollectionPage{ + fn: getNextPage, + ssc: cur, + } +} + +// StaticSiteCustomDomainOverviewARMResource static Site Custom Domain Overview ARM resource. +type StaticSiteCustomDomainOverviewARMResource struct { + autorest.Response `json:"-"` + // StaticSiteCustomDomainOverviewARMResourceProperties - StaticSiteCustomDomainOverviewARMResource resource specific properties + *StaticSiteCustomDomainOverviewARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteCustomDomainOverviewARMResource. +func (sscdoar StaticSiteCustomDomainOverviewARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdoar.StaticSiteCustomDomainOverviewARMResourceProperties != nil { + objectMap["properties"] = sscdoar.StaticSiteCustomDomainOverviewARMResourceProperties + } + if sscdoar.Kind != nil { + objectMap["kind"] = sscdoar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteCustomDomainOverviewARMResource struct. +func (sscdoar *StaticSiteCustomDomainOverviewARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteCustomDomainOverviewARMResourceProperties StaticSiteCustomDomainOverviewARMResourceProperties + err = json.Unmarshal(*v, &staticSiteCustomDomainOverviewARMResourceProperties) + if err != nil { + return err + } + sscdoar.StaticSiteCustomDomainOverviewARMResourceProperties = &staticSiteCustomDomainOverviewARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdoar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdoar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sscdoar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdoar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteCustomDomainOverviewARMResourceProperties staticSiteCustomDomainOverviewARMResource resource +// specific properties +type StaticSiteCustomDomainOverviewARMResourceProperties struct { + // DomainName - READ-ONLY; The domain name for the static site custom domain. + DomainName *string `json:"domainName,omitempty"` + // CreatedOn - READ-ONLY; The date and time on which the custom domain was created for the static site. + CreatedOn *date.Time `json:"createdOn,omitempty"` + // Status - READ-ONLY; The status of the custom domain. Possible values include: 'CustomDomainStatusRetrievingValidationToken', 'CustomDomainStatusValidating', 'CustomDomainStatusAdding', 'CustomDomainStatusReady', 'CustomDomainStatusFailed', 'CustomDomainStatusDeleting' + Status CustomDomainStatus `json:"status,omitempty"` + // ValidationToken - READ-ONLY; The TXT record validation token + ValidationToken *string `json:"validationToken,omitempty"` + // ErrorMessage - READ-ONLY + ErrorMessage *string `json:"errorMessage,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteCustomDomainOverviewARMResourceProperties. +func (sscdoar StaticSiteCustomDomainOverviewARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StaticSiteCustomDomainOverviewCollection collection of static site custom domains. +type StaticSiteCustomDomainOverviewCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteCustomDomainOverviewARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteCustomDomainOverviewCollection. +func (sscdoc StaticSiteCustomDomainOverviewCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdoc.Value != nil { + objectMap["value"] = sscdoc.Value + } + return json.Marshal(objectMap) +} + +// StaticSiteCustomDomainOverviewCollectionIterator provides access to a complete listing of +// StaticSiteCustomDomainOverviewARMResource values. +type StaticSiteCustomDomainOverviewCollectionIterator struct { + i int + page StaticSiteCustomDomainOverviewCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticSiteCustomDomainOverviewCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCustomDomainOverviewCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticSiteCustomDomainOverviewCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteCustomDomainOverviewCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StaticSiteCustomDomainOverviewCollectionIterator) Response() StaticSiteCustomDomainOverviewCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StaticSiteCustomDomainOverviewCollectionIterator) Value() StaticSiteCustomDomainOverviewARMResource { + if !iter.page.NotDone() { + return StaticSiteCustomDomainOverviewARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteCustomDomainOverviewCollectionIterator type. +func NewStaticSiteCustomDomainOverviewCollectionIterator(page StaticSiteCustomDomainOverviewCollectionPage) StaticSiteCustomDomainOverviewCollectionIterator { + return StaticSiteCustomDomainOverviewCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sscdoc StaticSiteCustomDomainOverviewCollection) IsEmpty() bool { + return sscdoc.Value == nil || len(*sscdoc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sscdoc StaticSiteCustomDomainOverviewCollection) hasNextLink() bool { + return sscdoc.NextLink != nil && len(*sscdoc.NextLink) != 0 +} + +// staticSiteCustomDomainOverviewCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sscdoc StaticSiteCustomDomainOverviewCollection) staticSiteCustomDomainOverviewCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !sscdoc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sscdoc.NextLink))) +} + +// StaticSiteCustomDomainOverviewCollectionPage contains a page of +// StaticSiteCustomDomainOverviewARMResource values. +type StaticSiteCustomDomainOverviewCollectionPage struct { + fn func(context.Context, StaticSiteCustomDomainOverviewCollection) (StaticSiteCustomDomainOverviewCollection, error) + sscdoc StaticSiteCustomDomainOverviewCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StaticSiteCustomDomainOverviewCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteCustomDomainOverviewCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sscdoc) + if err != nil { + return err + } + page.sscdoc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StaticSiteCustomDomainOverviewCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteCustomDomainOverviewCollectionPage) NotDone() bool { + return !page.sscdoc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteCustomDomainOverviewCollectionPage) Response() StaticSiteCustomDomainOverviewCollection { + return page.sscdoc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteCustomDomainOverviewCollectionPage) Values() []StaticSiteCustomDomainOverviewARMResource { + if page.sscdoc.IsEmpty() { + return nil + } + return *page.sscdoc.Value +} + +// Creates a new instance of the StaticSiteCustomDomainOverviewCollectionPage type. +func NewStaticSiteCustomDomainOverviewCollectionPage(cur StaticSiteCustomDomainOverviewCollection, getNextPage func(context.Context, StaticSiteCustomDomainOverviewCollection) (StaticSiteCustomDomainOverviewCollection, error)) StaticSiteCustomDomainOverviewCollectionPage { + return StaticSiteCustomDomainOverviewCollectionPage{ + fn: getNextPage, + sscdoc: cur, + } +} + +// StaticSiteCustomDomainRequestPropertiesARMResource static Site Custom Domain Request Properties ARM +// resource. +type StaticSiteCustomDomainRequestPropertiesARMResource struct { + // StaticSiteCustomDomainRequestPropertiesARMResourceProperties - StaticSiteCustomDomainRequestPropertiesARMResource resource specific properties + *StaticSiteCustomDomainRequestPropertiesARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteCustomDomainRequestPropertiesARMResource. +func (sscdrpar StaticSiteCustomDomainRequestPropertiesARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sscdrpar.StaticSiteCustomDomainRequestPropertiesARMResourceProperties != nil { + objectMap["properties"] = sscdrpar.StaticSiteCustomDomainRequestPropertiesARMResourceProperties + } + if sscdrpar.Kind != nil { + objectMap["kind"] = sscdrpar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteCustomDomainRequestPropertiesARMResource struct. +func (sscdrpar *StaticSiteCustomDomainRequestPropertiesARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteCustomDomainRequestPropertiesARMResourceProperties StaticSiteCustomDomainRequestPropertiesARMResourceProperties + err = json.Unmarshal(*v, &staticSiteCustomDomainRequestPropertiesARMResourceProperties) + if err != nil { + return err + } + sscdrpar.StaticSiteCustomDomainRequestPropertiesARMResourceProperties = &staticSiteCustomDomainRequestPropertiesARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sscdrpar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sscdrpar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sscdrpar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sscdrpar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteCustomDomainRequestPropertiesARMResourceProperties +// staticSiteCustomDomainRequestPropertiesARMResource resource specific properties +type StaticSiteCustomDomainRequestPropertiesARMResourceProperties struct { + // ValidationMethod - Validation method for adding a custom domain + ValidationMethod *string `json:"validationMethod,omitempty"` +} + +// StaticSiteFunctionOverviewARMResource static Site Function Overview ARM resource. +type StaticSiteFunctionOverviewARMResource struct { + // StaticSiteFunctionOverviewARMResourceProperties - StaticSiteFunctionOverviewARMResource resource specific properties + *StaticSiteFunctionOverviewARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteFunctionOverviewARMResource. +func (ssfoar StaticSiteFunctionOverviewARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssfoar.StaticSiteFunctionOverviewARMResourceProperties != nil { + objectMap["properties"] = ssfoar.StaticSiteFunctionOverviewARMResourceProperties + } + if ssfoar.Kind != nil { + objectMap["kind"] = ssfoar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteFunctionOverviewARMResource struct. +func (ssfoar *StaticSiteFunctionOverviewARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteFunctionOverviewARMResourceProperties StaticSiteFunctionOverviewARMResourceProperties + err = json.Unmarshal(*v, &staticSiteFunctionOverviewARMResourceProperties) + if err != nil { + return err + } + ssfoar.StaticSiteFunctionOverviewARMResourceProperties = &staticSiteFunctionOverviewARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssfoar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssfoar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssfoar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssfoar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteFunctionOverviewARMResourceProperties staticSiteFunctionOverviewARMResource resource specific +// properties +type StaticSiteFunctionOverviewARMResourceProperties struct { + // FunctionName - READ-ONLY; The name for the function + FunctionName *string `json:"functionName,omitempty"` + // TriggerType - READ-ONLY; The trigger type of the function. Possible values include: 'TriggerTypesHTTPTrigger', 'TriggerTypesUnknown' + TriggerType TriggerTypes `json:"triggerType,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteFunctionOverviewARMResourceProperties. +func (ssfoar StaticSiteFunctionOverviewARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StaticSiteFunctionOverviewCollection collection of static site functions. +type StaticSiteFunctionOverviewCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteFunctionOverviewARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteFunctionOverviewCollection. +func (ssfoc StaticSiteFunctionOverviewCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssfoc.Value != nil { + objectMap["value"] = ssfoc.Value + } + return json.Marshal(objectMap) +} + +// StaticSiteFunctionOverviewCollectionIterator provides access to a complete listing of +// StaticSiteFunctionOverviewARMResource values. +type StaticSiteFunctionOverviewCollectionIterator struct { + i int + page StaticSiteFunctionOverviewCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticSiteFunctionOverviewCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteFunctionOverviewCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticSiteFunctionOverviewCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteFunctionOverviewCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StaticSiteFunctionOverviewCollectionIterator) Response() StaticSiteFunctionOverviewCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StaticSiteFunctionOverviewCollectionIterator) Value() StaticSiteFunctionOverviewARMResource { + if !iter.page.NotDone() { + return StaticSiteFunctionOverviewARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteFunctionOverviewCollectionIterator type. +func NewStaticSiteFunctionOverviewCollectionIterator(page StaticSiteFunctionOverviewCollectionPage) StaticSiteFunctionOverviewCollectionIterator { + return StaticSiteFunctionOverviewCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssfoc StaticSiteFunctionOverviewCollection) IsEmpty() bool { + return ssfoc.Value == nil || len(*ssfoc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ssfoc StaticSiteFunctionOverviewCollection) hasNextLink() bool { + return ssfoc.NextLink != nil && len(*ssfoc.NextLink) != 0 +} + +// staticSiteFunctionOverviewCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssfoc StaticSiteFunctionOverviewCollection) staticSiteFunctionOverviewCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ssfoc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssfoc.NextLink))) +} + +// StaticSiteFunctionOverviewCollectionPage contains a page of StaticSiteFunctionOverviewARMResource +// values. +type StaticSiteFunctionOverviewCollectionPage struct { + fn func(context.Context, StaticSiteFunctionOverviewCollection) (StaticSiteFunctionOverviewCollection, error) + ssfoc StaticSiteFunctionOverviewCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StaticSiteFunctionOverviewCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteFunctionOverviewCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ssfoc) + if err != nil { + return err + } + page.ssfoc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StaticSiteFunctionOverviewCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteFunctionOverviewCollectionPage) NotDone() bool { + return !page.ssfoc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteFunctionOverviewCollectionPage) Response() StaticSiteFunctionOverviewCollection { + return page.ssfoc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteFunctionOverviewCollectionPage) Values() []StaticSiteFunctionOverviewARMResource { + if page.ssfoc.IsEmpty() { + return nil + } + return *page.ssfoc.Value +} + +// Creates a new instance of the StaticSiteFunctionOverviewCollectionPage type. +func NewStaticSiteFunctionOverviewCollectionPage(cur StaticSiteFunctionOverviewCollection, getNextPage func(context.Context, StaticSiteFunctionOverviewCollection) (StaticSiteFunctionOverviewCollection, error)) StaticSiteFunctionOverviewCollectionPage { + return StaticSiteFunctionOverviewCollectionPage{ + fn: getNextPage, + ssfoc: cur, + } +} + +// StaticSitePatchResource ARM resource for a static site when patching +type StaticSitePatchResource struct { + // StaticSite - Core resource properties + *StaticSite `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSitePatchResource. +func (sspr StaticSitePatchResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sspr.StaticSite != nil { + objectMap["properties"] = sspr.StaticSite + } + if sspr.Kind != nil { + objectMap["kind"] = sspr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSitePatchResource struct. +func (sspr *StaticSitePatchResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSite StaticSite + err = json.Unmarshal(*v, &staticSite) + if err != nil { + return err + } + sspr.StaticSite = &staticSite + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sspr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sspr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sspr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sspr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteResetPropertiesARMResource static Site Reset Properties ARM resource. +type StaticSiteResetPropertiesARMResource struct { + // StaticSiteResetPropertiesARMResourceProperties - StaticSiteResetPropertiesARMResource resource specific properties + *StaticSiteResetPropertiesARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteResetPropertiesARMResource. +func (ssrpar StaticSiteResetPropertiesARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssrpar.StaticSiteResetPropertiesARMResourceProperties != nil { + objectMap["properties"] = ssrpar.StaticSiteResetPropertiesARMResourceProperties + } + if ssrpar.Kind != nil { + objectMap["kind"] = ssrpar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteResetPropertiesARMResource struct. +func (ssrpar *StaticSiteResetPropertiesARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteResetPropertiesARMResourceProperties StaticSiteResetPropertiesARMResourceProperties + err = json.Unmarshal(*v, &staticSiteResetPropertiesARMResourceProperties) + if err != nil { + return err + } + ssrpar.StaticSiteResetPropertiesARMResourceProperties = &staticSiteResetPropertiesARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssrpar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssrpar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssrpar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssrpar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteResetPropertiesARMResourceProperties staticSiteResetPropertiesARMResource resource specific +// properties +type StaticSiteResetPropertiesARMResourceProperties struct { + // RepositoryToken - The token which proves admin privileges to the repository. + RepositoryToken *string `json:"repositoryToken,omitempty"` + // ShouldUpdateRepository - Determines whether the repository should be updated with the new properties. + ShouldUpdateRepository *bool `json:"shouldUpdateRepository,omitempty"` +} + +// StaticSitesApproveOrRejectPrivateEndpointConnectionFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type StaticSitesApproveOrRejectPrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (RemotePrivateEndpointConnectionARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesApproveOrRejectPrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesApproveOrRejectPrivateEndpointConnectionFuture.Result. +func (future *StaticSitesApproveOrRejectPrivateEndpointConnectionFuture) result(client StaticSitesClient) (rpecar RemotePrivateEndpointConnectionARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesApproveOrRejectPrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + rpecar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesApproveOrRejectPrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if rpecar.Response.Response, err = future.GetResult(sender); err == nil && rpecar.Response.Response.StatusCode != http.StatusNoContent { + rpecar, err = client.ApproveOrRejectPrivateEndpointConnectionResponder(rpecar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesApproveOrRejectPrivateEndpointConnectionFuture", "Result", rpecar.Response.Response, "Failure responding to request") + } + } + return +} + +// StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (StaticSiteCustomDomainOverviewARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture.Result. +func (future *StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture) result(client StaticSitesClient) (sscdoar StaticSiteCustomDomainOverviewARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + sscdoar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if sscdoar.Response.Response, err = future.GetResult(sender); err == nil && sscdoar.Response.Response.StatusCode != http.StatusNoContent { + sscdoar, err = client.CreateOrUpdateStaticSiteCustomDomainResponder(sscdoar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture", "Result", sscdoar.Response.Response, "Failure responding to request") + } + } + return +} + +// StaticSitesCreateOrUpdateStaticSiteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StaticSitesCreateOrUpdateStaticSiteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (StaticSiteARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesCreateOrUpdateStaticSiteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesCreateOrUpdateStaticSiteFuture.Result. +func (future *StaticSitesCreateOrUpdateStaticSiteFuture) result(client StaticSitesClient) (ssar StaticSiteARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesCreateOrUpdateStaticSiteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ssar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesCreateOrUpdateStaticSiteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssar.Response.Response, err = future.GetResult(sender); err == nil && ssar.Response.Response.StatusCode != http.StatusNoContent { + ssar, err = client.CreateOrUpdateStaticSiteResponder(ssar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesCreateOrUpdateStaticSiteFuture", "Result", ssar.Response.Response, "Failure responding to request") + } + } + return +} + +// StaticSitesCreateZipDeploymentForStaticSiteBuildFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type StaticSitesCreateZipDeploymentForStaticSiteBuildFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesCreateZipDeploymentForStaticSiteBuildFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesCreateZipDeploymentForStaticSiteBuildFuture.Result. +func (future *StaticSitesCreateZipDeploymentForStaticSiteBuildFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesCreateZipDeploymentForStaticSiteBuildFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesCreateZipDeploymentForStaticSiteBuildFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesCreateZipDeploymentForStaticSiteFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type StaticSitesCreateZipDeploymentForStaticSiteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesCreateZipDeploymentForStaticSiteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesCreateZipDeploymentForStaticSiteFuture.Result. +func (future *StaticSitesCreateZipDeploymentForStaticSiteFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesCreateZipDeploymentForStaticSiteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesCreateZipDeploymentForStaticSiteFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesDeletePrivateEndpointConnectionFuture an abstraction for monitoring and retrieving the +// results of a long-running operation. +type StaticSitesDeletePrivateEndpointConnectionFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (SetObject, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesDeletePrivateEndpointConnectionFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesDeletePrivateEndpointConnectionFuture.Result. +func (future *StaticSitesDeletePrivateEndpointConnectionFuture) result(client StaticSitesClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesDeletePrivateEndpointConnectionFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + so.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesDeletePrivateEndpointConnectionFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeletePrivateEndpointConnectionResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesDeletePrivateEndpointConnectionFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// StaticSitesDeleteStaticSiteBuildFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StaticSitesDeleteStaticSiteBuildFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesDeleteStaticSiteBuildFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesDeleteStaticSiteBuildFuture.Result. +func (future *StaticSitesDeleteStaticSiteBuildFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesDeleteStaticSiteBuildFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesDeleteStaticSiteBuildFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesDeleteStaticSiteCustomDomainFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type StaticSitesDeleteStaticSiteCustomDomainFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesDeleteStaticSiteCustomDomainFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesDeleteStaticSiteCustomDomainFuture.Result. +func (future *StaticSitesDeleteStaticSiteCustomDomainFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesDeleteStaticSiteCustomDomainFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesDeleteStaticSiteCustomDomainFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesDeleteStaticSiteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StaticSitesDeleteStaticSiteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesDeleteStaticSiteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesDeleteStaticSiteFuture.Result. +func (future *StaticSitesDeleteStaticSiteFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesDeleteStaticSiteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesDeleteStaticSiteFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesDetachStaticSiteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type StaticSitesDetachStaticSiteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesDetachStaticSiteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesDetachStaticSiteFuture.Result. +func (future *StaticSitesDetachStaticSiteFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesDetachStaticSiteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesDetachStaticSiteFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (StaticSiteUserProvidedFunctionAppARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture.Result. +func (future *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture) result(client StaticSitesClient) (ssupfaar StaticSiteUserProvidedFunctionAppARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ssupfaar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssupfaar.Response.Response, err = future.GetResult(sender); err == nil && ssupfaar.Response.Response.StatusCode != http.StatusNoContent { + ssupfaar, err = client.RegisterUserProvidedFunctionAppWithStaticSiteBuildResponder(ssupfaar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture", "Result", ssupfaar.Response.Response, "Failure responding to request") + } + } + return +} + +// StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture an abstraction for monitoring and +// retrieving the results of a long-running operation. +type StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (StaticSiteUserProvidedFunctionAppARMResource, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture.Result. +func (future *StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture) result(client StaticSitesClient) (ssupfaar StaticSiteUserProvidedFunctionAppARMResource, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ssupfaar.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ssupfaar.Response.Response, err = future.GetResult(sender); err == nil && ssupfaar.Response.Response.StatusCode != http.StatusNoContent { + ssupfaar, err = client.RegisterUserProvidedFunctionAppWithStaticSiteResponder(ssupfaar.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture", "Result", ssupfaar.Response.Response, "Failure responding to request") + } + } + return +} + +// StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture an abstraction for monitoring and retrieving +// the results of a long-running operation. +type StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(StaticSitesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture.Result. +func (future *StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture) result(client StaticSitesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("web.StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture") + return + } + ar.Response = future.Response() + return +} + +// StaticSitesWorkflowPreview preview for the Static Site Workflow to be generated +type StaticSitesWorkflowPreview struct { + autorest.Response `json:"-"` + // StaticSitesWorkflowPreviewProperties - StaticSitesWorkflowPreview resource specific properties + *StaticSitesWorkflowPreviewProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSitesWorkflowPreview. +func (sswp StaticSitesWorkflowPreview) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sswp.StaticSitesWorkflowPreviewProperties != nil { + objectMap["properties"] = sswp.StaticSitesWorkflowPreviewProperties + } + if sswp.Kind != nil { + objectMap["kind"] = sswp.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSitesWorkflowPreview struct. +func (sswp *StaticSitesWorkflowPreview) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSitesWorkflowPreviewProperties StaticSitesWorkflowPreviewProperties + err = json.Unmarshal(*v, &staticSitesWorkflowPreviewProperties) + if err != nil { + return err + } + sswp.StaticSitesWorkflowPreviewProperties = &staticSitesWorkflowPreviewProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sswp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sswp.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sswp.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sswp.Type = &typeVar + } + } + } + + return nil +} + +// StaticSitesWorkflowPreviewProperties staticSitesWorkflowPreview resource specific properties +type StaticSitesWorkflowPreviewProperties struct { + // Path - READ-ONLY; The path for the workflow file to be generated + Path *string `json:"path,omitempty"` + // Contents - READ-ONLY; The contents for the workflow file to be generated + Contents *string `json:"contents,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSitesWorkflowPreviewProperties. +func (sswp StaticSitesWorkflowPreviewProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StaticSitesWorkflowPreviewRequest request entity for previewing the Static Site workflow +type StaticSitesWorkflowPreviewRequest struct { + // StaticSitesWorkflowPreviewRequestProperties - StaticSitesWorkflowPreviewRequest resource specific properties + *StaticSitesWorkflowPreviewRequestProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSitesWorkflowPreviewRequest. +func (sswpr StaticSitesWorkflowPreviewRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sswpr.StaticSitesWorkflowPreviewRequestProperties != nil { + objectMap["properties"] = sswpr.StaticSitesWorkflowPreviewRequestProperties + } + if sswpr.Kind != nil { + objectMap["kind"] = sswpr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSitesWorkflowPreviewRequest struct. +func (sswpr *StaticSitesWorkflowPreviewRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSitesWorkflowPreviewRequestProperties StaticSitesWorkflowPreviewRequestProperties + err = json.Unmarshal(*v, &staticSitesWorkflowPreviewRequestProperties) + if err != nil { + return err + } + sswpr.StaticSitesWorkflowPreviewRequestProperties = &staticSitesWorkflowPreviewRequestProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sswpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sswpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sswpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sswpr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSitesWorkflowPreviewRequestProperties staticSitesWorkflowPreviewRequest resource specific +// properties +type StaticSitesWorkflowPreviewRequestProperties struct { + // RepositoryURL - URL for the repository of the static site. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The target branch in the repository. + Branch *string `json:"branch,omitempty"` + // BuildProperties - Build properties to configure on the repository. + BuildProperties *StaticSiteBuildProperties `json:"buildProperties,omitempty"` +} + +// StaticSiteTemplateOptions template Options for the static site. +type StaticSiteTemplateOptions struct { + // TemplateRepositoryURL - URL of the template repository. The newly generated repository will be based on this one. + TemplateRepositoryURL *string `json:"templateRepositoryUrl,omitempty"` + // Owner - Owner of the newly generated repository. + Owner *string `json:"owner,omitempty"` + // RepositoryName - Name of the newly generated repository. + RepositoryName *string `json:"repositoryName,omitempty"` + // Description - Description of the newly generated repository. + Description *string `json:"description,omitempty"` + // IsPrivate - Whether or not the newly generated repository is a private repository. Defaults to false (i.e. public). + IsPrivate *bool `json:"isPrivate,omitempty"` +} + +// StaticSiteUserARMResource static Site User ARM resource. +type StaticSiteUserARMResource struct { + autorest.Response `json:"-"` + // StaticSiteUserARMResourceProperties - StaticSiteUserARMResource resource specific properties + *StaticSiteUserARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserARMResource. +func (ssuar StaticSiteUserARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuar.StaticSiteUserARMResourceProperties != nil { + objectMap["properties"] = ssuar.StaticSiteUserARMResourceProperties + } + if ssuar.Kind != nil { + objectMap["kind"] = ssuar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserARMResource struct. +func (ssuar *StaticSiteUserARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteUserARMResourceProperties StaticSiteUserARMResourceProperties + err = json.Unmarshal(*v, &staticSiteUserARMResourceProperties) + if err != nil { + return err + } + ssuar.StaticSiteUserARMResourceProperties = &staticSiteUserARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssuar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssuar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssuar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssuar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserARMResourceProperties staticSiteUserARMResource resource specific properties +type StaticSiteUserARMResourceProperties struct { + // Provider - READ-ONLY; The identity provider for the static site user. + Provider *string `json:"provider,omitempty"` + // UserID - READ-ONLY; The user id for the static site user. + UserID *string `json:"userId,omitempty"` + // DisplayName - READ-ONLY; The display name for the static site user. + DisplayName *string `json:"displayName,omitempty"` + // Roles - The roles for the static site user, in free-form string format + Roles *string `json:"roles,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserARMResourceProperties. +func (ssuar StaticSiteUserARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuar.Roles != nil { + objectMap["roles"] = ssuar.Roles + } + return json.Marshal(objectMap) +} + +// StaticSiteUserCollection collection of static site custom users. +type StaticSiteUserCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteUserARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserCollection. +func (ssuc StaticSiteUserCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuc.Value != nil { + objectMap["value"] = ssuc.Value + } + return json.Marshal(objectMap) +} + +// StaticSiteUserCollectionIterator provides access to a complete listing of StaticSiteUserARMResource +// values. +type StaticSiteUserCollectionIterator struct { + i int + page StaticSiteUserCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticSiteUserCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteUserCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticSiteUserCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteUserCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StaticSiteUserCollectionIterator) Response() StaticSiteUserCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StaticSiteUserCollectionIterator) Value() StaticSiteUserARMResource { + if !iter.page.NotDone() { + return StaticSiteUserARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteUserCollectionIterator type. +func NewStaticSiteUserCollectionIterator(page StaticSiteUserCollectionPage) StaticSiteUserCollectionIterator { + return StaticSiteUserCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssuc StaticSiteUserCollection) IsEmpty() bool { + return ssuc.Value == nil || len(*ssuc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ssuc StaticSiteUserCollection) hasNextLink() bool { + return ssuc.NextLink != nil && len(*ssuc.NextLink) != 0 +} + +// staticSiteUserCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssuc StaticSiteUserCollection) staticSiteUserCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ssuc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssuc.NextLink))) +} + +// StaticSiteUserCollectionPage contains a page of StaticSiteUserARMResource values. +type StaticSiteUserCollectionPage struct { + fn func(context.Context, StaticSiteUserCollection) (StaticSiteUserCollection, error) + ssuc StaticSiteUserCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StaticSiteUserCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteUserCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ssuc) + if err != nil { + return err + } + page.ssuc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StaticSiteUserCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteUserCollectionPage) NotDone() bool { + return !page.ssuc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteUserCollectionPage) Response() StaticSiteUserCollection { + return page.ssuc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteUserCollectionPage) Values() []StaticSiteUserARMResource { + if page.ssuc.IsEmpty() { + return nil + } + return *page.ssuc.Value +} + +// Creates a new instance of the StaticSiteUserCollectionPage type. +func NewStaticSiteUserCollectionPage(cur StaticSiteUserCollection, getNextPage func(context.Context, StaticSiteUserCollection) (StaticSiteUserCollection, error)) StaticSiteUserCollectionPage { + return StaticSiteUserCollectionPage{ + fn: getNextPage, + ssuc: cur, + } +} + +// StaticSiteUserInvitationRequestResource static sites user roles invitation resource. +type StaticSiteUserInvitationRequestResource struct { + // StaticSiteUserInvitationRequestResourceProperties - StaticSiteUserInvitationRequestResource resource specific properties + *StaticSiteUserInvitationRequestResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserInvitationRequestResource. +func (ssuirr StaticSiteUserInvitationRequestResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuirr.StaticSiteUserInvitationRequestResourceProperties != nil { + objectMap["properties"] = ssuirr.StaticSiteUserInvitationRequestResourceProperties + } + if ssuirr.Kind != nil { + objectMap["kind"] = ssuirr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserInvitationRequestResource struct. +func (ssuirr *StaticSiteUserInvitationRequestResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteUserInvitationRequestResourceProperties StaticSiteUserInvitationRequestResourceProperties + err = json.Unmarshal(*v, &staticSiteUserInvitationRequestResourceProperties) + if err != nil { + return err + } + ssuirr.StaticSiteUserInvitationRequestResourceProperties = &staticSiteUserInvitationRequestResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssuirr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssuirr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssuirr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssuirr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserInvitationRequestResourceProperties staticSiteUserInvitationRequestResource resource +// specific properties +type StaticSiteUserInvitationRequestResourceProperties struct { + // Domain - The domain name for the static site custom domain. + Domain *string `json:"domain,omitempty"` + // Provider - The identity provider for the static site user. + Provider *string `json:"provider,omitempty"` + // UserDetails - The user id for the static site user. + UserDetails *string `json:"userDetails,omitempty"` + // Roles - The roles for the static site user, in free-form string format + Roles *string `json:"roles,omitempty"` + // NumHoursToExpiration - The number of hours the sas token stays valid + NumHoursToExpiration *int32 `json:"numHoursToExpiration,omitempty"` +} + +// StaticSiteUserInvitationResponseResource static sites user roles invitation link resource. +type StaticSiteUserInvitationResponseResource struct { + autorest.Response `json:"-"` + // StaticSiteUserInvitationResponseResourceProperties - StaticSiteUserInvitationResponseResource resource specific properties + *StaticSiteUserInvitationResponseResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserInvitationResponseResource. +func (ssuirr StaticSiteUserInvitationResponseResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssuirr.StaticSiteUserInvitationResponseResourceProperties != nil { + objectMap["properties"] = ssuirr.StaticSiteUserInvitationResponseResourceProperties + } + if ssuirr.Kind != nil { + objectMap["kind"] = ssuirr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserInvitationResponseResource struct. +func (ssuirr *StaticSiteUserInvitationResponseResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteUserInvitationResponseResourceProperties StaticSiteUserInvitationResponseResourceProperties + err = json.Unmarshal(*v, &staticSiteUserInvitationResponseResourceProperties) + if err != nil { + return err + } + ssuirr.StaticSiteUserInvitationResponseResourceProperties = &staticSiteUserInvitationResponseResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssuirr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssuirr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssuirr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssuirr.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserInvitationResponseResourceProperties staticSiteUserInvitationResponseResource resource +// specific properties +type StaticSiteUserInvitationResponseResourceProperties struct { + // ExpiresOn - READ-ONLY; The expiration time of the invitation + ExpiresOn *date.Time `json:"expiresOn,omitempty"` + // InvitationURL - READ-ONLY; The url for the invitation link + InvitationURL *string `json:"invitationUrl,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserInvitationResponseResourceProperties. +func (ssuirr StaticSiteUserInvitationResponseResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StaticSiteUserProvidedFunctionApp a static site user provided function. +type StaticSiteUserProvidedFunctionApp struct { + // StaticSiteUserProvidedFunctionAppProperties - StaticSiteUserProvidedFunctionApp resource specific properties + *StaticSiteUserProvidedFunctionAppProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserProvidedFunctionApp. +func (ssupfa StaticSiteUserProvidedFunctionApp) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssupfa.StaticSiteUserProvidedFunctionAppProperties != nil { + objectMap["properties"] = ssupfa.StaticSiteUserProvidedFunctionAppProperties + } + if ssupfa.Kind != nil { + objectMap["kind"] = ssupfa.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserProvidedFunctionApp struct. +func (ssupfa *StaticSiteUserProvidedFunctionApp) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteUserProvidedFunctionAppProperties StaticSiteUserProvidedFunctionAppProperties + err = json.Unmarshal(*v, &staticSiteUserProvidedFunctionAppProperties) + if err != nil { + return err + } + ssupfa.StaticSiteUserProvidedFunctionAppProperties = &staticSiteUserProvidedFunctionAppProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssupfa.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssupfa.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssupfa.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssupfa.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserProvidedFunctionAppARMResource static Site User Provided Function App ARM resource. +type StaticSiteUserProvidedFunctionAppARMResource struct { + autorest.Response `json:"-"` + // StaticSiteUserProvidedFunctionAppARMResourceProperties - StaticSiteUserProvidedFunctionAppARMResource resource specific properties + *StaticSiteUserProvidedFunctionAppARMResourceProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserProvidedFunctionAppARMResource. +func (ssupfaar StaticSiteUserProvidedFunctionAppARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssupfaar.StaticSiteUserProvidedFunctionAppARMResourceProperties != nil { + objectMap["properties"] = ssupfaar.StaticSiteUserProvidedFunctionAppARMResourceProperties + } + if ssupfaar.Kind != nil { + objectMap["kind"] = ssupfaar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteUserProvidedFunctionAppARMResource struct. +func (ssupfaar *StaticSiteUserProvidedFunctionAppARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteUserProvidedFunctionAppARMResourceProperties StaticSiteUserProvidedFunctionAppARMResourceProperties + err = json.Unmarshal(*v, &staticSiteUserProvidedFunctionAppARMResourceProperties) + if err != nil { + return err + } + ssupfaar.StaticSiteUserProvidedFunctionAppARMResourceProperties = &staticSiteUserProvidedFunctionAppARMResourceProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ssupfaar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ssupfaar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + ssupfaar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ssupfaar.Type = &typeVar + } + } + } + + return nil +} + +// StaticSiteUserProvidedFunctionAppARMResourceProperties staticSiteUserProvidedFunctionAppARMResource +// resource specific properties +type StaticSiteUserProvidedFunctionAppARMResourceProperties struct { + // FunctionAppResourceID - The resource id of the function app registered with the static site + FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` + // FunctionAppRegion - The region of the function app registered with the static site + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + // CreatedOn - READ-ONLY; The date and time on which the function app was registered with the static site. + CreatedOn *date.Time `json:"createdOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserProvidedFunctionAppARMResourceProperties. +func (ssupfaar StaticSiteUserProvidedFunctionAppARMResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssupfaar.FunctionAppResourceID != nil { + objectMap["functionAppResourceId"] = ssupfaar.FunctionAppResourceID + } + if ssupfaar.FunctionAppRegion != nil { + objectMap["functionAppRegion"] = ssupfaar.FunctionAppRegion + } + return json.Marshal(objectMap) +} + +// StaticSiteUserProvidedFunctionAppProperties staticSiteUserProvidedFunctionApp resource specific +// properties +type StaticSiteUserProvidedFunctionAppProperties struct { + // FunctionAppResourceID - The resource id of the function app registered with the static site + FunctionAppResourceID *string `json:"functionAppResourceId,omitempty"` + // FunctionAppRegion - The region of the function app registered with the static site + FunctionAppRegion *string `json:"functionAppRegion,omitempty"` + // CreatedOn - READ-ONLY; The date and time on which the function app was registered with the static site. + CreatedOn *date.Time `json:"createdOn,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserProvidedFunctionAppProperties. +func (ssupfa StaticSiteUserProvidedFunctionAppProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssupfa.FunctionAppResourceID != nil { + objectMap["functionAppResourceId"] = ssupfa.FunctionAppResourceID + } + if ssupfa.FunctionAppRegion != nil { + objectMap["functionAppRegion"] = ssupfa.FunctionAppRegion + } + return json.Marshal(objectMap) +} + +// StaticSiteUserProvidedFunctionAppsCollection collection of static site user provided function apps. +type StaticSiteUserProvidedFunctionAppsCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]StaticSiteUserProvidedFunctionAppARMResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteUserProvidedFunctionAppsCollection. +func (ssupfac StaticSiteUserProvidedFunctionAppsCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ssupfac.Value != nil { + objectMap["value"] = ssupfac.Value + } + return json.Marshal(objectMap) +} + +// StaticSiteUserProvidedFunctionAppsCollectionIterator provides access to a complete listing of +// StaticSiteUserProvidedFunctionAppARMResource values. +type StaticSiteUserProvidedFunctionAppsCollectionIterator struct { + i int + page StaticSiteUserProvidedFunctionAppsCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *StaticSiteUserProvidedFunctionAppsCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteUserProvidedFunctionAppsCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *StaticSiteUserProvidedFunctionAppsCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter StaticSiteUserProvidedFunctionAppsCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter StaticSiteUserProvidedFunctionAppsCollectionIterator) Response() StaticSiteUserProvidedFunctionAppsCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter StaticSiteUserProvidedFunctionAppsCollectionIterator) Value() StaticSiteUserProvidedFunctionAppARMResource { + if !iter.page.NotDone() { + return StaticSiteUserProvidedFunctionAppARMResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the StaticSiteUserProvidedFunctionAppsCollectionIterator type. +func NewStaticSiteUserProvidedFunctionAppsCollectionIterator(page StaticSiteUserProvidedFunctionAppsCollectionPage) StaticSiteUserProvidedFunctionAppsCollectionIterator { + return StaticSiteUserProvidedFunctionAppsCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ssupfac StaticSiteUserProvidedFunctionAppsCollection) IsEmpty() bool { + return ssupfac.Value == nil || len(*ssupfac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ssupfac StaticSiteUserProvidedFunctionAppsCollection) hasNextLink() bool { + return ssupfac.NextLink != nil && len(*ssupfac.NextLink) != 0 +} + +// staticSiteUserProvidedFunctionAppsCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ssupfac StaticSiteUserProvidedFunctionAppsCollection) staticSiteUserProvidedFunctionAppsCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !ssupfac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ssupfac.NextLink))) +} + +// StaticSiteUserProvidedFunctionAppsCollectionPage contains a page of +// StaticSiteUserProvidedFunctionAppARMResource values. +type StaticSiteUserProvidedFunctionAppsCollectionPage struct { + fn func(context.Context, StaticSiteUserProvidedFunctionAppsCollection) (StaticSiteUserProvidedFunctionAppsCollection, error) + ssupfac StaticSiteUserProvidedFunctionAppsCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *StaticSiteUserProvidedFunctionAppsCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSiteUserProvidedFunctionAppsCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ssupfac) + if err != nil { + return err + } + page.ssupfac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *StaticSiteUserProvidedFunctionAppsCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page StaticSiteUserProvidedFunctionAppsCollectionPage) NotDone() bool { + return !page.ssupfac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page StaticSiteUserProvidedFunctionAppsCollectionPage) Response() StaticSiteUserProvidedFunctionAppsCollection { + return page.ssupfac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page StaticSiteUserProvidedFunctionAppsCollectionPage) Values() []StaticSiteUserProvidedFunctionAppARMResource { + if page.ssupfac.IsEmpty() { + return nil + } + return *page.ssupfac.Value +} + +// Creates a new instance of the StaticSiteUserProvidedFunctionAppsCollectionPage type. +func NewStaticSiteUserProvidedFunctionAppsCollectionPage(cur StaticSiteUserProvidedFunctionAppsCollection, getNextPage func(context.Context, StaticSiteUserProvidedFunctionAppsCollection) (StaticSiteUserProvidedFunctionAppsCollection, error)) StaticSiteUserProvidedFunctionAppsCollectionPage { + return StaticSiteUserProvidedFunctionAppsCollectionPage{ + fn: getNextPage, + ssupfac: cur, + } +} + +// StaticSiteZipDeployment a static site zip deployment. +type StaticSiteZipDeployment struct { + // AppZipURL - URL for the zipped app content + AppZipURL *string `json:"appZipUrl,omitempty"` + // APIZipURL - URL for the zipped api content + APIZipURL *string `json:"apiZipUrl,omitempty"` + // DeploymentTitle - A title to label the deployment + DeploymentTitle *string `json:"deploymentTitle,omitempty"` + // Provider - The provider submitting this deployment + Provider *string `json:"provider,omitempty"` + // FunctionLanguage - The language of the api content, if it exists + FunctionLanguage *string `json:"functionLanguage,omitempty"` +} + +// StaticSiteZipDeploymentARMResource static site zip deployment ARM resource. +type StaticSiteZipDeploymentARMResource struct { + // StaticSiteZipDeployment - Core resource properties + *StaticSiteZipDeployment `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StaticSiteZipDeploymentARMResource. +func (sszdar StaticSiteZipDeploymentARMResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sszdar.StaticSiteZipDeployment != nil { + objectMap["properties"] = sszdar.StaticSiteZipDeployment + } + if sszdar.Kind != nil { + objectMap["kind"] = sszdar.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StaticSiteZipDeploymentARMResource struct. +func (sszdar *StaticSiteZipDeploymentARMResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var staticSiteZipDeployment StaticSiteZipDeployment + err = json.Unmarshal(*v, &staticSiteZipDeployment) + if err != nil { + return err + } + sszdar.StaticSiteZipDeployment = &staticSiteZipDeployment + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + sszdar.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + sszdar.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + sszdar.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + sszdar.Type = &typeVar + } + } + } + + return nil +} + +// Status identify the status of the most severe insight generated by the detector. +type Status struct { + // Message - Descriptive message. + Message *string `json:"message,omitempty"` + // StatusID - Level of the most severe insight generated by the detector. Possible values include: 'InsightStatusCritical', 'InsightStatusWarning', 'InsightStatusInfo', 'InsightStatusSuccess', 'InsightStatusNone' + StatusID InsightStatus `json:"statusId,omitempty"` +} + +// StatusCodesBasedTrigger trigger based on status code. +type StatusCodesBasedTrigger struct { + // Status - HTTP status code. + Status *int32 `json:"status,omitempty"` + // SubStatus - Request Sub Status. + SubStatus *int32 `json:"subStatus,omitempty"` + // Win32Status - Win32 error code. + Win32Status *int32 `json:"win32Status,omitempty"` + // Count - Request Count. + Count *int32 `json:"count,omitempty"` + // TimeInterval - Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` + // Path - Request Path + Path *string `json:"path,omitempty"` +} + +// StatusCodesRangeBasedTrigger trigger based on range of status codes. +type StatusCodesRangeBasedTrigger struct { + // StatusCodes - HTTP status code. + StatusCodes *string `json:"statusCodes,omitempty"` + Path *string `json:"path,omitempty"` + // Count - Request Count. + Count *int32 `json:"count,omitempty"` + // TimeInterval - Time interval. + TimeInterval *string `json:"timeInterval,omitempty"` +} + +// StorageMigrationOptions options for app content migration. +type StorageMigrationOptions struct { + // StorageMigrationOptionsProperties - StorageMigrationOptions resource specific properties + *StorageMigrationOptionsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageMigrationOptions. +func (smo StorageMigrationOptions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smo.StorageMigrationOptionsProperties != nil { + objectMap["properties"] = smo.StorageMigrationOptionsProperties + } + if smo.Kind != nil { + objectMap["kind"] = smo.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageMigrationOptions struct. +func (smo *StorageMigrationOptions) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var storageMigrationOptionsProperties StorageMigrationOptionsProperties + err = json.Unmarshal(*v, &storageMigrationOptionsProperties) + if err != nil { + return err + } + smo.StorageMigrationOptionsProperties = &storageMigrationOptionsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + smo.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + smo.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + smo.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smo.Type = &typeVar + } + } + } + + return nil +} + +// StorageMigrationOptionsProperties storageMigrationOptions resource specific properties +type StorageMigrationOptionsProperties struct { + // AzurefilesConnectionString - AzureFiles connection string. + AzurefilesConnectionString *string `json:"azurefilesConnectionString,omitempty"` + // AzurefilesShare - AzureFiles share. + AzurefilesShare *string `json:"azurefilesShare,omitempty"` + // SwitchSiteAfterMigration - trueif the app should be switched over; otherwise, false. + SwitchSiteAfterMigration *bool `json:"switchSiteAfterMigration,omitempty"` + // BlockWriteAccessToSite - true if the app should be read only during copy operation; otherwise, false. + BlockWriteAccessToSite *bool `json:"blockWriteAccessToSite,omitempty"` +} + +// StorageMigrationResponse response for a migration of app content request. +type StorageMigrationResponse struct { + autorest.Response `json:"-"` + // StorageMigrationResponseProperties - StorageMigrationResponse resource specific properties + *StorageMigrationResponseProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageMigrationResponse. +func (smr StorageMigrationResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if smr.StorageMigrationResponseProperties != nil { + objectMap["properties"] = smr.StorageMigrationResponseProperties + } + if smr.Kind != nil { + objectMap["kind"] = smr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for StorageMigrationResponse struct. +func (smr *StorageMigrationResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var storageMigrationResponseProperties StorageMigrationResponseProperties + err = json.Unmarshal(*v, &storageMigrationResponseProperties) + if err != nil { + return err + } + smr.StorageMigrationResponseProperties = &storageMigrationResponseProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + smr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + smr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + smr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + smr.Type = &typeVar + } + } + } + + return nil +} + +// StorageMigrationResponseProperties storageMigrationResponse resource specific properties +type StorageMigrationResponseProperties struct { + // OperationID - READ-ONLY; When server starts the migration process, it will return an operation ID identifying that particular migration operation. + OperationID *string `json:"operationId,omitempty"` +} + +// MarshalJSON is the custom marshaler for StorageMigrationResponseProperties. +func (smr StorageMigrationResponseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// String ... +type String struct { + autorest.Response `json:"-"` + Value *string `json:"value,omitempty"` +} + +// StringDictionary string dictionary resource. +type StringDictionary struct { + autorest.Response `json:"-"` + // Properties - Settings. + Properties map[string]*string `json:"properties"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StringDictionary. +func (sd StringDictionary) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sd.Properties != nil { + objectMap["properties"] = sd.Properties + } + if sd.Kind != nil { + objectMap["kind"] = sd.Kind + } + return json.Marshal(objectMap) +} + +// StringList string list resource. +type StringList struct { + autorest.Response `json:"-"` + // Properties - List of string resources. + Properties *[]string `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for StringList. +func (sl StringList) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sl.Properties != nil { + objectMap["properties"] = sl.Properties + } + if sl.Kind != nil { + objectMap["kind"] = sl.Kind + } + return json.Marshal(objectMap) +} + +// SupportTopic defines a unique Support Topic +type SupportTopic struct { + // ID - READ-ONLY; Support Topic Id + ID *string `json:"id,omitempty"` + // PesID - READ-ONLY; Unique resource Id + PesID *string `json:"pesId,omitempty"` +} + +// MarshalJSON is the custom marshaler for SupportTopic. +func (st SupportTopic) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SwiftVirtualNetwork swift Virtual Network Contract. This is used to enable the new Swift way of doing +// virtual network integration. +type SwiftVirtualNetwork struct { + autorest.Response `json:"-"` + // SwiftVirtualNetworkProperties - SwiftVirtualNetwork resource specific properties + *SwiftVirtualNetworkProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for SwiftVirtualNetwork. +func (svn SwiftVirtualNetwork) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if svn.SwiftVirtualNetworkProperties != nil { + objectMap["properties"] = svn.SwiftVirtualNetworkProperties + } + if svn.Kind != nil { + objectMap["kind"] = svn.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for SwiftVirtualNetwork struct. +func (svn *SwiftVirtualNetwork) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var swiftVirtualNetworkProperties SwiftVirtualNetworkProperties + err = json.Unmarshal(*v, &swiftVirtualNetworkProperties) + if err != nil { + return err + } + svn.SwiftVirtualNetworkProperties = &swiftVirtualNetworkProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + svn.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + svn.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + svn.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + svn.Type = &typeVar + } + } + } + + return nil +} + +// SwiftVirtualNetworkProperties swiftVirtualNetwork resource specific properties +type SwiftVirtualNetworkProperties struct { + // SubnetResourceID - The Virtual Network subnet's resource ID. This is the subnet that this Web App will join. This subnet must have a delegation to Microsoft.Web/serverFarms defined first. + SubnetResourceID *string `json:"subnetResourceId,omitempty"` + // SwiftSupported - A flag that specifies if the scale unit this Web App is on supports Swift integration. + SwiftSupported *bool `json:"swiftSupported,omitempty"` +} + +// Template container App versioned application definition. +// Defines the desired state of an immutable revision. +// Any changes to this section Will result in a new revision being created +type Template struct { + // RevisionSuffix - User friendly suffix that is appended to the revision name + RevisionSuffix *string `json:"revisionSuffix,omitempty"` + // Containers - List of container definitions for the Container App. + Containers *[]Container `json:"containers,omitempty"` + // Scale - Scaling properties for the Container App. + Scale *Scale `json:"scale,omitempty"` + // Dapr - Dapr configuration for the Container App. + Dapr *Dapr `json:"dapr,omitempty"` +} + +// TldLegalAgreement legal agreement for a top level domain. +type TldLegalAgreement struct { + // AgreementKey - Unique identifier for the agreement. + AgreementKey *string `json:"agreementKey,omitempty"` + // Title - Agreement title. + Title *string `json:"title,omitempty"` + // Content - Agreement details. + Content *string `json:"content,omitempty"` + // URL - URL where a copy of the agreement details is hosted. + URL *string `json:"url,omitempty"` +} + +// TldLegalAgreementCollection collection of top-level domain legal agreements. +type TldLegalAgreementCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]TldLegalAgreement `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for TldLegalAgreementCollection. +func (tlac TldLegalAgreementCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tlac.Value != nil { + objectMap["value"] = tlac.Value + } + return json.Marshal(objectMap) +} + +// TldLegalAgreementCollectionIterator provides access to a complete listing of TldLegalAgreement values. +type TldLegalAgreementCollectionIterator struct { + i int + page TldLegalAgreementCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TldLegalAgreementCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TldLegalAgreementCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TldLegalAgreementCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TldLegalAgreementCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TldLegalAgreementCollectionIterator) Response() TldLegalAgreementCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TldLegalAgreementCollectionIterator) Value() TldLegalAgreement { + if !iter.page.NotDone() { + return TldLegalAgreement{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TldLegalAgreementCollectionIterator type. +func NewTldLegalAgreementCollectionIterator(page TldLegalAgreementCollectionPage) TldLegalAgreementCollectionIterator { + return TldLegalAgreementCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tlac TldLegalAgreementCollection) IsEmpty() bool { + return tlac.Value == nil || len(*tlac.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tlac TldLegalAgreementCollection) hasNextLink() bool { + return tlac.NextLink != nil && len(*tlac.NextLink) != 0 +} + +// tldLegalAgreementCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlac TldLegalAgreementCollection) tldLegalAgreementCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tlac.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tlac.NextLink))) +} + +// TldLegalAgreementCollectionPage contains a page of TldLegalAgreement values. +type TldLegalAgreementCollectionPage struct { + fn func(context.Context, TldLegalAgreementCollection) (TldLegalAgreementCollection, error) + tlac TldLegalAgreementCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TldLegalAgreementCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TldLegalAgreementCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tlac) + if err != nil { + return err + } + page.tlac = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TldLegalAgreementCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TldLegalAgreementCollectionPage) NotDone() bool { + return !page.tlac.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TldLegalAgreementCollectionPage) Response() TldLegalAgreementCollection { + return page.tlac +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TldLegalAgreementCollectionPage) Values() []TldLegalAgreement { + if page.tlac.IsEmpty() { + return nil + } + return *page.tlac.Value +} + +// Creates a new instance of the TldLegalAgreementCollectionPage type. +func NewTldLegalAgreementCollectionPage(cur TldLegalAgreementCollection, getNextPage func(context.Context, TldLegalAgreementCollection) (TldLegalAgreementCollection, error)) TldLegalAgreementCollectionPage { + return TldLegalAgreementCollectionPage{ + fn: getNextPage, + tlac: cur, + } +} + +// TokenStore the configuration settings of the token store. +type TokenStore struct { + // Enabled - true to durably store platform-specific security tokens that are obtained during login flows; otherwise, false. + // The default is false. + Enabled *bool `json:"enabled,omitempty"` + // TokenRefreshExtensionHours - The number of hours after session token expiration that a session token can be used to + // call the token refresh API. The default is 72 hours. + TokenRefreshExtensionHours *float64 `json:"tokenRefreshExtensionHours,omitempty"` + // FileSystem - The configuration settings of the storage of the tokens if a file system is used. + FileSystem *FileSystemTokenStore `json:"fileSystem,omitempty"` + // AzureBlobStorage - The configuration settings of the storage of the tokens if blob storage is used. + AzureBlobStorage *BlobStorageTokenStore `json:"azureBlobStorage,omitempty"` +} + +// TopLevelDomain a top level domain object. +type TopLevelDomain struct { + autorest.Response `json:"-"` + // TopLevelDomainProperties - TopLevelDomain resource specific properties + *TopLevelDomainProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TopLevelDomain. +func (tld TopLevelDomain) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tld.TopLevelDomainProperties != nil { + objectMap["properties"] = tld.TopLevelDomainProperties + } + if tld.Kind != nil { + objectMap["kind"] = tld.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TopLevelDomain struct. +func (tld *TopLevelDomain) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var topLevelDomainProperties TopLevelDomainProperties + err = json.Unmarshal(*v, &topLevelDomainProperties) + if err != nil { + return err + } + tld.TopLevelDomainProperties = &topLevelDomainProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tld.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tld.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + tld.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tld.Type = &typeVar + } + } + } + + return nil +} + +// TopLevelDomainAgreementOption options for retrieving the list of top level domain legal agreements. +type TopLevelDomainAgreementOption struct { + // IncludePrivacy - If true, then the list of agreements will include agreements for domain privacy as well; otherwise, false. + IncludePrivacy *bool `json:"includePrivacy,omitempty"` + // ForTransfer - If true, then the list of agreements will include agreements for domain transfer as well; otherwise, false. + ForTransfer *bool `json:"forTransfer,omitempty"` +} + +// TopLevelDomainCollection collection of Top-level domains. +type TopLevelDomainCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]TopLevelDomain `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for TopLevelDomainCollection. +func (tldc TopLevelDomainCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tldc.Value != nil { + objectMap["value"] = tldc.Value + } + return json.Marshal(objectMap) +} + +// TopLevelDomainCollectionIterator provides access to a complete listing of TopLevelDomain values. +type TopLevelDomainCollectionIterator struct { + i int + page TopLevelDomainCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TopLevelDomainCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TopLevelDomainCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TopLevelDomainCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TopLevelDomainCollectionIterator) Response() TopLevelDomainCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TopLevelDomainCollectionIterator) Value() TopLevelDomain { + if !iter.page.NotDone() { + return TopLevelDomain{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TopLevelDomainCollectionIterator type. +func NewTopLevelDomainCollectionIterator(page TopLevelDomainCollectionPage) TopLevelDomainCollectionIterator { + return TopLevelDomainCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tldc TopLevelDomainCollection) IsEmpty() bool { + return tldc.Value == nil || len(*tldc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tldc TopLevelDomainCollection) hasNextLink() bool { + return tldc.NextLink != nil && len(*tldc.NextLink) != 0 +} + +// topLevelDomainCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tldc TopLevelDomainCollection) topLevelDomainCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tldc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tldc.NextLink))) +} + +// TopLevelDomainCollectionPage contains a page of TopLevelDomain values. +type TopLevelDomainCollectionPage struct { + fn func(context.Context, TopLevelDomainCollection) (TopLevelDomainCollection, error) + tldc TopLevelDomainCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TopLevelDomainCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tldc) + if err != nil { + return err + } + page.tldc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TopLevelDomainCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TopLevelDomainCollectionPage) NotDone() bool { + return !page.tldc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TopLevelDomainCollectionPage) Response() TopLevelDomainCollection { + return page.tldc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TopLevelDomainCollectionPage) Values() []TopLevelDomain { + if page.tldc.IsEmpty() { + return nil + } + return *page.tldc.Value +} + +// Creates a new instance of the TopLevelDomainCollectionPage type. +func NewTopLevelDomainCollectionPage(cur TopLevelDomainCollection, getNextPage func(context.Context, TopLevelDomainCollection) (TopLevelDomainCollection, error)) TopLevelDomainCollectionPage { + return TopLevelDomainCollectionPage{ + fn: getNextPage, + tldc: cur, + } +} + +// TopLevelDomainProperties topLevelDomain resource specific properties +type TopLevelDomainProperties struct { + // Privacy - If true, then the top level domain supports domain privacy; otherwise, false. + Privacy *bool `json:"privacy,omitempty"` +} + +// TrafficWeight traffic weight assigned to a revision +type TrafficWeight struct { + // RevisionName - Name of a revision + RevisionName *string `json:"revisionName,omitempty"` + // Weight - Traffic weight assigned to a revision + Weight *int32 `json:"weight,omitempty"` + // LatestRevision - Indicates that the traffic weight belongs to a latest stable revision + LatestRevision *bool `json:"latestRevision,omitempty"` +} + +// TriggeredJobHistory triggered Web Job History. List of Triggered Web Job Run Information elements. +type TriggeredJobHistory struct { + autorest.Response `json:"-"` + // TriggeredJobHistoryProperties - TriggeredJobHistory resource specific properties + *TriggeredJobHistoryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TriggeredJobHistory. +func (tjh TriggeredJobHistory) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjh.TriggeredJobHistoryProperties != nil { + objectMap["properties"] = tjh.TriggeredJobHistoryProperties + } + if tjh.Kind != nil { + objectMap["kind"] = tjh.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TriggeredJobHistory struct. +func (tjh *TriggeredJobHistory) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var triggeredJobHistoryProperties TriggeredJobHistoryProperties + err = json.Unmarshal(*v, &triggeredJobHistoryProperties) + if err != nil { + return err + } + tjh.TriggeredJobHistoryProperties = &triggeredJobHistoryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tjh.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tjh.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + tjh.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tjh.Type = &typeVar + } + } + } + + return nil +} + +// TriggeredJobHistoryCollection collection of Kudu continuous web job information elements. +type TriggeredJobHistoryCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]TriggeredJobHistory `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for TriggeredJobHistoryCollection. +func (tjhc TriggeredJobHistoryCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tjhc.Value != nil { + objectMap["value"] = tjhc.Value + } + return json.Marshal(objectMap) +} + +// TriggeredJobHistoryCollectionIterator provides access to a complete listing of TriggeredJobHistory +// values. +type TriggeredJobHistoryCollectionIterator struct { + i int + page TriggeredJobHistoryCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TriggeredJobHistoryCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggeredJobHistoryCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TriggeredJobHistoryCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TriggeredJobHistoryCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TriggeredJobHistoryCollectionIterator) Response() TriggeredJobHistoryCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TriggeredJobHistoryCollectionIterator) Value() TriggeredJobHistory { + if !iter.page.NotDone() { + return TriggeredJobHistory{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TriggeredJobHistoryCollectionIterator type. +func NewTriggeredJobHistoryCollectionIterator(page TriggeredJobHistoryCollectionPage) TriggeredJobHistoryCollectionIterator { + return TriggeredJobHistoryCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tjhc TriggeredJobHistoryCollection) IsEmpty() bool { + return tjhc.Value == nil || len(*tjhc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tjhc TriggeredJobHistoryCollection) hasNextLink() bool { + return tjhc.NextLink != nil && len(*tjhc.NextLink) != 0 +} + +// triggeredJobHistoryCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tjhc TriggeredJobHistoryCollection) triggeredJobHistoryCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !tjhc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tjhc.NextLink))) +} + +// TriggeredJobHistoryCollectionPage contains a page of TriggeredJobHistory values. +type TriggeredJobHistoryCollectionPage struct { + fn func(context.Context, TriggeredJobHistoryCollection) (TriggeredJobHistoryCollection, error) + tjhc TriggeredJobHistoryCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TriggeredJobHistoryCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggeredJobHistoryCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tjhc) + if err != nil { + return err + } + page.tjhc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TriggeredJobHistoryCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TriggeredJobHistoryCollectionPage) NotDone() bool { + return !page.tjhc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TriggeredJobHistoryCollectionPage) Response() TriggeredJobHistoryCollection { + return page.tjhc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TriggeredJobHistoryCollectionPage) Values() []TriggeredJobHistory { + if page.tjhc.IsEmpty() { + return nil + } + return *page.tjhc.Value +} + +// Creates a new instance of the TriggeredJobHistoryCollectionPage type. +func NewTriggeredJobHistoryCollectionPage(cur TriggeredJobHistoryCollection, getNextPage func(context.Context, TriggeredJobHistoryCollection) (TriggeredJobHistoryCollection, error)) TriggeredJobHistoryCollectionPage { + return TriggeredJobHistoryCollectionPage{ + fn: getNextPage, + tjhc: cur, + } +} + +// TriggeredJobHistoryProperties triggeredJobHistory resource specific properties +type TriggeredJobHistoryProperties struct { + // Runs - List of triggered web job runs. + Runs *[]TriggeredJobRun `json:"runs,omitempty"` +} + +// TriggeredJobRun triggered Web Job Run Information. +type TriggeredJobRun struct { + // WebJobID - Job ID. + WebJobID *string `json:"web_job_id,omitempty"` + // WebJobName - Job name. + WebJobName *string `json:"web_job_name,omitempty"` + // Status - Job status. Possible values include: 'TriggeredWebJobStatusSuccess', 'TriggeredWebJobStatusFailed', 'TriggeredWebJobStatusError' + Status TriggeredWebJobStatus `json:"status,omitempty"` + // StartTime - Start time. + StartTime *date.Time `json:"start_time,omitempty"` + // EndTime - End time. + EndTime *date.Time `json:"end_time,omitempty"` + // Duration - Job duration. + Duration *string `json:"duration,omitempty"` + // OutputURL - Output URL. + OutputURL *string `json:"output_url,omitempty"` + // ErrorURL - Error URL. + ErrorURL *string `json:"error_url,omitempty"` + // URL - Job URL. + URL *string `json:"url,omitempty"` + // JobName - Job name. + JobName *string `json:"job_name,omitempty"` + // Trigger - Job trigger. + Trigger *string `json:"trigger,omitempty"` +} + +// TriggeredWebJob triggered Web Job Information. +type TriggeredWebJob struct { + autorest.Response `json:"-"` + // TriggeredWebJobProperties - TriggeredWebJob resource specific properties + *TriggeredWebJobProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TriggeredWebJob. +func (twj TriggeredWebJob) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if twj.TriggeredWebJobProperties != nil { + objectMap["properties"] = twj.TriggeredWebJobProperties + } + if twj.Kind != nil { + objectMap["kind"] = twj.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TriggeredWebJob struct. +func (twj *TriggeredWebJob) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var triggeredWebJobProperties TriggeredWebJobProperties + err = json.Unmarshal(*v, &triggeredWebJobProperties) + if err != nil { + return err + } + twj.TriggeredWebJobProperties = &triggeredWebJobProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + twj.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + twj.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + twj.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + twj.Type = &typeVar + } + } + } + + return nil +} + +// TriggeredWebJobCollection collection of Kudu continuous web job information elements. +type TriggeredWebJobCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]TriggeredWebJob `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for TriggeredWebJobCollection. +func (twjc TriggeredWebJobCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if twjc.Value != nil { + objectMap["value"] = twjc.Value + } + return json.Marshal(objectMap) +} + +// TriggeredWebJobCollectionIterator provides access to a complete listing of TriggeredWebJob values. +type TriggeredWebJobCollectionIterator struct { + i int + page TriggeredWebJobCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TriggeredWebJobCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggeredWebJobCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TriggeredWebJobCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TriggeredWebJobCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TriggeredWebJobCollectionIterator) Response() TriggeredWebJobCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TriggeredWebJobCollectionIterator) Value() TriggeredWebJob { + if !iter.page.NotDone() { + return TriggeredWebJob{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TriggeredWebJobCollectionIterator type. +func NewTriggeredWebJobCollectionIterator(page TriggeredWebJobCollectionPage) TriggeredWebJobCollectionIterator { + return TriggeredWebJobCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (twjc TriggeredWebJobCollection) IsEmpty() bool { + return twjc.Value == nil || len(*twjc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (twjc TriggeredWebJobCollection) hasNextLink() bool { + return twjc.NextLink != nil && len(*twjc.NextLink) != 0 +} + +// triggeredWebJobCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (twjc TriggeredWebJobCollection) triggeredWebJobCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !twjc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(twjc.NextLink))) +} + +// TriggeredWebJobCollectionPage contains a page of TriggeredWebJob values. +type TriggeredWebJobCollectionPage struct { + fn func(context.Context, TriggeredWebJobCollection) (TriggeredWebJobCollection, error) + twjc TriggeredWebJobCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TriggeredWebJobCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TriggeredWebJobCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.twjc) + if err != nil { + return err + } + page.twjc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TriggeredWebJobCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TriggeredWebJobCollectionPage) NotDone() bool { + return !page.twjc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TriggeredWebJobCollectionPage) Response() TriggeredWebJobCollection { + return page.twjc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TriggeredWebJobCollectionPage) Values() []TriggeredWebJob { + if page.twjc.IsEmpty() { + return nil + } + return *page.twjc.Value +} + +// Creates a new instance of the TriggeredWebJobCollectionPage type. +func NewTriggeredWebJobCollectionPage(cur TriggeredWebJobCollection, getNextPage func(context.Context, TriggeredWebJobCollection) (TriggeredWebJobCollection, error)) TriggeredWebJobCollectionPage { + return TriggeredWebJobCollectionPage{ + fn: getNextPage, + twjc: cur, + } +} + +// TriggeredWebJobProperties triggeredWebJob resource specific properties +type TriggeredWebJobProperties struct { + // LatestRun - Latest job run information. + LatestRun *TriggeredJobRun `json:"latest_run,omitempty"` + // HistoryURL - History URL. + HistoryURL *string `json:"history_url,omitempty"` + // SchedulerLogsURL - Scheduler Logs URL. + SchedulerLogsURL *string `json:"scheduler_logs_url,omitempty"` + // RunCommand - Run command. + RunCommand *string `json:"run_command,omitempty"` + // URL - Job URL. + URL *string `json:"url,omitempty"` + // ExtraInfoURL - Extra Info URL. + ExtraInfoURL *string `json:"extra_info_url,omitempty"` + // WebJobType - Job type. Possible values include: 'JobTypeContinuous', 'JobTypeTriggered' + WebJobType JobType `json:"web_job_type,omitempty"` + // Error - Error information. + Error *string `json:"error,omitempty"` + // UsingSdk - Using SDK? + UsingSdk *bool `json:"using_sdk,omitempty"` + // Settings - Job settings. + Settings map[string]interface{} `json:"settings"` +} + +// MarshalJSON is the custom marshaler for TriggeredWebJobProperties. +func (twj TriggeredWebJobProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if twj.LatestRun != nil { + objectMap["latest_run"] = twj.LatestRun + } + if twj.HistoryURL != nil { + objectMap["history_url"] = twj.HistoryURL + } + if twj.SchedulerLogsURL != nil { + objectMap["scheduler_logs_url"] = twj.SchedulerLogsURL + } + if twj.RunCommand != nil { + objectMap["run_command"] = twj.RunCommand + } + if twj.URL != nil { + objectMap["url"] = twj.URL + } + if twj.ExtraInfoURL != nil { + objectMap["extra_info_url"] = twj.ExtraInfoURL + } + if twj.WebJobType != "" { + objectMap["web_job_type"] = twj.WebJobType + } + if twj.Error != nil { + objectMap["error"] = twj.Error + } + if twj.UsingSdk != nil { + objectMap["using_sdk"] = twj.UsingSdk + } + if twj.Settings != nil { + objectMap["settings"] = twj.Settings + } + return json.Marshal(objectMap) +} + +// Twitter the configuration settings of the Twitter provider. +type Twitter struct { + // Enabled - false if the Twitter provider should not be enabled despite the set registration; otherwise, true. + Enabled *bool `json:"enabled,omitempty"` + // Registration - The configuration settings of the app registration for the Twitter provider. + Registration *TwitterRegistration `json:"registration,omitempty"` +} + +// TwitterRegistration the configuration settings of the app registration for the Twitter provider. +type TwitterRegistration struct { + // ConsumerKey - The OAuth 1.0a consumer key of the Twitter application used for sign-in. + // This setting is required for enabling Twitter Sign-In. + // Twitter Sign-In documentation: https://dev.twitter.com/web/sign-in + ConsumerKey *string `json:"consumerKey,omitempty"` + // ConsumerSecretSettingName - The app setting name that contains the OAuth 1.0a consumer secret of the Twitter + // application used for sign-in. + ConsumerSecretSettingName *string `json:"consumerSecretSettingName,omitempty"` +} + +// Usage usage of the quota resource. +type Usage struct { + // UsageProperties - Usage resource specific properties + *UsageProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Usage. +func (u Usage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UsageProperties != nil { + objectMap["properties"] = u.UsageProperties + } + if u.Kind != nil { + objectMap["kind"] = u.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Usage struct. +func (u *Usage) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var usageProperties UsageProperties + err = json.Unmarshal(*v, &usageProperties) + if err != nil { + return err + } + u.UsageProperties = &usageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + u.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } + } + } + + return nil +} + +// UsageCollection collection of usages. +type UsageCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]Usage `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for UsageCollection. +func (uc UsageCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uc.Value != nil { + objectMap["value"] = uc.Value + } + return json.Marshal(objectMap) +} + +// UsageCollectionIterator provides access to a complete listing of Usage values. +type UsageCollectionIterator struct { + i int + page UsageCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *UsageCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *UsageCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter UsageCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter UsageCollectionIterator) Response() UsageCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter UsageCollectionIterator) Value() Usage { + if !iter.page.NotDone() { + return Usage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the UsageCollectionIterator type. +func NewUsageCollectionIterator(page UsageCollectionPage) UsageCollectionIterator { + return UsageCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (uc UsageCollection) IsEmpty() bool { + return uc.Value == nil || len(*uc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (uc UsageCollection) hasNextLink() bool { + return uc.NextLink != nil && len(*uc.NextLink) != 0 +} + +// usageCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (uc UsageCollection) usageCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !uc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(uc.NextLink))) +} + +// UsageCollectionPage contains a page of Usage values. +type UsageCollectionPage struct { + fn func(context.Context, UsageCollection) (UsageCollection, error) + uc UsageCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *UsageCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsageCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.uc) + if err != nil { + return err + } + page.uc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *UsageCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page UsageCollectionPage) NotDone() bool { + return !page.uc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page UsageCollectionPage) Response() UsageCollection { + return page.uc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page UsageCollectionPage) Values() []Usage { + if page.uc.IsEmpty() { + return nil + } + return *page.uc.Value +} + +// Creates a new instance of the UsageCollectionPage type. +func NewUsageCollectionPage(cur UsageCollection, getNextPage func(context.Context, UsageCollection) (UsageCollection, error)) UsageCollectionPage { + return UsageCollectionPage{ + fn: getNextPage, + uc: cur, + } +} + +// UsageProperties usage resource specific properties +type UsageProperties struct { + // DisplayName - READ-ONLY; Friendly name shown in the UI. + DisplayName *string `json:"displayName,omitempty"` + // ResourceName - READ-ONLY; Name of the quota resource. + ResourceName *string `json:"resourceName,omitempty"` + // Unit - READ-ONLY; Units of measurement for the quota resource. + Unit *string `json:"unit,omitempty"` + // CurrentValue - READ-ONLY; The current value of the resource counter. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - READ-ONLY; The resource limit. + Limit *int64 `json:"limit,omitempty"` + // NextResetTime - READ-ONLY; Next reset time for the resource counter. + NextResetTime *date.Time `json:"nextResetTime,omitempty"` + // ComputeMode - READ-ONLY; Compute mode used for this usage. Possible values include: 'ComputeModeOptionsShared', 'ComputeModeOptionsDedicated', 'ComputeModeOptionsDynamic' + ComputeMode ComputeModeOptions `json:"computeMode,omitempty"` + // SiteMode - READ-ONLY; Site mode used for this usage. + SiteMode *string `json:"siteMode,omitempty"` +} + +// MarshalJSON is the custom marshaler for UsageProperties. +func (u UsageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// User user credentials used for publishing activity. +type User struct { + autorest.Response `json:"-"` + // UserProperties - User resource specific properties + *UserProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UserProperties != nil { + objectMap["properties"] = u.UserProperties + } + if u.Kind != nil { + objectMap["kind"] = u.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for User struct. +func (u *User) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userProperties UserProperties + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + u.UserProperties = &userProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + u.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } + } + } + + return nil +} + +// UserAssignedIdentity user Assigned identity. +type UserAssignedIdentity struct { + // PrincipalID - READ-ONLY; Principal Id of user assigned identity + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY; Client Id of user assigned identity + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserAssignedIdentity. +func (uai UserAssignedIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// UserProperties user resource specific properties +type UserProperties struct { + // PublishingUserName - Username used for publishing. + PublishingUserName *string `json:"publishingUserName,omitempty"` + // PublishingPassword - Password used for publishing. + PublishingPassword *string `json:"publishingPassword,omitempty"` + // PublishingPasswordHash - Password hash used for publishing. + PublishingPasswordHash *string `json:"publishingPasswordHash,omitempty"` + // PublishingPasswordHashSalt - Password hash salt used for publishing. + PublishingPasswordHashSalt *string `json:"publishingPasswordHashSalt,omitempty"` + // ScmURI - Url of SCM site. + ScmURI *string `json:"scmUri,omitempty"` +} + +// ValidateProperties app properties used for validation. +type ValidateProperties struct { + // ServerFarmID - ARM resource ID of an App Service plan that would host the app. + ServerFarmID *string `json:"serverFarmId,omitempty"` + // SkuName - Name of the target SKU for the App Service plan. + SkuName *string `json:"skuName,omitempty"` + // NeedLinuxWorkers - true if App Service plan is for Linux workers; otherwise, false. + NeedLinuxWorkers *bool `json:"needLinuxWorkers,omitempty"` + // IsSpot - true if App Service plan is for Spot instances; otherwise, false. + IsSpot *bool `json:"isSpot,omitempty"` + // Capacity - Target capacity of the App Service plan (number of VMs). + Capacity *int32 `json:"capacity,omitempty"` + // HostingEnvironment - Name of App Service Environment where app or App Service plan should be created. + HostingEnvironment *string `json:"hostingEnvironment,omitempty"` + // IsXenon - true if App Service plan is running as a windows container + IsXenon *bool `json:"isXenon,omitempty"` + // ContainerRegistryBaseURL - Base URL of the container registry + ContainerRegistryBaseURL *string `json:"containerRegistryBaseUrl,omitempty"` + // ContainerRegistryUsername - Username for to access the container registry + ContainerRegistryUsername *string `json:"containerRegistryUsername,omitempty"` + // ContainerRegistryPassword - Password for to access the container registry + ContainerRegistryPassword *string `json:"containerRegistryPassword,omitempty"` + // ContainerImageRepository - Repository name (image name) + ContainerImageRepository *string `json:"containerImageRepository,omitempty"` + // ContainerImageTag - Image tag + ContainerImageTag *string `json:"containerImageTag,omitempty"` + // ContainerImagePlatform - Platform (windows or linux) + ContainerImagePlatform *string `json:"containerImagePlatform,omitempty"` + // AppServiceEnvironment - App Service Environment Properties + AppServiceEnvironment *AppServiceEnvironment `json:"appServiceEnvironment,omitempty"` +} + +// ValidateRequest resource validation request content. +type ValidateRequest struct { + // Name - Resource name to verify. + Name *string `json:"name,omitempty"` + // Type - Resource type used for verification. Possible values include: 'ValidateResourceTypesServerFarm', 'ValidateResourceTypesSite', 'ValidateResourceTypesMicrosoftWebhostingEnvironments' + Type ValidateResourceTypes `json:"type,omitempty"` + // Location - Expected location of the resource. + Location *string `json:"location,omitempty"` + // ValidateProperties - Properties of the resource to validate. + *ValidateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ValidateRequest. +func (vr ValidateRequest) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vr.Name != nil { + objectMap["name"] = vr.Name + } + if vr.Type != "" { + objectMap["type"] = vr.Type + } + if vr.Location != nil { + objectMap["location"] = vr.Location + } + if vr.ValidateProperties != nil { + objectMap["properties"] = vr.ValidateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ValidateRequest struct. +func (vr *ValidateRequest) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vr.Name = &name + } + case "type": + if v != nil { + var typeVar ValidateResourceTypes + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vr.Type = typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + vr.Location = &location + } + case "properties": + if v != nil { + var validateProperties ValidateProperties + err = json.Unmarshal(*v, &validateProperties) + if err != nil { + return err + } + vr.ValidateProperties = &validateProperties + } + } + } + + return nil +} + +// ValidateResponse describes the result of resource validation. +type ValidateResponse struct { + autorest.Response `json:"-"` + // Status - Result of validation. + Status *string `json:"status,omitempty"` + // Error - Error details for the case when validation fails. + Error *ValidateResponseError `json:"error,omitempty"` +} + +// ValidateResponseError error details for when validation fails. +type ValidateResponseError struct { + // Code - Validation error code. + Code *string `json:"code,omitempty"` + // Message - Validation error message. + Message *string `json:"message,omitempty"` +} + +// VirtualApplication virtual application in an app. +type VirtualApplication struct { + // VirtualPath - Virtual path. + VirtualPath *string `json:"virtualPath,omitempty"` + // PhysicalPath - Physical path. + PhysicalPath *string `json:"physicalPath,omitempty"` + // PreloadEnabled - true if preloading is enabled; otherwise, false. + PreloadEnabled *bool `json:"preloadEnabled,omitempty"` + // VirtualDirectories - Virtual directories for virtual application. + VirtualDirectories *[]VirtualDirectory `json:"virtualDirectories,omitempty"` +} + +// VirtualDirectory directory for virtual application. +type VirtualDirectory struct { + // VirtualPath - Path to virtual application. + VirtualPath *string `json:"virtualPath,omitempty"` + // PhysicalPath - Physical path. + PhysicalPath *string `json:"physicalPath,omitempty"` +} + +// VirtualIPMapping virtual IP mapping. +type VirtualIPMapping struct { + // VirtualIP - Virtual IP address. + VirtualIP *string `json:"virtualIP,omitempty"` + // InternalHTTPPort - Internal HTTP port. + InternalHTTPPort *int32 `json:"internalHttpPort,omitempty"` + // InternalHTTPSPort - Internal HTTPS port. + InternalHTTPSPort *int32 `json:"internalHttpsPort,omitempty"` + // InUse - Is virtual IP mapping in use. + InUse *bool `json:"inUse,omitempty"` + // ServiceName - name of the service that virtual IP is assigned to + ServiceName *string `json:"serviceName,omitempty"` +} + +// VirtualNetworkProfile specification for using a Virtual Network. +type VirtualNetworkProfile struct { + // ID - Resource id of the Virtual Network. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Name of the Virtual Network (read-only). + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; Resource type of the Virtual Network (read-only). + Type *string `json:"type,omitempty"` + // Subnet - Subnet within the Virtual Network. + Subnet *string `json:"subnet,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualNetworkProfile. +func (vnp VirtualNetworkProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vnp.ID != nil { + objectMap["id"] = vnp.ID + } + if vnp.Subnet != nil { + objectMap["subnet"] = vnp.Subnet + } + return json.Marshal(objectMap) +} + +// VnetGateway the Virtual Network gateway contract. This is used to give the Virtual Network gateway +// access to the VPN package. +type VnetGateway struct { + autorest.Response `json:"-"` + // VnetGatewayProperties - VnetGateway resource specific properties + *VnetGatewayProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetGateway. +func (vg VnetGateway) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vg.VnetGatewayProperties != nil { + objectMap["properties"] = vg.VnetGatewayProperties + } + if vg.Kind != nil { + objectMap["kind"] = vg.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VnetGateway struct. +func (vg *VnetGateway) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetGatewayProperties VnetGatewayProperties + err = json.Unmarshal(*v, &vnetGatewayProperties) + if err != nil { + return err + } + vg.VnetGatewayProperties = &vnetGatewayProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vg.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vg.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vg.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vg.Type = &typeVar + } + } + } + + return nil +} + +// VnetGatewayProperties vnetGateway resource specific properties +type VnetGatewayProperties struct { + // VnetName - The Virtual Network name. + VnetName *string `json:"vnetName,omitempty"` + // VpnPackageURI - The URI where the VPN package can be downloaded. + VpnPackageURI *string `json:"vpnPackageUri,omitempty"` +} + +// VnetInfo virtual Network information contract. +type VnetInfo struct { + // VnetResourceID - The Virtual Network's resource ID. + VnetResourceID *string `json:"vnetResourceId,omitempty"` + // CertThumbprint - READ-ONLY; The client certificate thumbprint. + CertThumbprint *string `json:"certThumbprint,omitempty"` + // CertBlob - A certificate file (.cer) blob containing the public key of the private key used to authenticate a + // Point-To-Site VPN connection. + CertBlob *string `json:"certBlob,omitempty"` + // Routes - READ-ONLY; The routes that this Virtual Network connection uses. + Routes *[]VnetRoute `json:"routes,omitempty"` + // ResyncRequired - READ-ONLY; true if a resync is required; otherwise, false. + ResyncRequired *bool `json:"resyncRequired,omitempty"` + // DNSServers - DNS servers to be used by this Virtual Network. This should be a comma-separated list of IP addresses. + DNSServers *string `json:"dnsServers,omitempty"` + // IsSwift - Flag that is used to denote if this is VNET injection + IsSwift *bool `json:"isSwift,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetInfo. +func (vi VnetInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vi.VnetResourceID != nil { + objectMap["vnetResourceId"] = vi.VnetResourceID + } + if vi.CertBlob != nil { + objectMap["certBlob"] = vi.CertBlob + } + if vi.DNSServers != nil { + objectMap["dnsServers"] = vi.DNSServers + } + if vi.IsSwift != nil { + objectMap["isSwift"] = vi.IsSwift + } + return json.Marshal(objectMap) +} + +// VnetInfoResource virtual Network information ARM resource. +type VnetInfoResource struct { + autorest.Response `json:"-"` + // VnetInfo - Core resource properties + *VnetInfo `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetInfoResource. +func (vir VnetInfoResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vir.VnetInfo != nil { + objectMap["properties"] = vir.VnetInfo + } + if vir.Kind != nil { + objectMap["kind"] = vir.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VnetInfoResource struct. +func (vir *VnetInfoResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetInfo VnetInfo + err = json.Unmarshal(*v, &vnetInfo) + if err != nil { + return err + } + vir.VnetInfo = &vnetInfo + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vir.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vir.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vir.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vir.Type = &typeVar + } + } + } + + return nil +} + +// VnetParameters the required set of inputs to validate a VNET +type VnetParameters struct { + // VnetParametersProperties - VnetParameters resource specific properties + *VnetParametersProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetParameters. +func (vp VnetParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vp.VnetParametersProperties != nil { + objectMap["properties"] = vp.VnetParametersProperties + } + if vp.Kind != nil { + objectMap["kind"] = vp.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VnetParameters struct. +func (vp *VnetParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetParametersProperties VnetParametersProperties + err = json.Unmarshal(*v, &vnetParametersProperties) + if err != nil { + return err + } + vp.VnetParametersProperties = &vnetParametersProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vp.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vp.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vp.Type = &typeVar + } + } + } + + return nil +} + +// VnetParametersProperties vnetParameters resource specific properties +type VnetParametersProperties struct { + // VnetResourceGroup - The Resource Group of the VNET to be validated + VnetResourceGroup *string `json:"vnetResourceGroup,omitempty"` + // VnetName - The name of the VNET to be validated + VnetName *string `json:"vnetName,omitempty"` + // VnetSubnetName - The subnet name to be validated + VnetSubnetName *string `json:"vnetSubnetName,omitempty"` + // SubnetResourceID - The ARM Resource ID of the subnet to validate + SubnetResourceID *string `json:"subnetResourceId,omitempty"` +} + +// VnetRoute virtual Network route contract used to pass routing information for a Virtual Network. +type VnetRoute struct { + autorest.Response `json:"-"` + // VnetRouteProperties - VnetRoute resource specific properties + *VnetRouteProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetRoute. +func (vr VnetRoute) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vr.VnetRouteProperties != nil { + objectMap["properties"] = vr.VnetRouteProperties + } + if vr.Kind != nil { + objectMap["kind"] = vr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VnetRoute struct. +func (vr *VnetRoute) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetRouteProperties VnetRouteProperties + err = json.Unmarshal(*v, &vnetRouteProperties) + if err != nil { + return err + } + vr.VnetRouteProperties = &vnetRouteProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vr.Type = &typeVar + } + } + } + + return nil +} + +// VnetRouteProperties vnetRoute resource specific properties +type VnetRouteProperties struct { + // StartAddress - The starting address for this route. This may also include a CIDR notation, in which case the end address must not be specified. + StartAddress *string `json:"startAddress,omitempty"` + // EndAddress - The ending address for this route. If the start address is specified in CIDR notation, this must be omitted. + EndAddress *string `json:"endAddress,omitempty"` + // RouteType - The type of route this is: + // DEFAULT - By default, every app has routes to the local address ranges specified by RFC1918 + // INHERITED - Routes inherited from the real Virtual Network routes + // STATIC - Static route set on the app only + // These values will be used for syncing an app's routes with those from a Virtual Network. Possible values include: 'RouteTypeDEFAULT', 'RouteTypeINHERITED', 'RouteTypeSTATIC' + RouteType RouteType `json:"routeType,omitempty"` +} + +// VnetValidationFailureDetails a class that describes the reason for a validation failure. +type VnetValidationFailureDetails struct { + autorest.Response `json:"-"` + // VnetValidationFailureDetailsProperties - VnetValidationFailureDetails resource specific properties + *VnetValidationFailureDetailsProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetValidationFailureDetails. +func (vvfd VnetValidationFailureDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vvfd.VnetValidationFailureDetailsProperties != nil { + objectMap["properties"] = vvfd.VnetValidationFailureDetailsProperties + } + if vvfd.Kind != nil { + objectMap["kind"] = vvfd.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VnetValidationFailureDetails struct. +func (vvfd *VnetValidationFailureDetails) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetValidationFailureDetailsProperties VnetValidationFailureDetailsProperties + err = json.Unmarshal(*v, &vnetValidationFailureDetailsProperties) + if err != nil { + return err + } + vvfd.VnetValidationFailureDetailsProperties = &vnetValidationFailureDetailsProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vvfd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vvfd.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vvfd.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vvfd.Type = &typeVar + } + } + } + + return nil +} + +// VnetValidationFailureDetailsProperties vnetValidationFailureDetails resource specific properties +type VnetValidationFailureDetailsProperties struct { + // Message - Text describing the validation outcome. + Message *string `json:"message,omitempty"` + // Failed - A flag describing whether or not validation failed. + Failed *bool `json:"failed,omitempty"` + // FailedTests - A list of tests that failed in the validation. + FailedTests *[]VnetValidationTestFailure `json:"failedTests,omitempty"` + // Warnings - A list of warnings generated during validation. + Warnings *[]VnetValidationTestFailure `json:"warnings,omitempty"` +} + +// VnetValidationTestFailure a class that describes a test that failed during NSG and UDR validation. +type VnetValidationTestFailure struct { + // VnetValidationTestFailureProperties - VnetValidationTestFailure resource specific properties + *VnetValidationTestFailureProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VnetValidationTestFailure. +func (vvtf VnetValidationTestFailure) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vvtf.VnetValidationTestFailureProperties != nil { + objectMap["properties"] = vvtf.VnetValidationTestFailureProperties + } + if vvtf.Kind != nil { + objectMap["kind"] = vvtf.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VnetValidationTestFailure struct. +func (vvtf *VnetValidationTestFailure) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var vnetValidationTestFailureProperties VnetValidationTestFailureProperties + err = json.Unmarshal(*v, &vnetValidationTestFailureProperties) + if err != nil { + return err + } + vvtf.VnetValidationTestFailureProperties = &vnetValidationTestFailureProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + vvtf.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + vvtf.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + vvtf.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + vvtf.Type = &typeVar + } + } + } + + return nil +} + +// VnetValidationTestFailureProperties vnetValidationTestFailure resource specific properties +type VnetValidationTestFailureProperties struct { + // TestName - The name of the test that failed. + TestName *string `json:"testName,omitempty"` + // Details - The details of what caused the failure, e.g. the blocking rule name, etc. + Details *string `json:"details,omitempty"` +} + +// WindowsJavaContainerSettings windows Java Container settings. +type WindowsJavaContainerSettings struct { + // JavaContainer - READ-ONLY; Java container (runtime only). + JavaContainer *string `json:"javaContainer,omitempty"` + // JavaContainerVersion - READ-ONLY; Java container version (runtime only). + JavaContainerVersion *string `json:"javaContainerVersion,omitempty"` + // IsPreview - READ-ONLY; true if the stack is in preview; otherwise, false. + IsPreview *bool `json:"isPreview,omitempty"` + // IsDeprecated - READ-ONLY; true if the stack is deprecated; otherwise, false. + IsDeprecated *bool `json:"isDeprecated,omitempty"` + // IsHidden - READ-ONLY; true if the stack should be hidden; otherwise, false. + IsHidden *bool `json:"isHidden,omitempty"` + // EndOfLifeDate - READ-ONLY; End-of-life date for the minor version. + EndOfLifeDate *date.Time `json:"endOfLifeDate,omitempty"` + // IsAutoUpdate - READ-ONLY; true if the stack version is auto-updated; otherwise, false. + IsAutoUpdate *bool `json:"isAutoUpdate,omitempty"` + // IsEarlyAccess - READ-ONLY; true if the minor version is early-access; otherwise, false. + IsEarlyAccess *bool `json:"isEarlyAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for WindowsJavaContainerSettings. +func (wjcs WindowsJavaContainerSettings) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// WorkerPool worker pool of an App Service Environment. +type WorkerPool struct { + // WorkerSizeID - Worker size ID for referencing this worker pool. + WorkerSizeID *int32 `json:"workerSizeId,omitempty"` + // ComputeMode - Shared or dedicated app hosting. Possible values include: 'ComputeModeOptionsShared', 'ComputeModeOptionsDedicated', 'ComputeModeOptionsDynamic' + ComputeMode ComputeModeOptions `json:"computeMode,omitempty"` + // WorkerSize - VM size of the worker pool instances. + WorkerSize *string `json:"workerSize,omitempty"` + // WorkerCount - Number of instances in the worker pool. + WorkerCount *int32 `json:"workerCount,omitempty"` + // InstanceNames - READ-ONLY; Names of all instances in the worker pool (read only). + InstanceNames *[]string `json:"instanceNames,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkerPool. +func (wp WorkerPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.WorkerSizeID != nil { + objectMap["workerSizeId"] = wp.WorkerSizeID + } + if wp.ComputeMode != "" { + objectMap["computeMode"] = wp.ComputeMode + } + if wp.WorkerSize != nil { + objectMap["workerSize"] = wp.WorkerSize + } + if wp.WorkerCount != nil { + objectMap["workerCount"] = wp.WorkerCount + } + return json.Marshal(objectMap) +} + +// WorkerPoolCollection collection of worker pools. +type WorkerPoolCollection struct { + autorest.Response `json:"-"` + // Value - Collection of resources. + Value *[]WorkerPoolResource `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to next page of resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkerPoolCollection. +func (wpc WorkerPoolCollection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpc.Value != nil { + objectMap["value"] = wpc.Value + } + return json.Marshal(objectMap) +} + +// WorkerPoolCollectionIterator provides access to a complete listing of WorkerPoolResource values. +type WorkerPoolCollectionIterator struct { + i int + page WorkerPoolCollectionPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WorkerPoolCollectionIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkerPoolCollectionIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WorkerPoolCollectionIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WorkerPoolCollectionIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WorkerPoolCollectionIterator) Response() WorkerPoolCollection { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WorkerPoolCollectionIterator) Value() WorkerPoolResource { + if !iter.page.NotDone() { + return WorkerPoolResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WorkerPoolCollectionIterator type. +func NewWorkerPoolCollectionIterator(page WorkerPoolCollectionPage) WorkerPoolCollectionIterator { + return WorkerPoolCollectionIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wpc WorkerPoolCollection) IsEmpty() bool { + return wpc.Value == nil || len(*wpc.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wpc WorkerPoolCollection) hasNextLink() bool { + return wpc.NextLink != nil && len(*wpc.NextLink) != 0 +} + +// workerPoolCollectionPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wpc WorkerPoolCollection) workerPoolCollectionPreparer(ctx context.Context) (*http.Request, error) { + if !wpc.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wpc.NextLink))) +} + +// WorkerPoolCollectionPage contains a page of WorkerPoolResource values. +type WorkerPoolCollectionPage struct { + fn func(context.Context, WorkerPoolCollection) (WorkerPoolCollection, error) + wpc WorkerPoolCollection +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WorkerPoolCollectionPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WorkerPoolCollectionPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wpc) + if err != nil { + return err + } + page.wpc = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *WorkerPoolCollectionPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WorkerPoolCollectionPage) NotDone() bool { + return !page.wpc.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WorkerPoolCollectionPage) Response() WorkerPoolCollection { + return page.wpc +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WorkerPoolCollectionPage) Values() []WorkerPoolResource { + if page.wpc.IsEmpty() { + return nil + } + return *page.wpc.Value +} + +// Creates a new instance of the WorkerPoolCollectionPage type. +func NewWorkerPoolCollectionPage(cur WorkerPoolCollection, getNextPage func(context.Context, WorkerPoolCollection) (WorkerPoolCollection, error)) WorkerPoolCollectionPage { + return WorkerPoolCollectionPage{ + fn: getNextPage, + wpc: cur, + } +} + +// WorkerPoolResource worker pool of an App Service Environment ARM resource. +type WorkerPoolResource struct { + autorest.Response `json:"-"` + // WorkerPool - Core resource properties + *WorkerPool `json:"properties,omitempty"` + Sku *SkuDescription `json:"sku,omitempty"` + // ID - READ-ONLY; Resource Id. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Resource Name. + Name *string `json:"name,omitempty"` + // Kind - Kind of resource. + Kind *string `json:"kind,omitempty"` + // Type - READ-ONLY; Resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for WorkerPoolResource. +func (wpr WorkerPoolResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpr.WorkerPool != nil { + objectMap["properties"] = wpr.WorkerPool + } + if wpr.Sku != nil { + objectMap["sku"] = wpr.Sku + } + if wpr.Kind != nil { + objectMap["kind"] = wpr.Kind + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WorkerPoolResource struct. +func (wpr *WorkerPoolResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var workerPool WorkerPool + err = json.Unmarshal(*v, &workerPool) + if err != nil { + return err + } + wpr.WorkerPool = &workerPool + } + case "sku": + if v != nil { + var sku SkuDescription + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + wpr.Sku = &sku + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + wpr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + wpr.Name = &name + } + case "kind": + if v != nil { + var kind string + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + wpr.Kind = &kind + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + wpr.Type = &typeVar + } + } + } + + return nil +} diff --git a/services/web/mgmt/2021-03-01/web/provider.go b/services/web/mgmt/2021-03-01/web/provider.go new file mode 100644 index 000000000000..2628f62ea344 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/provider.go @@ -0,0 +1,836 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ProviderClient is the webSite Management Client +type ProviderClient struct { + BaseClient +} + +// NewProviderClient creates an instance of the ProviderClient client. +func NewProviderClient(subscriptionID string) ProviderClient { + return NewProviderClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewProviderClientWithBaseURI creates an instance of the ProviderClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewProviderClientWithBaseURI(baseURI string, subscriptionID string) ProviderClient { + return ProviderClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetAvailableStacks description for Get available application frameworks and their versions +func (client ProviderClient) GetAvailableStacks(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetAvailableStacks") + defer func() { + sc := -1 + if result.asc.Response.Response != nil { + sc = result.asc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getAvailableStacksNextResults + req, err := client.GetAvailableStacksPreparer(ctx, osTypeSelected) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacks", nil, "Failure preparing request") + return + } + + resp, err := client.GetAvailableStacksSender(req) + if err != nil { + result.asc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacks", resp, "Failure sending request") + return + } + + result.asc, err = client.GetAvailableStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacks", resp, "Failure responding to request") + return + } + if result.asc.hasNextLink() && result.asc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetAvailableStacksPreparer prepares the GetAvailableStacks request. +func (client ProviderClient) GetAvailableStacksPreparer(ctx context.Context, osTypeSelected string) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(osTypeSelected)) > 0 { + queryParameters["osTypeSelected"] = autorest.Encode("query", osTypeSelected) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/availableStacks"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAvailableStacksSender sends the GetAvailableStacks request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) GetAvailableStacksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetAvailableStacksResponder handles the response to the GetAvailableStacks request. The method always +// closes the http.Response Body. +func (client ProviderClient) GetAvailableStacksResponder(resp *http.Response) (result ApplicationStackCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getAvailableStacksNextResults retrieves the next set of results, if any. +func (client ProviderClient) getAvailableStacksNextResults(ctx context.Context, lastResults ApplicationStackCollection) (result ApplicationStackCollection, err error) { + req, err := lastResults.applicationStackCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetAvailableStacksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksNextResults", resp, "Failure sending next results request") + } + result, err = client.GetAvailableStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetAvailableStacksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetAvailableStacksComplete(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetAvailableStacks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetAvailableStacks(ctx, osTypeSelected) + return +} + +// GetAvailableStacksOnPrem description for Get available application frameworks and their versions +func (client ProviderClient) GetAvailableStacksOnPrem(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetAvailableStacksOnPrem") + defer func() { + sc := -1 + if result.asc.Response.Response != nil { + sc = result.asc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getAvailableStacksOnPremNextResults + req, err := client.GetAvailableStacksOnPremPreparer(ctx, osTypeSelected) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacksOnPrem", nil, "Failure preparing request") + return + } + + resp, err := client.GetAvailableStacksOnPremSender(req) + if err != nil { + result.asc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacksOnPrem", resp, "Failure sending request") + return + } + + result.asc, err = client.GetAvailableStacksOnPremResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetAvailableStacksOnPrem", resp, "Failure responding to request") + return + } + if result.asc.hasNextLink() && result.asc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetAvailableStacksOnPremPreparer prepares the GetAvailableStacksOnPrem request. +func (client ProviderClient) GetAvailableStacksOnPremPreparer(ctx context.Context, osTypeSelected string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(osTypeSelected)) > 0 { + queryParameters["osTypeSelected"] = autorest.Encode("query", osTypeSelected) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/availableStacks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetAvailableStacksOnPremSender sends the GetAvailableStacksOnPrem request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) GetAvailableStacksOnPremSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetAvailableStacksOnPremResponder handles the response to the GetAvailableStacksOnPrem request. The method always +// closes the http.Response Body. +func (client ProviderClient) GetAvailableStacksOnPremResponder(resp *http.Response) (result ApplicationStackCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getAvailableStacksOnPremNextResults retrieves the next set of results, if any. +func (client ProviderClient) getAvailableStacksOnPremNextResults(ctx context.Context, lastResults ApplicationStackCollection) (result ApplicationStackCollection, err error) { + req, err := lastResults.applicationStackCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksOnPremNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetAvailableStacksOnPremSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksOnPremNextResults", resp, "Failure sending next results request") + } + result, err = client.GetAvailableStacksOnPremResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getAvailableStacksOnPremNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetAvailableStacksOnPremComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetAvailableStacksOnPremComplete(ctx context.Context, osTypeSelected string) (result ApplicationStackCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetAvailableStacksOnPrem") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetAvailableStacksOnPrem(ctx, osTypeSelected) + return +} + +// GetFunctionAppStacks description for Get available Function app frameworks and their versions +// Parameters: +// stackOsType - stack OS Type +func (client ProviderClient) GetFunctionAppStacks(ctx context.Context, stackOsType string) (result FunctionAppStackCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetFunctionAppStacks") + defer func() { + sc := -1 + if result.fasc.Response.Response != nil { + sc = result.fasc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getFunctionAppStacksNextResults + req, err := client.GetFunctionAppStacksPreparer(ctx, stackOsType) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetFunctionAppStacks", nil, "Failure preparing request") + return + } + + resp, err := client.GetFunctionAppStacksSender(req) + if err != nil { + result.fasc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetFunctionAppStacks", resp, "Failure sending request") + return + } + + result.fasc, err = client.GetFunctionAppStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetFunctionAppStacks", resp, "Failure responding to request") + return + } + if result.fasc.hasNextLink() && result.fasc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetFunctionAppStacksPreparer prepares the GetFunctionAppStacks request. +func (client ProviderClient) GetFunctionAppStacksPreparer(ctx context.Context, stackOsType string) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(stackOsType)) > 0 { + queryParameters["stackOsType"] = autorest.Encode("query", stackOsType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/functionAppStacks"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFunctionAppStacksSender sends the GetFunctionAppStacks request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) GetFunctionAppStacksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetFunctionAppStacksResponder handles the response to the GetFunctionAppStacks request. The method always +// closes the http.Response Body. +func (client ProviderClient) GetFunctionAppStacksResponder(resp *http.Response) (result FunctionAppStackCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getFunctionAppStacksNextResults retrieves the next set of results, if any. +func (client ProviderClient) getFunctionAppStacksNextResults(ctx context.Context, lastResults FunctionAppStackCollection) (result FunctionAppStackCollection, err error) { + req, err := lastResults.functionAppStackCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getFunctionAppStacksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetFunctionAppStacksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getFunctionAppStacksNextResults", resp, "Failure sending next results request") + } + result, err = client.GetFunctionAppStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getFunctionAppStacksNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetFunctionAppStacksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetFunctionAppStacksComplete(ctx context.Context, stackOsType string) (result FunctionAppStackCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetFunctionAppStacks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetFunctionAppStacks(ctx, stackOsType) + return +} + +// GetFunctionAppStacksForLocation description for Get available Function app frameworks and their versions for +// location +// Parameters: +// location - function App stack location. +// stackOsType - stack OS Type +func (client ProviderClient) GetFunctionAppStacksForLocation(ctx context.Context, location string, stackOsType string) (result FunctionAppStackCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetFunctionAppStacksForLocation") + defer func() { + sc := -1 + if result.fasc.Response.Response != nil { + sc = result.fasc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getFunctionAppStacksForLocationNextResults + req, err := client.GetFunctionAppStacksForLocationPreparer(ctx, location, stackOsType) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetFunctionAppStacksForLocation", nil, "Failure preparing request") + return + } + + resp, err := client.GetFunctionAppStacksForLocationSender(req) + if err != nil { + result.fasc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetFunctionAppStacksForLocation", resp, "Failure sending request") + return + } + + result.fasc, err = client.GetFunctionAppStacksForLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetFunctionAppStacksForLocation", resp, "Failure responding to request") + return + } + if result.fasc.hasNextLink() && result.fasc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetFunctionAppStacksForLocationPreparer prepares the GetFunctionAppStacksForLocation request. +func (client ProviderClient) GetFunctionAppStacksForLocationPreparer(ctx context.Context, location string, stackOsType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(stackOsType)) > 0 { + queryParameters["stackOsType"] = autorest.Encode("query", stackOsType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Web/locations/{location}/functionAppStacks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetFunctionAppStacksForLocationSender sends the GetFunctionAppStacksForLocation request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) GetFunctionAppStacksForLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetFunctionAppStacksForLocationResponder handles the response to the GetFunctionAppStacksForLocation request. The method always +// closes the http.Response Body. +func (client ProviderClient) GetFunctionAppStacksForLocationResponder(resp *http.Response) (result FunctionAppStackCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getFunctionAppStacksForLocationNextResults retrieves the next set of results, if any. +func (client ProviderClient) getFunctionAppStacksForLocationNextResults(ctx context.Context, lastResults FunctionAppStackCollection) (result FunctionAppStackCollection, err error) { + req, err := lastResults.functionAppStackCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getFunctionAppStacksForLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetFunctionAppStacksForLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getFunctionAppStacksForLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.GetFunctionAppStacksForLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getFunctionAppStacksForLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetFunctionAppStacksForLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetFunctionAppStacksForLocationComplete(ctx context.Context, location string, stackOsType string) (result FunctionAppStackCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetFunctionAppStacksForLocation") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetFunctionAppStacksForLocation(ctx, location, stackOsType) + return +} + +// GetWebAppStacks description for Get available Web app frameworks and their versions +// Parameters: +// stackOsType - stack OS Type +func (client ProviderClient) GetWebAppStacks(ctx context.Context, stackOsType string) (result AppStackCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetWebAppStacks") + defer func() { + sc := -1 + if result.asc.Response.Response != nil { + sc = result.asc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getWebAppStacksNextResults + req, err := client.GetWebAppStacksPreparer(ctx, stackOsType) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetWebAppStacks", nil, "Failure preparing request") + return + } + + resp, err := client.GetWebAppStacksSender(req) + if err != nil { + result.asc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetWebAppStacks", resp, "Failure sending request") + return + } + + result.asc, err = client.GetWebAppStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetWebAppStacks", resp, "Failure responding to request") + return + } + if result.asc.hasNextLink() && result.asc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetWebAppStacksPreparer prepares the GetWebAppStacks request. +func (client ProviderClient) GetWebAppStacksPreparer(ctx context.Context, stackOsType string) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(stackOsType)) > 0 { + queryParameters["stackOsType"] = autorest.Encode("query", stackOsType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/webAppStacks"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWebAppStacksSender sends the GetWebAppStacks request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) GetWebAppStacksSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetWebAppStacksResponder handles the response to the GetWebAppStacks request. The method always +// closes the http.Response Body. +func (client ProviderClient) GetWebAppStacksResponder(resp *http.Response) (result AppStackCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getWebAppStacksNextResults retrieves the next set of results, if any. +func (client ProviderClient) getWebAppStacksNextResults(ctx context.Context, lastResults AppStackCollection) (result AppStackCollection, err error) { + req, err := lastResults.appStackCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getWebAppStacksNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetWebAppStacksSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getWebAppStacksNextResults", resp, "Failure sending next results request") + } + result, err = client.GetWebAppStacksResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getWebAppStacksNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetWebAppStacksComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetWebAppStacksComplete(ctx context.Context, stackOsType string) (result AppStackCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetWebAppStacks") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetWebAppStacks(ctx, stackOsType) + return +} + +// GetWebAppStacksForLocation description for Get available Web app frameworks and their versions for location +// Parameters: +// location - web App stack location. +// stackOsType - stack OS Type +func (client ProviderClient) GetWebAppStacksForLocation(ctx context.Context, location string, stackOsType string) (result AppStackCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetWebAppStacksForLocation") + defer func() { + sc := -1 + if result.asc.Response.Response != nil { + sc = result.asc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getWebAppStacksForLocationNextResults + req, err := client.GetWebAppStacksForLocationPreparer(ctx, location, stackOsType) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetWebAppStacksForLocation", nil, "Failure preparing request") + return + } + + resp, err := client.GetWebAppStacksForLocationSender(req) + if err != nil { + result.asc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetWebAppStacksForLocation", resp, "Failure sending request") + return + } + + result.asc, err = client.GetWebAppStacksForLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "GetWebAppStacksForLocation", resp, "Failure responding to request") + return + } + if result.asc.hasNextLink() && result.asc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetWebAppStacksForLocationPreparer prepares the GetWebAppStacksForLocation request. +func (client ProviderClient) GetWebAppStacksForLocationPreparer(ctx context.Context, location string, stackOsType string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(string(stackOsType)) > 0 { + queryParameters["stackOsType"] = autorest.Encode("query", stackOsType) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/providers/Microsoft.Web/locations/{location}/webAppStacks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetWebAppStacksForLocationSender sends the GetWebAppStacksForLocation request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) GetWebAppStacksForLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// GetWebAppStacksForLocationResponder handles the response to the GetWebAppStacksForLocation request. The method always +// closes the http.Response Body. +func (client ProviderClient) GetWebAppStacksForLocationResponder(resp *http.Response) (result AppStackCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getWebAppStacksForLocationNextResults retrieves the next set of results, if any. +func (client ProviderClient) getWebAppStacksForLocationNextResults(ctx context.Context, lastResults AppStackCollection) (result AppStackCollection, err error) { + req, err := lastResults.appStackCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getWebAppStacksForLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetWebAppStacksForLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "getWebAppStacksForLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.GetWebAppStacksForLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "getWebAppStacksForLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetWebAppStacksForLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) GetWebAppStacksForLocationComplete(ctx context.Context, location string, stackOsType string) (result AppStackCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.GetWebAppStacksForLocation") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetWebAppStacksForLocation(ctx, location, stackOsType) + return +} + +// ListOperations description for Gets all available operations for the Microsoft.Web resource provider. Also exposes +// resource metric definitions +func (client ProviderClient) ListOperations(ctx context.Context) (result CsmOperationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.ListOperations") + defer func() { + sc := -1 + if result.coc.Response.Response != nil { + sc = result.coc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listOperationsNextResults + req, err := client.ListOperationsPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "ListOperations", nil, "Failure preparing request") + return + } + + resp, err := client.ListOperationsSender(req) + if err != nil { + result.coc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ProviderClient", "ListOperations", resp, "Failure sending request") + return + } + + result.coc, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "ListOperations", resp, "Failure responding to request") + return + } + if result.coc.hasNextLink() && result.coc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListOperationsPreparer prepares the ListOperations request. +func (client ProviderClient) ListOperationsPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Web/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListOperationsSender sends the ListOperations request. The method will close the +// http.Response Body if it receives an error. +func (client ProviderClient) ListOperationsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListOperationsResponder handles the response to the ListOperations request. The method always +// closes the http.Response Body. +func (client ProviderClient) ListOperationsResponder(resp *http.Response) (result CsmOperationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listOperationsNextResults retrieves the next set of results, if any. +func (client ProviderClient) listOperationsNextResults(ctx context.Context, lastResults CsmOperationCollection) (result CsmOperationCollection, err error) { + req, err := lastResults.csmOperationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "listOperationsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListOperationsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ProviderClient", "listOperationsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListOperationsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ProviderClient", "listOperationsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListOperationsComplete enumerates all values, automatically crossing page boundaries as required. +func (client ProviderClient) ListOperationsComplete(ctx context.Context) (result CsmOperationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ProviderClient.ListOperations") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListOperations(ctx) + return +} diff --git a/services/web/mgmt/2021-03-01/web/recommendations.go b/services/web/mgmt/2021-03-01/web/recommendations.go new file mode 100644 index 000000000000..ba4db5822305 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/recommendations.go @@ -0,0 +1,1543 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RecommendationsClient is the webSite Management Client +type RecommendationsClient struct { + BaseClient +} + +// NewRecommendationsClient creates an instance of the RecommendationsClient client. +func NewRecommendationsClient(subscriptionID string) RecommendationsClient { + return NewRecommendationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRecommendationsClientWithBaseURI creates an instance of the RecommendationsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRecommendationsClientWithBaseURI(baseURI string, subscriptionID string) RecommendationsClient { + return RecommendationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// DisableAllForHostingEnvironment description for Disable all recommendations for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// environmentName - name of the app. +func (client RecommendationsClient) DisableAllForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableAllForHostingEnvironment") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "DisableAllForHostingEnvironment", err.Error()) + } + + req, err := client.DisableAllForHostingEnvironmentPreparer(ctx, resourceGroupName, environmentName, hostingEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.DisableAllForHostingEnvironmentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.DisableAllForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForHostingEnvironment", resp, "Failure responding to request") + return + } + + return +} + +// DisableAllForHostingEnvironmentPreparer prepares the DisableAllForHostingEnvironment request. +func (client RecommendationsClient) DisableAllForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "environmentName": autorest.Encode("query", environmentName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableAllForHostingEnvironmentSender sends the DisableAllForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableAllForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableAllForHostingEnvironmentResponder handles the response to the DisableAllForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableAllForHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DisableAllForWebApp description for Disable all recommendations for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - name of the app. +func (client RecommendationsClient) DisableAllForWebApp(ctx context.Context, resourceGroupName string, siteName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableAllForWebApp") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "DisableAllForWebApp", err.Error()) + } + + req, err := client.DisableAllForWebAppPreparer(ctx, resourceGroupName, siteName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForWebApp", nil, "Failure preparing request") + return + } + + resp, err := client.DisableAllForWebAppSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForWebApp", resp, "Failure sending request") + return + } + + result, err = client.DisableAllForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableAllForWebApp", resp, "Failure responding to request") + return + } + + return +} + +// DisableAllForWebAppPreparer prepares the DisableAllForWebApp request. +func (client RecommendationsClient) DisableAllForWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableAllForWebAppSender sends the DisableAllForWebApp request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableAllForWebAppSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableAllForWebAppResponder handles the response to the DisableAllForWebApp request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableAllForWebAppResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DisableRecommendationForHostingEnvironment description for Disables the specific rule for a web site permanently. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// environmentName - site name +// name - rule name +func (client RecommendationsClient) DisableRecommendationForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableRecommendationForHostingEnvironment") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", err.Error()) + } + + req, err := client.DisableRecommendationForHostingEnvironmentPreparer(ctx, resourceGroupName, environmentName, name, hostingEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.DisableRecommendationForHostingEnvironmentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.DisableRecommendationForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForHostingEnvironment", resp, "Failure responding to request") + return + } + + return +} + +// DisableRecommendationForHostingEnvironmentPreparer prepares the DisableRecommendationForHostingEnvironment request. +func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "environmentName": autorest.Encode("query", environmentName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableRecommendationForHostingEnvironmentSender sends the DisableRecommendationForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableRecommendationForHostingEnvironmentResponder handles the response to the DisableRecommendationForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableRecommendationForHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DisableRecommendationForSite description for Disables the specific rule for a web site permanently. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - site name +// name - rule name +func (client RecommendationsClient) DisableRecommendationForSite(ctx context.Context, resourceGroupName string, siteName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableRecommendationForSite") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "DisableRecommendationForSite", err.Error()) + } + + req, err := client.DisableRecommendationForSitePreparer(ctx, resourceGroupName, siteName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", nil, "Failure preparing request") + return + } + + resp, err := client.DisableRecommendationForSiteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", resp, "Failure sending request") + return + } + + result, err = client.DisableRecommendationForSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSite", resp, "Failure responding to request") + return + } + + return +} + +// DisableRecommendationForSitePreparer prepares the DisableRecommendationForSite request. +func (client RecommendationsClient) DisableRecommendationForSitePreparer(ctx context.Context, resourceGroupName string, siteName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableRecommendationForSiteSender sends the DisableRecommendationForSite request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableRecommendationForSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableRecommendationForSiteResponder handles the response to the DisableRecommendationForSite request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableRecommendationForSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DisableRecommendationForSubscription description for Disables the specified rule so it will not apply to a +// subscription in the future. +// Parameters: +// name - rule name +func (client RecommendationsClient) DisableRecommendationForSubscription(ctx context.Context, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.DisableRecommendationForSubscription") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DisableRecommendationForSubscriptionPreparer(ctx, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", nil, "Failure preparing request") + return + } + + resp, err := client.DisableRecommendationForSubscriptionSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", resp, "Failure sending request") + return + } + + result, err = client.DisableRecommendationForSubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "DisableRecommendationForSubscription", resp, "Failure responding to request") + return + } + + return +} + +// DisableRecommendationForSubscriptionPreparer prepares the DisableRecommendationForSubscription request. +func (client RecommendationsClient) DisableRecommendationForSubscriptionPreparer(ctx context.Context, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/{name}/disable", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DisableRecommendationForSubscriptionSender sends the DisableRecommendationForSubscription request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) DisableRecommendationForSubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DisableRecommendationForSubscriptionResponder handles the response to the DisableRecommendationForSubscription request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) DisableRecommendationForSubscriptionResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetRuleDetailsByHostingEnvironment description for Get a recommendation rule for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// hostingEnvironmentName - name of the hosting environment. +// name - name of the recommendation. +// updateSeen - specify true to update the last-seen timestamp of the recommendation object. +// recommendationID - the GUID of the recommendation object if you query an expired one. You don't need to +// specify it to query an active entry. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, updateSeen *bool, recommendationID string) (result RecommendationRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.GetRuleDetailsByHostingEnvironment") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", err.Error()) + } + + req, err := client.GetRuleDetailsByHostingEnvironmentPreparer(ctx, resourceGroupName, hostingEnvironmentName, name, updateSeen, recommendationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.GetRuleDetailsByHostingEnvironmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.GetRuleDetailsByHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByHostingEnvironment", resp, "Failure responding to request") + return + } + + return +} + +// GetRuleDetailsByHostingEnvironmentPreparer prepares the GetRuleDetailsByHostingEnvironment request. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, updateSeen *bool, recommendationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if updateSeen != nil { + queryParameters["updateSeen"] = autorest.Encode("query", *updateSeen) + } + if len(recommendationID) > 0 { + queryParameters["recommendationId"] = autorest.Encode("query", recommendationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRuleDetailsByHostingEnvironmentSender sends the GetRuleDetailsByHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRuleDetailsByHostingEnvironmentResponder handles the response to the GetRuleDetailsByHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) GetRuleDetailsByHostingEnvironmentResponder(resp *http.Response) (result RecommendationRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetRuleDetailsByWebApp description for Get a recommendation rule for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - name of the app. +// name - name of the recommendation. +// updateSeen - specify true to update the last-seen timestamp of the recommendation object. +// recommendationID - the GUID of the recommendation object if you query an expired one. You don't need to +// specify it to query an active entry. +func (client RecommendationsClient) GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (result RecommendationRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.GetRuleDetailsByWebApp") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "GetRuleDetailsByWebApp", err.Error()) + } + + req, err := client.GetRuleDetailsByWebAppPreparer(ctx, resourceGroupName, siteName, name, updateSeen, recommendationID) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByWebApp", nil, "Failure preparing request") + return + } + + resp, err := client.GetRuleDetailsByWebAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByWebApp", resp, "Failure sending request") + return + } + + result, err = client.GetRuleDetailsByWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "GetRuleDetailsByWebApp", resp, "Failure responding to request") + return + } + + return +} + +// GetRuleDetailsByWebAppPreparer prepares the GetRuleDetailsByWebApp request. +func (client RecommendationsClient) GetRuleDetailsByWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if updateSeen != nil { + queryParameters["updateSeen"] = autorest.Encode("query", *updateSeen) + } + if len(recommendationID) > 0 { + queryParameters["recommendationId"] = autorest.Encode("query", recommendationID) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetRuleDetailsByWebAppSender sends the GetRuleDetailsByWebApp request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) GetRuleDetailsByWebAppSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetRuleDetailsByWebAppResponder handles the response to the GetRuleDetailsByWebApp request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) GetRuleDetailsByWebAppResponder(resp *http.Response) (result RecommendationRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for List all recommendations for a subscription. +// Parameters: +// featured - specify true to return only the most critical recommendations. The default is +// false, which returns all recommendations. +// filter - filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq +// 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq +// duration'[PT1H|PT1M|P1D] +func (client RecommendationsClient) List(ctx context.Context, featured *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.List") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, featured, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", resp, "Failure sending request") + return + } + + result.rc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "List", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RecommendationsClient) ListPreparer(ctx context.Context, featured *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if featured != nil { + queryParameters["featured"] = autorest.Encode("query", *featured) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListComplete(ctx context.Context, featured *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, featured, filter) + return +} + +// ListHistoryForHostingEnvironment description for Get past recommendations for an app, optionally specified by the +// time range. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// hostingEnvironmentName - name of the hosting environment. +// expiredOnly - specify false to return all recommendations. The default is true, +// which returns only expired recommendations. +// filter - filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq +// 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq +// duration'[PT1H|PT1M|P1D] +func (client RecommendationsClient) ListHistoryForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListHistoryForHostingEnvironment") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ListHistoryForHostingEnvironment", err.Error()) + } + + result.fn = client.listHistoryForHostingEnvironmentNextResults + req, err := client.ListHistoryForHostingEnvironmentPreparer(ctx, resourceGroupName, hostingEnvironmentName, expiredOnly, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.ListHistoryForHostingEnvironmentSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForHostingEnvironment", resp, "Failure sending request") + return + } + + result.rc, err = client.ListHistoryForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForHostingEnvironment", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListHistoryForHostingEnvironmentPreparer prepares the ListHistoryForHostingEnvironment request. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if expiredOnly != nil { + queryParameters["expiredOnly"] = autorest.Encode("query", *expiredOnly) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendationHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHistoryForHostingEnvironmentSender sends the ListHistoryForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHistoryForHostingEnvironmentResponder handles the response to the ListHistoryForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHistoryForHostingEnvironmentNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listHistoryForHostingEnvironmentNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForHostingEnvironmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHistoryForHostingEnvironmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForHostingEnvironmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHistoryForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForHostingEnvironmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHistoryForHostingEnvironmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListHistoryForHostingEnvironmentComplete(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListHistoryForHostingEnvironment") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListHistoryForHostingEnvironment(ctx, resourceGroupName, hostingEnvironmentName, expiredOnly, filter) + return +} + +// ListHistoryForWebApp description for Get past recommendations for an app, optionally specified by the time range. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - name of the app. +// expiredOnly - specify false to return all recommendations. The default is true, +// which returns only expired recommendations. +// filter - filter is specified by using OData syntax. Example: $filter=channel eq 'Api' or channel eq +// 'Notification' and startTime eq 2014-01-01T00:00:00Z and endTime eq 2014-12-31T23:59:59Z and timeGrain eq +// duration'[PT1H|PT1M|P1D] +func (client RecommendationsClient) ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, expiredOnly *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListHistoryForWebApp") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ListHistoryForWebApp", err.Error()) + } + + result.fn = client.listHistoryForWebAppNextResults + req, err := client.ListHistoryForWebAppPreparer(ctx, resourceGroupName, siteName, expiredOnly, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", nil, "Failure preparing request") + return + } + + resp, err := client.ListHistoryForWebAppSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", resp, "Failure sending request") + return + } + + result.rc, err = client.ListHistoryForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListHistoryForWebApp", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListHistoryForWebAppPreparer prepares the ListHistoryForWebApp request. +func (client RecommendationsClient) ListHistoryForWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, expiredOnly *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if expiredOnly != nil { + queryParameters["expiredOnly"] = autorest.Encode("query", *expiredOnly) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendationHistory", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListHistoryForWebAppSender sends the ListHistoryForWebApp request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListHistoryForWebAppSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListHistoryForWebAppResponder handles the response to the ListHistoryForWebApp request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListHistoryForWebAppResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listHistoryForWebAppNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listHistoryForWebAppNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListHistoryForWebAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", resp, "Failure sending next results request") + } + result, err = client.ListHistoryForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listHistoryForWebAppNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListHistoryForWebAppComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListHistoryForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, expiredOnly *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListHistoryForWebApp") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListHistoryForWebApp(ctx, resourceGroupName, siteName, expiredOnly, filter) + return +} + +// ListRecommendedRulesForHostingEnvironment description for Get all recommendations for a hosting environment. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// hostingEnvironmentName - name of the app. +// featured - specify true to return only the most critical recommendations. The default is +// false, which returns all recommendations. +// filter - return only channels specified in the filter. Filter is specified by using OData syntax. Example: +// $filter=channel eq 'Api' or channel eq 'Notification' +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListRecommendedRulesForHostingEnvironment") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", err.Error()) + } + + result.fn = client.listRecommendedRulesForHostingEnvironmentNextResults + req, err := client.ListRecommendedRulesForHostingEnvironmentPreparer(ctx, resourceGroupName, hostingEnvironmentName, featured, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.ListRecommendedRulesForHostingEnvironmentSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", resp, "Failure sending request") + return + } + + result.rc, err = client.ListRecommendedRulesForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForHostingEnvironment", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListRecommendedRulesForHostingEnvironmentPreparer prepares the ListRecommendedRulesForHostingEnvironment request. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if featured != nil { + queryParameters["featured"] = autorest.Encode("query", *featured) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRecommendedRulesForHostingEnvironmentSender sends the ListRecommendedRulesForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRecommendedRulesForHostingEnvironmentResponder handles the response to the ListRecommendedRulesForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listRecommendedRulesForHostingEnvironmentNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listRecommendedRulesForHostingEnvironmentNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForHostingEnvironmentNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListRecommendedRulesForHostingEnvironmentSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForHostingEnvironmentNextResults", resp, "Failure sending next results request") + } + result, err = client.ListRecommendedRulesForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForHostingEnvironmentNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListRecommendedRulesForHostingEnvironmentComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListRecommendedRulesForHostingEnvironmentComplete(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListRecommendedRulesForHostingEnvironment") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListRecommendedRulesForHostingEnvironment(ctx, resourceGroupName, hostingEnvironmentName, featured, filter) + return +} + +// ListRecommendedRulesForWebApp description for Get all recommendations for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - name of the app. +// featured - specify true to return only the most critical recommendations. The default is +// false, which returns all recommendations. +// filter - return only channels specified in the filter. Filter is specified by using OData syntax. Example: +// $filter=channel eq 'Api' or channel eq 'Notification' +func (client RecommendationsClient) ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result RecommendationCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListRecommendedRulesForWebApp") + defer func() { + sc := -1 + if result.rc.Response.Response != nil { + sc = result.rc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ListRecommendedRulesForWebApp", err.Error()) + } + + result.fn = client.listRecommendedRulesForWebAppNextResults + req, err := client.ListRecommendedRulesForWebAppPreparer(ctx, resourceGroupName, siteName, featured, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", nil, "Failure preparing request") + return + } + + resp, err := client.ListRecommendedRulesForWebAppSender(req) + if err != nil { + result.rc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", resp, "Failure sending request") + return + } + + result.rc, err = client.ListRecommendedRulesForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ListRecommendedRulesForWebApp", resp, "Failure responding to request") + return + } + if result.rc.hasNextLink() && result.rc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListRecommendedRulesForWebAppPreparer prepares the ListRecommendedRulesForWebApp request. +func (client RecommendationsClient) ListRecommendedRulesForWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if featured != nil { + queryParameters["featured"] = autorest.Encode("query", *featured) + } + if len(filter) > 0 { + queryParameters["$filter"] = filter + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListRecommendedRulesForWebAppSender sends the ListRecommendedRulesForWebApp request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ListRecommendedRulesForWebAppSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListRecommendedRulesForWebAppResponder handles the response to the ListRecommendedRulesForWebApp request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ListRecommendedRulesForWebAppResponder(resp *http.Response) (result RecommendationCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listRecommendedRulesForWebAppNextResults retrieves the next set of results, if any. +func (client RecommendationsClient) listRecommendedRulesForWebAppNextResults(ctx context.Context, lastResults RecommendationCollection) (result RecommendationCollection, err error) { + req, err := lastResults.recommendationCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListRecommendedRulesForWebAppSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", resp, "Failure sending next results request") + } + result, err = client.ListRecommendedRulesForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "listRecommendedRulesForWebAppNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListRecommendedRulesForWebAppComplete enumerates all values, automatically crossing page boundaries as required. +func (client RecommendationsClient) ListRecommendedRulesForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result RecommendationCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ListRecommendedRulesForWebApp") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListRecommendedRulesForWebApp(ctx, resourceGroupName, siteName, featured, filter) + return +} + +// ResetAllFilters description for Reset all recommendation opt-out settings for a subscription. +func (client RecommendationsClient) ResetAllFilters(ctx context.Context) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ResetAllFilters") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ResetAllFiltersPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFilters", nil, "Failure preparing request") + return + } + + resp, err := client.ResetAllFiltersSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFilters", resp, "Failure sending request") + return + } + + result, err = client.ResetAllFiltersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFilters", resp, "Failure responding to request") + return + } + + return +} + +// ResetAllFiltersPreparer prepares the ResetAllFilters request. +func (client RecommendationsClient) ResetAllFiltersPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/recommendations/reset", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAllFiltersSender sends the ResetAllFilters request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ResetAllFiltersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetAllFiltersResponder handles the response to the ResetAllFilters request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ResetAllFiltersResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetAllFiltersForHostingEnvironment description for Reset all recommendation opt-out settings for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// environmentName - name of the app. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ResetAllFiltersForHostingEnvironment") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", err.Error()) + } + + req, err := client.ResetAllFiltersForHostingEnvironmentPreparer(ctx, resourceGroupName, environmentName, hostingEnvironmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", nil, "Failure preparing request") + return + } + + resp, err := client.ResetAllFiltersForHostingEnvironmentSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", resp, "Failure sending request") + return + } + + result, err = client.ResetAllFiltersForHostingEnvironmentResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForHostingEnvironment", resp, "Failure responding to request") + return + } + + return +} + +// ResetAllFiltersForHostingEnvironmentPreparer prepares the ResetAllFiltersForHostingEnvironment request. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentPreparer(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "hostingEnvironmentName": autorest.Encode("path", hostingEnvironmentName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + "environmentName": autorest.Encode("query", environmentName), + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/hostingEnvironments/{hostingEnvironmentName}/recommendations/reset", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAllFiltersForHostingEnvironmentSender sends the ResetAllFiltersForHostingEnvironment request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetAllFiltersForHostingEnvironmentResponder handles the response to the ResetAllFiltersForHostingEnvironment request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ResetAllFiltersForHostingEnvironmentResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetAllFiltersForWebApp description for Reset all recommendation opt-out settings for an app. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// siteName - name of the app. +func (client RecommendationsClient) ResetAllFiltersForWebApp(ctx context.Context, resourceGroupName string, siteName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RecommendationsClient.ResetAllFiltersForWebApp") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.RecommendationsClient", "ResetAllFiltersForWebApp", err.Error()) + } + + req, err := client.ResetAllFiltersForWebAppPreparer(ctx, resourceGroupName, siteName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForWebApp", nil, "Failure preparing request") + return + } + + resp, err := client.ResetAllFiltersForWebAppSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForWebApp", resp, "Failure sending request") + return + } + + result, err = client.ResetAllFiltersForWebAppResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.RecommendationsClient", "ResetAllFiltersForWebApp", resp, "Failure responding to request") + return + } + + return +} + +// ResetAllFiltersForWebAppPreparer prepares the ResetAllFiltersForWebApp request. +func (client RecommendationsClient) ResetAllFiltersForWebAppPreparer(ctx context.Context, resourceGroupName string, siteName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "siteName": autorest.Encode("path", siteName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{siteName}/recommendations/reset", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetAllFiltersForWebAppSender sends the ResetAllFiltersForWebApp request. The method will close the +// http.Response Body if it receives an error. +func (client RecommendationsClient) ResetAllFiltersForWebAppSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetAllFiltersForWebAppResponder handles the response to the ResetAllFiltersForWebApp request. The method always +// closes the http.Response Body. +func (client RecommendationsClient) ResetAllFiltersForWebAppResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/web/mgmt/2021-03-01/web/resourcehealthmetadata.go b/services/web/mgmt/2021-03-01/web/resourcehealthmetadata.go new file mode 100644 index 000000000000..ab5b103ac541 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/resourcehealthmetadata.go @@ -0,0 +1,695 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceHealthMetadataClient is the webSite Management Client +type ResourceHealthMetadataClient struct { + BaseClient +} + +// NewResourceHealthMetadataClient creates an instance of the ResourceHealthMetadataClient client. +func NewResourceHealthMetadataClient(subscriptionID string) ResourceHealthMetadataClient { + return NewResourceHealthMetadataClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceHealthMetadataClientWithBaseURI creates an instance of the ResourceHealthMetadataClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewResourceHealthMetadataClientWithBaseURI(baseURI string, subscriptionID string) ResourceHealthMetadataClient { + return ResourceHealthMetadataClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetBySite description for Gets the category of ResourceHealthMetadata to use for the given site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app +func (client ResourceHealthMetadataClient) GetBySite(ctx context.Context, resourceGroupName string, name string) (result ResourceHealthMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.GetBySite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ResourceHealthMetadataClient", "GetBySite", err.Error()) + } + + req, err := client.GetBySitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "GetBySite", nil, "Failure preparing request") + return + } + + resp, err := client.GetBySiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "GetBySite", resp, "Failure sending request") + return + } + + result, err = client.GetBySiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "GetBySite", resp, "Failure responding to request") + return + } + + return +} + +// GetBySitePreparer prepares the GetBySite request. +func (client ResourceHealthMetadataClient) GetBySitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBySiteSender sends the GetBySite request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceHealthMetadataClient) GetBySiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBySiteResponder handles the response to the GetBySite request. The method always +// closes the http.Response Body. +func (client ResourceHealthMetadataClient) GetBySiteResponder(resp *http.Response) (result ResourceHealthMetadata, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBySiteSlot description for Gets the category of ResourceHealthMetadata to use for the given site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app +// slot - name of web app slot. If not specified then will default to production slot. +func (client ResourceHealthMetadataClient) GetBySiteSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ResourceHealthMetadata, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.GetBySiteSlot") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ResourceHealthMetadataClient", "GetBySiteSlot", err.Error()) + } + + req, err := client.GetBySiteSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "GetBySiteSlot", nil, "Failure preparing request") + return + } + + resp, err := client.GetBySiteSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "GetBySiteSlot", resp, "Failure sending request") + return + } + + result, err = client.GetBySiteSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "GetBySiteSlot", resp, "Failure responding to request") + return + } + + return +} + +// GetBySiteSlotPreparer prepares the GetBySiteSlot request. +func (client ResourceHealthMetadataClient) GetBySiteSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata/default", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBySiteSlotSender sends the GetBySiteSlot request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceHealthMetadataClient) GetBySiteSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBySiteSlotResponder handles the response to the GetBySiteSlot request. The method always +// closes the http.Response Body. +func (client ResourceHealthMetadataClient) GetBySiteSlotResponder(resp *http.Response) (result ResourceHealthMetadata, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for List all ResourceHealthMetadata for all sites in the subscription. +func (client ResourceHealthMetadataClient) List(ctx context.Context) (result ResourceHealthMetadataCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.List") + defer func() { + sc := -1 + if result.rhmc.Response.Response != nil { + sc = result.rhmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rhmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "List", resp, "Failure sending request") + return + } + + result.rhmc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "List", resp, "Failure responding to request") + return + } + if result.rhmc.hasNextLink() && result.rhmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ResourceHealthMetadataClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/resourceHealthMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceHealthMetadataClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ResourceHealthMetadataClient) ListResponder(resp *http.Response) (result ResourceHealthMetadataCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ResourceHealthMetadataClient) listNextResults(ctx context.Context, lastResults ResourceHealthMetadataCollection) (result ResourceHealthMetadataCollection, err error) { + req, err := lastResults.resourceHealthMetadataCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceHealthMetadataClient) ListComplete(ctx context.Context) (result ResourceHealthMetadataCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup description for List all ResourceHealthMetadata for all sites in the resource group in the +// subscription. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client ResourceHealthMetadataClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result ResourceHealthMetadataCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.rhmc.Response.Response != nil { + sc = result.rhmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ResourceHealthMetadataClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.rhmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.rhmc, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.rhmc.hasNextLink() && result.rhmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client ResourceHealthMetadataClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/resourceHealthMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceHealthMetadataClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client ResourceHealthMetadataClient) ListByResourceGroupResponder(resp *http.Response) (result ResourceHealthMetadataCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client ResourceHealthMetadataClient) listByResourceGroupNextResults(ctx context.Context, lastResults ResourceHealthMetadataCollection) (result ResourceHealthMetadataCollection, err error) { + req, err := lastResults.resourceHealthMetadataCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceHealthMetadataClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result ResourceHealthMetadataCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySite description for Gets the category of ResourceHealthMetadata to use for the given site as a collection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +func (client ResourceHealthMetadataClient) ListBySite(ctx context.Context, resourceGroupName string, name string) (result ResourceHealthMetadataCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.ListBySite") + defer func() { + sc := -1 + if result.rhmc.Response.Response != nil { + sc = result.rhmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ResourceHealthMetadataClient", "ListBySite", err.Error()) + } + + result.fn = client.listBySiteNextResults + req, err := client.ListBySitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListBySite", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySiteSender(req) + if err != nil { + result.rhmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListBySite", resp, "Failure sending request") + return + } + + result.rhmc, err = client.ListBySiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListBySite", resp, "Failure responding to request") + return + } + if result.rhmc.hasNextLink() && result.rhmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySitePreparer prepares the ListBySite request. +func (client ResourceHealthMetadataClient) ListBySitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/resourceHealthMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySiteSender sends the ListBySite request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceHealthMetadataClient) ListBySiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySiteResponder handles the response to the ListBySite request. The method always +// closes the http.Response Body. +func (client ResourceHealthMetadataClient) ListBySiteResponder(resp *http.Response) (result ResourceHealthMetadataCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySiteNextResults retrieves the next set of results, if any. +func (client ResourceHealthMetadataClient) listBySiteNextResults(ctx context.Context, lastResults ResourceHealthMetadataCollection) (result ResourceHealthMetadataCollection, err error) { + req, err := lastResults.resourceHealthMetadataCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listBySiteNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listBySiteNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listBySiteNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySiteComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceHealthMetadataClient) ListBySiteComplete(ctx context.Context, resourceGroupName string, name string) (result ResourceHealthMetadataCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.ListBySite") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySite(ctx, resourceGroupName, name) + return +} + +// ListBySiteSlot description for Gets the category of ResourceHealthMetadata to use for the given site as a collection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of web app. +// slot - name of web app slot. If not specified then will default to production slot. +func (client ResourceHealthMetadataClient) ListBySiteSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result ResourceHealthMetadataCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.ListBySiteSlot") + defer func() { + sc := -1 + if result.rhmc.Response.Response != nil { + sc = result.rhmc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.ResourceHealthMetadataClient", "ListBySiteSlot", err.Error()) + } + + result.fn = client.listBySiteSlotNextResults + req, err := client.ListBySiteSlotPreparer(ctx, resourceGroupName, name, slot) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListBySiteSlot", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySiteSlotSender(req) + if err != nil { + result.rhmc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListBySiteSlot", resp, "Failure sending request") + return + } + + result.rhmc, err = client.ListBySiteSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "ListBySiteSlot", resp, "Failure responding to request") + return + } + if result.rhmc.hasNextLink() && result.rhmc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySiteSlotPreparer prepares the ListBySiteSlot request. +func (client ResourceHealthMetadataClient) ListBySiteSlotPreparer(ctx context.Context, resourceGroupName string, name string, slot string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "slot": autorest.Encode("path", slot), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/sites/{name}/slots/{slot}/resourceHealthMetadata", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySiteSlotSender sends the ListBySiteSlot request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceHealthMetadataClient) ListBySiteSlotSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySiteSlotResponder handles the response to the ListBySiteSlot request. The method always +// closes the http.Response Body. +func (client ResourceHealthMetadataClient) ListBySiteSlotResponder(resp *http.Response) (result ResourceHealthMetadataCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySiteSlotNextResults retrieves the next set of results, if any. +func (client ResourceHealthMetadataClient) listBySiteSlotNextResults(ctx context.Context, lastResults ResourceHealthMetadataCollection) (result ResourceHealthMetadataCollection, err error) { + req, err := lastResults.resourceHealthMetadataCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listBySiteSlotNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySiteSlotSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listBySiteSlotNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySiteSlotResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.ResourceHealthMetadataClient", "listBySiteSlotNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySiteSlotComplete enumerates all values, automatically crossing page boundaries as required. +func (client ResourceHealthMetadataClient) ListBySiteSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result ResourceHealthMetadataCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceHealthMetadataClient.ListBySiteSlot") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySiteSlot(ctx, resourceGroupName, name, slot) + return +} diff --git a/services/web/mgmt/2021-03-01/web/staticsites.go b/services/web/mgmt/2021-03-01/web/staticsites.go new file mode 100644 index 000000000000..1019f5b91c9d --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/staticsites.go @@ -0,0 +1,4631 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// StaticSitesClient is the webSite Management Client +type StaticSitesClient struct { + BaseClient +} + +// NewStaticSitesClient creates an instance of the StaticSitesClient client. +func NewStaticSitesClient(subscriptionID string) StaticSitesClient { + return NewStaticSitesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewStaticSitesClientWithBaseURI creates an instance of the StaticSitesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewStaticSitesClientWithBaseURI(baseURI string, subscriptionID string) StaticSitesClient { + return StaticSitesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ApproveOrRejectPrivateEndpointConnection description for Approves or rejects a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// privateEndpointConnectionName - name of the private endpoint connection. +// privateEndpointWrapper - request body. +func (client StaticSitesClient) ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (result StaticSitesApproveOrRejectPrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ApproveOrRejectPrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ApproveOrRejectPrivateEndpointConnection", err.Error()) + } + + req, err := client.ApproveOrRejectPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName, privateEndpointWrapper) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ApproveOrRejectPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.ApproveOrRejectPrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ApproveOrRejectPrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// ApproveOrRejectPrivateEndpointConnectionPreparer prepares the ApproveOrRejectPrivateEndpointConnection request. +func (client StaticSitesClient) ApproveOrRejectPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper PrivateLinkConnectionApprovalRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointWrapper), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ApproveOrRejectPrivateEndpointConnectionSender sends the ApproveOrRejectPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ApproveOrRejectPrivateEndpointConnectionSender(req *http.Request) (future StaticSitesApproveOrRejectPrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ApproveOrRejectPrivateEndpointConnectionResponder handles the response to the ApproveOrRejectPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ApproveOrRejectPrivateEndpointConnectionResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSite description for Creates a new static site in an existing resource group, or updates an +// existing static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to create or update. +// staticSiteEnvelope - a JSON representation of the staticsite properties. See example. +func (client StaticSitesClient) CreateOrUpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource) (result StaticSitesCreateOrUpdateStaticSiteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSite", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSitePreparer(ctx, resourceGroupName, name, staticSiteEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSite", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateStaticSiteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSite", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateStaticSitePreparer prepares the CreateOrUpdateStaticSite request. +func (client StaticSitesClient) CreateOrUpdateStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSiteARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithJSON(staticSiteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteSender sends the CreateOrUpdateStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteSender(req *http.Request) (future StaticSitesCreateOrUpdateStaticSiteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateStaticSiteResponder handles the response to the CreateOrUpdateStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteResponder(resp *http.Response) (result StaticSiteARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteAppSettings description for Creates or updates the app settings of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// appSettings - the dictionary containing the static site app settings to update. +func (client StaticSitesClient) CreateOrUpdateStaticSiteAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteAppSettings", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteAppSettingsPreparer(ctx, resourceGroupName, name, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteAppSettings", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateStaticSiteAppSettingsPreparer prepares the CreateOrUpdateStaticSiteAppSettings request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/appsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteAppSettingsSender sends the CreateOrUpdateStaticSiteAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteAppSettingsResponder handles the response to the CreateOrUpdateStaticSiteAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteBuildAppSettings description for Creates or updates the app settings of a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +// appSettings - the dictionary containing the static site app settings to update. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteBuildAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildAppSettings", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteBuildAppSettingsPreparer(ctx, resourceGroupName, name, environmentName, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteBuildAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildAppSettings", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteBuildAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateStaticSiteBuildAppSettingsPreparer prepares the CreateOrUpdateStaticSiteBuildAppSettings request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/appsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteBuildAppSettingsSender sends the CreateOrUpdateStaticSiteBuildAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteBuildAppSettingsResponder handles the response to the CreateOrUpdateStaticSiteBuildAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettings description for Creates or updates the function app settings of a +// static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +// appSettings - the dictionary containing the static site function app settings to update. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteBuildFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteBuildFunctionAppSettingsPreparer(ctx, resourceGroupName, name, environmentName, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteBuildFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteBuildFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteBuildFunctionAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettingsPreparer prepares the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/config/functionappsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettingsSender sends the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteBuildFunctionAppSettingsResponder handles the response to the CreateOrUpdateStaticSiteBuildFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteBuildFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteCustomDomain description for Creates a new static site custom domain in an existing resource +// group and static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// domainName - the custom domain to create. +// staticSiteCustomDomainRequestPropertiesEnvelope - a JSON representation of the static site custom domain +// request properties. See example. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource) (result StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteCustomDomain") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteCustomDomainPreparer(ctx, resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateStaticSiteCustomDomainSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteCustomDomain", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdateStaticSiteCustomDomainPreparer prepares the CreateOrUpdateStaticSiteCustomDomain request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainPreparer(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}", pathParameters), + autorest.WithJSON(staticSiteCustomDomainRequestPropertiesEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteCustomDomainSender sends the CreateOrUpdateStaticSiteCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainSender(req *http.Request) (future StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateStaticSiteCustomDomainResponder handles the response to the CreateOrUpdateStaticSiteCustomDomain request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteCustomDomainResponder(resp *http.Response) (result StaticSiteCustomDomainOverviewARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdateStaticSiteFunctionAppSettings description for Creates or updates the function app settings of a static +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// appSettings - the dictionary containing the static site function app settings to update. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateOrUpdateStaticSiteFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", err.Error()) + } + + req, err := client.CreateOrUpdateStaticSiteFunctionAppSettingsPreparer(ctx, resourceGroupName, name, appSettings) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateStaticSiteFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateStaticSiteFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateOrUpdateStaticSiteFunctionAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdateStaticSiteFunctionAppSettingsPreparer prepares the CreateOrUpdateStaticSiteFunctionAppSettings request. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, appSettings StringDictionary) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/config/functionappsettings", pathParameters), + autorest.WithJSON(appSettings), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateStaticSiteFunctionAppSettingsSender sends the CreateOrUpdateStaticSiteFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateStaticSiteFunctionAppSettingsResponder handles the response to the CreateOrUpdateStaticSiteFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateOrUpdateStaticSiteFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateUserRolesInvitationLink description for Creates an invitation link for a user with the role +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) CreateUserRolesInvitationLink(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope StaticSiteUserInvitationRequestResource) (result StaticSiteUserInvitationResponseResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateUserRolesInvitationLink") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateUserRolesInvitationLink", err.Error()) + } + + req, err := client.CreateUserRolesInvitationLinkPreparer(ctx, resourceGroupName, name, staticSiteUserRolesInvitationEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateUserRolesInvitationLink", nil, "Failure preparing request") + return + } + + resp, err := client.CreateUserRolesInvitationLinkSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateUserRolesInvitationLink", resp, "Failure sending request") + return + } + + result, err = client.CreateUserRolesInvitationLinkResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateUserRolesInvitationLink", resp, "Failure responding to request") + return + } + + return +} + +// CreateUserRolesInvitationLinkPreparer prepares the CreateUserRolesInvitationLink request. +func (client StaticSitesClient) CreateUserRolesInvitationLinkPreparer(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope StaticSiteUserInvitationRequestResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/createUserInvitation", pathParameters), + autorest.WithJSON(staticSiteUserRolesInvitationEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateUserRolesInvitationLinkSender sends the CreateUserRolesInvitationLink request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateUserRolesInvitationLinkSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateUserRolesInvitationLinkResponder handles the response to the CreateUserRolesInvitationLink request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateUserRolesInvitationLinkResponder(resp *http.Response) (result StaticSiteUserInvitationResponseResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateZipDeploymentForStaticSite description for Deploys zipped content to a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// staticSiteZipDeploymentEnvelope - a JSON representation of the StaticSiteZipDeployment properties. See +// example. +func (client StaticSitesClient) CreateZipDeploymentForStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource) (result StaticSitesCreateZipDeploymentForStaticSiteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateZipDeploymentForStaticSite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateZipDeploymentForStaticSite", err.Error()) + } + + req, err := client.CreateZipDeploymentForStaticSitePreparer(ctx, resourceGroupName, name, staticSiteZipDeploymentEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateZipDeploymentForStaticSite", nil, "Failure preparing request") + return + } + + result, err = client.CreateZipDeploymentForStaticSiteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateZipDeploymentForStaticSite", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateZipDeploymentForStaticSitePreparer prepares the CreateZipDeploymentForStaticSite request. +func (client StaticSitesClient) CreateZipDeploymentForStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/zipdeploy", pathParameters), + autorest.WithJSON(staticSiteZipDeploymentEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateZipDeploymentForStaticSiteSender sends the CreateZipDeploymentForStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateZipDeploymentForStaticSiteSender(req *http.Request) (future StaticSitesCreateZipDeploymentForStaticSiteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateZipDeploymentForStaticSiteResponder handles the response to the CreateZipDeploymentForStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateZipDeploymentForStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// CreateZipDeploymentForStaticSiteBuild description for Deploys zipped content to a specific environment of a static +// site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - name of the environment. +// staticSiteZipDeploymentEnvelope - a JSON representation of the StaticSiteZipDeployment properties. See +// example. +func (client StaticSitesClient) CreateZipDeploymentForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource) (result StaticSitesCreateZipDeploymentForStaticSiteBuildFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.CreateZipDeploymentForStaticSiteBuild") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "CreateZipDeploymentForStaticSiteBuild", err.Error()) + } + + req, err := client.CreateZipDeploymentForStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName, staticSiteZipDeploymentEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateZipDeploymentForStaticSiteBuild", nil, "Failure preparing request") + return + } + + result, err = client.CreateZipDeploymentForStaticSiteBuildSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "CreateZipDeploymentForStaticSiteBuild", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateZipDeploymentForStaticSiteBuildPreparer prepares the CreateZipDeploymentForStaticSiteBuild request. +func (client StaticSitesClient) CreateZipDeploymentForStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string, staticSiteZipDeploymentEnvelope StaticSiteZipDeploymentARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/zipdeploy", pathParameters), + autorest.WithJSON(staticSiteZipDeploymentEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateZipDeploymentForStaticSiteBuildSender sends the CreateZipDeploymentForStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) CreateZipDeploymentForStaticSiteBuildSender(req *http.Request) (future StaticSitesCreateZipDeploymentForStaticSiteBuildFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateZipDeploymentForStaticSiteBuildResponder handles the response to the CreateZipDeploymentForStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) CreateZipDeploymentForStaticSiteBuildResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeletePrivateEndpointConnection description for Deletes a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// privateEndpointConnectionName - name of the private endpoint connection. +func (client StaticSitesClient) DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result StaticSitesDeletePrivateEndpointConnectionFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeletePrivateEndpointConnection") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeletePrivateEndpointConnection", err.Error()) + } + + req, err := client.DeletePrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeletePrivateEndpointConnection", nil, "Failure preparing request") + return + } + + result, err = client.DeletePrivateEndpointConnectionSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeletePrivateEndpointConnection", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePrivateEndpointConnectionPreparer prepares the DeletePrivateEndpointConnection request. +func (client StaticSitesClient) DeletePrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeletePrivateEndpointConnectionSender sends the DeletePrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeletePrivateEndpointConnectionSender(req *http.Request) (future StaticSitesDeletePrivateEndpointConnectionFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeletePrivateEndpointConnectionResponder handles the response to the DeletePrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeletePrivateEndpointConnectionResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteStaticSite description for Deletes a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to delete. +func (client StaticSitesClient) DeleteStaticSite(ctx context.Context, resourceGroupName string, name string) (result StaticSitesDeleteStaticSiteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSite", err.Error()) + } + + req, err := client.DeleteStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSite", nil, "Failure preparing request") + return + } + + result, err = client.DeleteStaticSiteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSite", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteStaticSitePreparer prepares the DeleteStaticSite request. +func (client StaticSitesClient) DeleteStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteSender sends the DeleteStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteSender(req *http.Request) (future StaticSitesDeleteStaticSiteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteStaticSiteResponder handles the response to the DeleteStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteStaticSiteBuild description for Deletes a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +func (client StaticSitesClient) DeleteStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StaticSitesDeleteStaticSiteBuildFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSiteBuild") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSiteBuild", err.Error()) + } + + req, err := client.DeleteStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteBuild", nil, "Failure preparing request") + return + } + + result, err = client.DeleteStaticSiteBuildSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteBuild", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteStaticSiteBuildPreparer prepares the DeleteStaticSiteBuild request. +func (client StaticSitesClient) DeleteStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteBuildSender sends the DeleteStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteBuildSender(req *http.Request) (future StaticSitesDeleteStaticSiteBuildFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteStaticSiteBuildResponder handles the response to the DeleteStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteBuildResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteStaticSiteCustomDomain description for Deletes a custom domain. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// domainName - the custom domain to delete. +func (client StaticSitesClient) DeleteStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result StaticSitesDeleteStaticSiteCustomDomainFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSiteCustomDomain") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSiteCustomDomain", err.Error()) + } + + req, err := client.DeleteStaticSiteCustomDomainPreparer(ctx, resourceGroupName, name, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteCustomDomain", nil, "Failure preparing request") + return + } + + result, err = client.DeleteStaticSiteCustomDomainSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteCustomDomain", result.Response(), "Failure sending request") + return + } + + return +} + +// DeleteStaticSiteCustomDomainPreparer prepares the DeleteStaticSiteCustomDomain request. +func (client StaticSitesClient) DeleteStaticSiteCustomDomainPreparer(ctx context.Context, resourceGroupName string, name string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteCustomDomainSender sends the DeleteStaticSiteCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteCustomDomainSender(req *http.Request) (future StaticSitesDeleteStaticSiteCustomDomainFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteStaticSiteCustomDomainResponder handles the response to the DeleteStaticSiteCustomDomain request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteCustomDomainResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DeleteStaticSiteUser description for Deletes the user entry from the static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the staticsite. +// authprovider - the auth provider for this user. +// userid - the user id of the user. +func (client StaticSitesClient) DeleteStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DeleteStaticSiteUser") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DeleteStaticSiteUser", err.Error()) + } + + req, err := client.DeleteStaticSiteUserPreparer(ctx, resourceGroupName, name, authprovider, userid) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteUser", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteStaticSiteUserSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteUser", resp, "Failure sending request") + return + } + + result, err = client.DeleteStaticSiteUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DeleteStaticSiteUser", resp, "Failure responding to request") + return + } + + return +} + +// DeleteStaticSiteUserPreparer prepares the DeleteStaticSiteUser request. +func (client StaticSitesClient) DeleteStaticSiteUserPreparer(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authprovider": autorest.Encode("path", authprovider), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userid": autorest.Encode("path", userid), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteStaticSiteUserSender sends the DeleteStaticSiteUser request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DeleteStaticSiteUserSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteStaticSiteUserResponder handles the response to the DeleteStaticSiteUser request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DeleteStaticSiteUserResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachStaticSite description for Detaches a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to detach. +func (client StaticSitesClient) DetachStaticSite(ctx context.Context, resourceGroupName string, name string) (result StaticSitesDetachStaticSiteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DetachStaticSite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DetachStaticSite", err.Error()) + } + + req, err := client.DetachStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachStaticSite", nil, "Failure preparing request") + return + } + + result, err = client.DetachStaticSiteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachStaticSite", result.Response(), "Failure sending request") + return + } + + return +} + +// DetachStaticSitePreparer prepares the DetachStaticSite request. +func (client StaticSitesClient) DetachStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/detach", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachStaticSiteSender sends the DetachStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DetachStaticSiteSender(req *http.Request) (future StaticSitesDetachStaticSiteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DetachStaticSiteResponder handles the response to the DetachStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DetachStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachUserProvidedFunctionAppFromStaticSite description for Detach the user provided function app from the static +// site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// functionAppName - name of the function app registered with the static site. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DetachUserProvidedFunctionAppFromStaticSite") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSite", err.Error()) + } + + req, err := client.DetachUserProvidedFunctionAppFromStaticSitePreparer(ctx, resourceGroupName, name, functionAppName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.DetachUserProvidedFunctionAppFromStaticSiteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSite", resp, "Failure sending request") + return + } + + result, err = client.DetachUserProvidedFunctionAppFromStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSite", resp, "Failure responding to request") + return + } + + return +} + +// DetachUserProvidedFunctionAppFromStaticSitePreparer prepares the DetachUserProvidedFunctionAppFromStaticSite request. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, functionAppName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionAppName": autorest.Encode("path", functionAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachUserProvidedFunctionAppFromStaticSiteSender sends the DetachUserProvidedFunctionAppFromStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DetachUserProvidedFunctionAppFromStaticSiteResponder handles the response to the DetachUserProvidedFunctionAppFromStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuild description for Detach the user provided function app from the +// static site build +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +// functionAppName - name of the function app registered with the static site build. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.DetachUserProvidedFunctionAppFromStaticSiteBuild") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSiteBuild", err.Error()) + } + + req, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName, functionAppName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSiteBuild", nil, "Failure preparing request") + return + } + + resp, err := client.DetachUserProvidedFunctionAppFromStaticSiteBuildSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSiteBuild", resp, "Failure sending request") + return + } + + result, err = client.DetachUserProvidedFunctionAppFromStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "DetachUserProvidedFunctionAppFromStaticSiteBuild", resp, "Failure responding to request") + return + } + + return +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuildPreparer prepares the DetachUserProvidedFunctionAppFromStaticSiteBuild request. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "functionAppName": autorest.Encode("path", functionAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuildSender sends the DetachUserProvidedFunctionAppFromStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuildSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DetachUserProvidedFunctionAppFromStaticSiteBuildResponder handles the response to the DetachUserProvidedFunctionAppFromStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) DetachUserProvidedFunctionAppFromStaticSiteBuildResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GetPrivateEndpointConnection description for Gets a private endpoint connection +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// privateEndpointConnectionName - name of the private endpoint connection. +func (client StaticSitesClient) GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result RemotePrivateEndpointConnectionARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetPrivateEndpointConnection") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetPrivateEndpointConnection", err.Error()) + } + + req, err := client.GetPrivateEndpointConnectionPreparer(ctx, resourceGroupName, name, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateEndpointConnection", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateEndpointConnection", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateEndpointConnectionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateEndpointConnection", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateEndpointConnectionPreparer prepares the GetPrivateEndpointConnection request. +func (client StaticSitesClient) GetPrivateEndpointConnectionPreparer(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionSender sends the GetPrivateEndpointConnection request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetPrivateEndpointConnectionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionResponder handles the response to the GetPrivateEndpointConnection request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetPrivateEndpointConnectionResponder(resp *http.Response) (result RemotePrivateEndpointConnectionARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateEndpointConnectionList description for Gets the list of private endpoint connections associated with a +// static site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) GetPrivateEndpointConnectionList(ctx context.Context, resourceGroupName string, name string) (result PrivateEndpointConnectionCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetPrivateEndpointConnectionList") + defer func() { + sc := -1 + if result.pecc.Response.Response != nil { + sc = result.pecc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetPrivateEndpointConnectionList", err.Error()) + } + + result.fn = client.getPrivateEndpointConnectionListNextResults + req, err := client.GetPrivateEndpointConnectionListPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateEndpointConnectionList", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateEndpointConnectionListSender(req) + if err != nil { + result.pecc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateEndpointConnectionList", resp, "Failure sending request") + return + } + + result.pecc, err = client.GetPrivateEndpointConnectionListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateEndpointConnectionList", resp, "Failure responding to request") + return + } + if result.pecc.hasNextLink() && result.pecc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetPrivateEndpointConnectionListPreparer prepares the GetPrivateEndpointConnectionList request. +func (client StaticSitesClient) GetPrivateEndpointConnectionListPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateEndpointConnectionListSender sends the GetPrivateEndpointConnectionList request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetPrivateEndpointConnectionListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateEndpointConnectionListResponder handles the response to the GetPrivateEndpointConnectionList request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetPrivateEndpointConnectionListResponder(resp *http.Response) (result PrivateEndpointConnectionCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getPrivateEndpointConnectionListNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getPrivateEndpointConnectionListNextResults(ctx context.Context, lastResults PrivateEndpointConnectionCollection) (result PrivateEndpointConnectionCollection, err error) { + req, err := lastResults.privateEndpointConnectionCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getPrivateEndpointConnectionListNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetPrivateEndpointConnectionListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getPrivateEndpointConnectionListNextResults", resp, "Failure sending next results request") + } + result, err = client.GetPrivateEndpointConnectionListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getPrivateEndpointConnectionListNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetPrivateEndpointConnectionListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetPrivateEndpointConnectionListComplete(ctx context.Context, resourceGroupName string, name string) (result PrivateEndpointConnectionCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetPrivateEndpointConnectionList") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetPrivateEndpointConnectionList(ctx, resourceGroupName, name) + return +} + +// GetPrivateLinkResources description for Gets the private link resources +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the site. +func (client StaticSitesClient) GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result PrivateLinkResourcesWrapper, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetPrivateLinkResources") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetPrivateLinkResources", err.Error()) + } + + req, err := client.GetPrivateLinkResourcesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateLinkResources", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetPrivateLinkResources", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcesPreparer prepares the GetPrivateLinkResources request. +func (client StaticSitesClient) GetPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourcesSender sends the GetPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourcesResponder handles the response to the GetPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourcesWrapper, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStaticSite description for Gets the details of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) GetStaticSite(ctx context.Context, resourceGroupName string, name string) (result StaticSiteARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSite", err.Error()) + } + + req, err := client.GetStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSite", resp, "Failure sending request") + return + } + + result, err = client.GetStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSite", resp, "Failure responding to request") + return + } + + return +} + +// GetStaticSitePreparer prepares the GetStaticSite request. +func (client StaticSitesClient) GetStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteSender sends the GetStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteResponder handles the response to the GetStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteResponder(resp *http.Response) (result StaticSiteARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStaticSiteBuild description for Gets the details of a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +func (client StaticSitesClient) GetStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StaticSiteBuildARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteBuild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSiteBuild", err.Error()) + } + + req, err := client.GetStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuild", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteBuildSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuild", resp, "Failure sending request") + return + } + + result, err = client.GetStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuild", resp, "Failure responding to request") + return + } + + return +} + +// GetStaticSiteBuildPreparer prepares the GetStaticSiteBuild request. +func (client StaticSitesClient) GetStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteBuildSender sends the GetStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteBuildSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteBuildResponder handles the response to the GetStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteBuildResponder(resp *http.Response) (result StaticSiteBuildARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStaticSiteBuilds description for Gets all static site builds for a particular static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) GetStaticSiteBuilds(ctx context.Context, resourceGroupName string, name string) (result StaticSiteBuildCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteBuilds") + defer func() { + sc := -1 + if result.ssbc.Response.Response != nil { + sc = result.ssbc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSiteBuilds", err.Error()) + } + + result.fn = client.getStaticSiteBuildsNextResults + req, err := client.GetStaticSiteBuildsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuilds", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteBuildsSender(req) + if err != nil { + result.ssbc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuilds", resp, "Failure sending request") + return + } + + result.ssbc, err = client.GetStaticSiteBuildsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteBuilds", resp, "Failure responding to request") + return + } + if result.ssbc.hasNextLink() && result.ssbc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetStaticSiteBuildsPreparer prepares the GetStaticSiteBuilds request. +func (client StaticSitesClient) GetStaticSiteBuildsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteBuildsSender sends the GetStaticSiteBuilds request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteBuildsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteBuildsResponder handles the response to the GetStaticSiteBuilds request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteBuildsResponder(resp *http.Response) (result StaticSiteBuildCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getStaticSiteBuildsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getStaticSiteBuildsNextResults(ctx context.Context, lastResults StaticSiteBuildCollection) (result StaticSiteBuildCollection, err error) { + req, err := lastResults.staticSiteBuildCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSiteBuildsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetStaticSiteBuildsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSiteBuildsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetStaticSiteBuildsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSiteBuildsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetStaticSiteBuildsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetStaticSiteBuildsComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteBuildCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteBuilds") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetStaticSiteBuilds(ctx, resourceGroupName, name) + return +} + +// GetStaticSiteCustomDomain description for Gets an existing custom domain for a particular static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site resource to search in. +// domainName - the custom domain name. +func (client StaticSitesClient) GetStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result StaticSiteCustomDomainOverviewARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSiteCustomDomain") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSiteCustomDomain", err.Error()) + } + + req, err := client.GetStaticSiteCustomDomainPreparer(ctx, resourceGroupName, name, domainName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteCustomDomain", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSiteCustomDomainSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteCustomDomain", resp, "Failure sending request") + return + } + + result, err = client.GetStaticSiteCustomDomainResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSiteCustomDomain", resp, "Failure responding to request") + return + } + + return +} + +// GetStaticSiteCustomDomainPreparer prepares the GetStaticSiteCustomDomain request. +func (client StaticSitesClient) GetStaticSiteCustomDomainPreparer(ctx context.Context, resourceGroupName string, name string, domainName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSiteCustomDomainSender sends the GetStaticSiteCustomDomain request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSiteCustomDomainSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSiteCustomDomainResponder handles the response to the GetStaticSiteCustomDomain request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSiteCustomDomainResponder(resp *http.Response) (result StaticSiteCustomDomainOverviewARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetStaticSitesByResourceGroup description for Gets all static sites in the specified resource group. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +func (client StaticSitesClient) GetStaticSitesByResourceGroup(ctx context.Context, resourceGroupName string) (result StaticSiteCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSitesByResourceGroup") + defer func() { + sc := -1 + if result.ssc.Response.Response != nil { + sc = result.ssc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetStaticSitesByResourceGroup", err.Error()) + } + + result.fn = client.getStaticSitesByResourceGroupNextResults + req, err := client.GetStaticSitesByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSitesByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetStaticSitesByResourceGroupSender(req) + if err != nil { + result.ssc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSitesByResourceGroup", resp, "Failure sending request") + return + } + + result.ssc, err = client.GetStaticSitesByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetStaticSitesByResourceGroup", resp, "Failure responding to request") + return + } + if result.ssc.hasNextLink() && result.ssc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetStaticSitesByResourceGroupPreparer prepares the GetStaticSitesByResourceGroup request. +func (client StaticSitesClient) GetStaticSitesByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStaticSitesByResourceGroupSender sends the GetStaticSitesByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetStaticSitesByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStaticSitesByResourceGroupResponder handles the response to the GetStaticSitesByResourceGroup request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetStaticSitesByResourceGroupResponder(resp *http.Response) (result StaticSiteCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getStaticSitesByResourceGroupNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getStaticSitesByResourceGroupNextResults(ctx context.Context, lastResults StaticSiteCollection) (result StaticSiteCollection, err error) { + req, err := lastResults.staticSiteCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSitesByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetStaticSitesByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSitesByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.GetStaticSitesByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getStaticSitesByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetStaticSitesByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetStaticSitesByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result StaticSiteCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetStaticSitesByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetStaticSitesByResourceGroup(ctx, resourceGroupName) + return +} + +// GetUserProvidedFunctionAppForStaticSite description for Gets the details of the user provided function app +// registered with a static site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// functionAppName - name of the function app registered with the static site. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string) (result StaticSiteUserProvidedFunctionAppARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetUserProvidedFunctionAppForStaticSite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSite", err.Error()) + } + + req, err := client.GetUserProvidedFunctionAppForStaticSitePreparer(ctx, resourceGroupName, name, functionAppName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.GetUserProvidedFunctionAppForStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSite", resp, "Failure sending request") + return + } + + result, err = client.GetUserProvidedFunctionAppForStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSite", resp, "Failure responding to request") + return + } + + return +} + +// GetUserProvidedFunctionAppForStaticSitePreparer prepares the GetUserProvidedFunctionAppForStaticSite request. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, functionAppName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionAppName": autorest.Encode("path", functionAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUserProvidedFunctionAppForStaticSiteSender sends the GetUserProvidedFunctionAppForStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUserProvidedFunctionAppForStaticSiteResponder handles the response to the GetUserProvidedFunctionAppForStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteResponder(resp *http.Response) (result StaticSiteUserProvidedFunctionAppARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUserProvidedFunctionAppForStaticSiteBuild description for Gets the details of the user provided function app +// registered with a static site build +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +// functionAppName - name of the function app registered with the static site build. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string) (result StaticSiteUserProvidedFunctionAppARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetUserProvidedFunctionAppForStaticSiteBuild") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSiteBuild", err.Error()) + } + + req, err := client.GetUserProvidedFunctionAppForStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName, functionAppName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSiteBuild", nil, "Failure preparing request") + return + } + + resp, err := client.GetUserProvidedFunctionAppForStaticSiteBuildSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSiteBuild", resp, "Failure sending request") + return + } + + result, err = client.GetUserProvidedFunctionAppForStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppForStaticSiteBuild", resp, "Failure responding to request") + return + } + + return +} + +// GetUserProvidedFunctionAppForStaticSiteBuildPreparer prepares the GetUserProvidedFunctionAppForStaticSiteBuild request. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "functionAppName": autorest.Encode("path", functionAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUserProvidedFunctionAppForStaticSiteBuildSender sends the GetUserProvidedFunctionAppForStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuildSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUserProvidedFunctionAppForStaticSiteBuildResponder handles the response to the GetUserProvidedFunctionAppForStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetUserProvidedFunctionAppForStaticSiteBuildResponder(resp *http.Response) (result StaticSiteUserProvidedFunctionAppARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetUserProvidedFunctionAppsForStaticSite description for Gets the details of the user provided function apps +// registered with a static site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSite(ctx context.Context, resourceGroupName string, name string) (result StaticSiteUserProvidedFunctionAppsCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetUserProvidedFunctionAppsForStaticSite") + defer func() { + sc := -1 + if result.ssupfac.Response.Response != nil { + sc = result.ssupfac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSite", err.Error()) + } + + result.fn = client.getUserProvidedFunctionAppsForStaticSiteNextResults + req, err := client.GetUserProvidedFunctionAppsForStaticSitePreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.GetUserProvidedFunctionAppsForStaticSiteSender(req) + if err != nil { + result.ssupfac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSite", resp, "Failure sending request") + return + } + + result.ssupfac, err = client.GetUserProvidedFunctionAppsForStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSite", resp, "Failure responding to request") + return + } + if result.ssupfac.hasNextLink() && result.ssupfac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetUserProvidedFunctionAppsForStaticSitePreparer prepares the GetUserProvidedFunctionAppsForStaticSite request. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSitePreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUserProvidedFunctionAppsForStaticSiteSender sends the GetUserProvidedFunctionAppsForStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUserProvidedFunctionAppsForStaticSiteResponder handles the response to the GetUserProvidedFunctionAppsForStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteResponder(resp *http.Response) (result StaticSiteUserProvidedFunctionAppsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getUserProvidedFunctionAppsForStaticSiteNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteNextResults(ctx context.Context, lastResults StaticSiteUserProvidedFunctionAppsCollection) (result StaticSiteUserProvidedFunctionAppsCollection, err error) { + req, err := lastResults.staticSiteUserProvidedFunctionAppsCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getUserProvidedFunctionAppsForStaticSiteNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetUserProvidedFunctionAppsForStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getUserProvidedFunctionAppsForStaticSiteNextResults", resp, "Failure sending next results request") + } + result, err = client.GetUserProvidedFunctionAppsForStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getUserProvidedFunctionAppsForStaticSiteNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetUserProvidedFunctionAppsForStaticSiteComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteUserProvidedFunctionAppsCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetUserProvidedFunctionAppsForStaticSite") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetUserProvidedFunctionAppsForStaticSite(ctx, resourceGroupName, name) + return +} + +// GetUserProvidedFunctionAppsForStaticSiteBuild description for Gets the details of the user provided function apps +// registered with a static site build +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StaticSiteUserProvidedFunctionAppsCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetUserProvidedFunctionAppsForStaticSiteBuild") + defer func() { + sc := -1 + if result.ssupfac.Response.Response != nil { + sc = result.ssupfac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSiteBuild", err.Error()) + } + + result.fn = client.getUserProvidedFunctionAppsForStaticSiteBuildNextResults + req, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSiteBuild", nil, "Failure preparing request") + return + } + + resp, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildSender(req) + if err != nil { + result.ssupfac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSiteBuild", resp, "Failure sending request") + return + } + + result.ssupfac, err = client.GetUserProvidedFunctionAppsForStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "GetUserProvidedFunctionAppsForStaticSiteBuild", resp, "Failure responding to request") + return + } + if result.ssupfac.hasNextLink() && result.ssupfac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildPreparer prepares the GetUserProvidedFunctionAppsForStaticSiteBuild request. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildSender sends the GetUserProvidedFunctionAppsForStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildResponder handles the response to the GetUserProvidedFunctionAppsForStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildResponder(resp *http.Response) (result StaticSiteUserProvidedFunctionAppsCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getUserProvidedFunctionAppsForStaticSiteBuildNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) getUserProvidedFunctionAppsForStaticSiteBuildNextResults(ctx context.Context, lastResults StaticSiteUserProvidedFunctionAppsCollection) (result StaticSiteUserProvidedFunctionAppsCollection, err error) { + req, err := lastResults.staticSiteUserProvidedFunctionAppsCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getUserProvidedFunctionAppsForStaticSiteBuildNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetUserProvidedFunctionAppsForStaticSiteBuildSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "getUserProvidedFunctionAppsForStaticSiteBuildNextResults", resp, "Failure sending next results request") + } + result, err = client.GetUserProvidedFunctionAppsForStaticSiteBuildResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "getUserProvidedFunctionAppsForStaticSiteBuildNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetUserProvidedFunctionAppsForStaticSiteBuildComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StaticSiteUserProvidedFunctionAppsCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.GetUserProvidedFunctionAppsForStaticSiteBuild") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetUserProvidedFunctionAppsForStaticSiteBuild(ctx, resourceGroupName, name, environmentName) + return +} + +// List description for Get all Static Sites for a subscription. +func (client StaticSitesClient) List(ctx context.Context) (result StaticSiteCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.List") + defer func() { + sc := -1 + if result.ssc.Response.Response != nil { + sc = result.ssc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.ssc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "List", resp, "Failure sending request") + return + } + + result.ssc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "List", resp, "Failure responding to request") + return + } + if result.ssc.hasNextLink() && result.ssc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client StaticSitesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/staticSites", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListResponder(resp *http.Response) (result StaticSiteCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listNextResults(ctx context.Context, lastResults StaticSiteCollection) (result StaticSiteCollection, err error) { + req, err := lastResults.staticSiteCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListComplete(ctx context.Context) (result StaticSiteCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListStaticSiteAppSettings description for Gets the application settings of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteAppSettings(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteAppSettings", err.Error()) + } + + req, err := client.ListStaticSiteAppSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteAppSettings", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// ListStaticSiteAppSettingsPreparer prepares the ListStaticSiteAppSettings request. +func (client StaticSitesClient) ListStaticSiteAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listAppSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteAppSettingsSender sends the ListStaticSiteAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteAppSettingsResponder handles the response to the ListStaticSiteAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteBuildAppSettings description for Gets the application settings of a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +func (client StaticSitesClient) ListStaticSiteBuildAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteBuildAppSettings", err.Error()) + } + + req, err := client.ListStaticSiteBuildAppSettingsPreparer(ctx, resourceGroupName, name, environmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteBuildAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildAppSettings", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteBuildAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// ListStaticSiteBuildAppSettingsPreparer prepares the ListStaticSiteBuildAppSettings request. +func (client StaticSitesClient) ListStaticSiteBuildAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listAppSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteBuildAppSettingsSender sends the ListStaticSiteBuildAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteBuildAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteBuildAppSettingsResponder handles the response to the ListStaticSiteBuildAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteBuildAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteBuildFunctionAppSettings description for Gets the application settings of a static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", err.Error()) + } + + req, err := client.ListStaticSiteBuildFunctionAppSettingsPreparer(ctx, resourceGroupName, name, environmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteBuildFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteBuildFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctionAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// ListStaticSiteBuildFunctionAppSettingsPreparer prepares the ListStaticSiteBuildFunctionAppSettings request. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/listFunctionAppSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteBuildFunctionAppSettingsSender sends the ListStaticSiteBuildFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteBuildFunctionAppSettingsResponder handles the response to the ListStaticSiteBuildFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteBuildFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteBuildFunctions description for Gets the functions of a particular static site build. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +func (client StaticSitesClient) ListStaticSiteBuildFunctions(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StaticSiteFunctionOverviewCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildFunctions") + defer func() { + sc := -1 + if result.ssfoc.Response.Response != nil { + sc = result.ssfoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteBuildFunctions", err.Error()) + } + + result.fn = client.listStaticSiteBuildFunctionsNextResults + req, err := client.ListStaticSiteBuildFunctionsPreparer(ctx, resourceGroupName, name, environmentName) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteBuildFunctionsSender(req) + if err != nil { + result.ssfoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctions", resp, "Failure sending request") + return + } + + result.ssfoc, err = client.ListStaticSiteBuildFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteBuildFunctions", resp, "Failure responding to request") + return + } + if result.ssfoc.hasNextLink() && result.ssfoc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListStaticSiteBuildFunctionsPreparer prepares the ListStaticSiteBuildFunctions request. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/functions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteBuildFunctionsSender sends the ListStaticSiteBuildFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteBuildFunctionsResponder handles the response to the ListStaticSiteBuildFunctions request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsResponder(resp *http.Response) (result StaticSiteFunctionOverviewCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteBuildFunctionsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteBuildFunctionsNextResults(ctx context.Context, lastResults StaticSiteFunctionOverviewCollection) (result StaticSiteFunctionOverviewCollection, err error) { + req, err := lastResults.staticSiteFunctionOverviewCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteBuildFunctionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteBuildFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteBuildFunctionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteBuildFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteBuildFunctionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteBuildFunctionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteBuildFunctionsComplete(ctx context.Context, resourceGroupName string, name string, environmentName string) (result StaticSiteFunctionOverviewCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteBuildFunctions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListStaticSiteBuildFunctions(ctx, resourceGroupName, name, environmentName) + return +} + +// ListStaticSiteConfiguredRoles description for Lists the roles configured for the static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteConfiguredRoles(ctx context.Context, resourceGroupName string, name string) (result StringList, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteConfiguredRoles") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteConfiguredRoles", err.Error()) + } + + req, err := client.ListStaticSiteConfiguredRolesPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteConfiguredRoles", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteConfiguredRolesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteConfiguredRoles", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteConfiguredRolesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteConfiguredRoles", resp, "Failure responding to request") + return + } + + return +} + +// ListStaticSiteConfiguredRolesPreparer prepares the ListStaticSiteConfiguredRoles request. +func (client StaticSitesClient) ListStaticSiteConfiguredRolesPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listConfiguredRoles", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteConfiguredRolesSender sends the ListStaticSiteConfiguredRoles request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteConfiguredRolesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteConfiguredRolesResponder handles the response to the ListStaticSiteConfiguredRoles request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteConfiguredRolesResponder(resp *http.Response) (result StringList, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteCustomDomains description for Gets all static site custom domains for a particular static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site resource to search in. +func (client StaticSitesClient) ListStaticSiteCustomDomains(ctx context.Context, resourceGroupName string, name string) (result StaticSiteCustomDomainOverviewCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteCustomDomains") + defer func() { + sc := -1 + if result.sscdoc.Response.Response != nil { + sc = result.sscdoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteCustomDomains", err.Error()) + } + + result.fn = client.listStaticSiteCustomDomainsNextResults + req, err := client.ListStaticSiteCustomDomainsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteCustomDomains", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteCustomDomainsSender(req) + if err != nil { + result.sscdoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteCustomDomains", resp, "Failure sending request") + return + } + + result.sscdoc, err = client.ListStaticSiteCustomDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteCustomDomains", resp, "Failure responding to request") + return + } + if result.sscdoc.hasNextLink() && result.sscdoc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListStaticSiteCustomDomainsPreparer prepares the ListStaticSiteCustomDomains request. +func (client StaticSitesClient) ListStaticSiteCustomDomainsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteCustomDomainsSender sends the ListStaticSiteCustomDomains request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteCustomDomainsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteCustomDomainsResponder handles the response to the ListStaticSiteCustomDomains request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteCustomDomainsResponder(resp *http.Response) (result StaticSiteCustomDomainOverviewCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteCustomDomainsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteCustomDomainsNextResults(ctx context.Context, lastResults StaticSiteCustomDomainOverviewCollection) (result StaticSiteCustomDomainOverviewCollection, err error) { + req, err := lastResults.staticSiteCustomDomainOverviewCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteCustomDomainsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteCustomDomainsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteCustomDomainsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteCustomDomainsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteCustomDomainsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteCustomDomainsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteCustomDomainsComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteCustomDomainOverviewCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteCustomDomains") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListStaticSiteCustomDomains(ctx, resourceGroupName, name) + return +} + +// ListStaticSiteFunctionAppSettings description for Gets the application settings of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteFunctionAppSettings") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", err.Error()) + } + + req, err := client.ListStaticSiteFunctionAppSettingsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteFunctionAppSettingsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteFunctionAppSettingsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctionAppSettings", resp, "Failure responding to request") + return + } + + return +} + +// ListStaticSiteFunctionAppSettingsPreparer prepares the ListStaticSiteFunctionAppSettings request. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettingsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listFunctionAppSettings", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteFunctionAppSettingsSender sends the ListStaticSiteFunctionAppSettings request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettingsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteFunctionAppSettingsResponder handles the response to the ListStaticSiteFunctionAppSettings request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteFunctionAppSettingsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteFunctions description for Gets the functions of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteFunctions(ctx context.Context, resourceGroupName string, name string) (result StaticSiteFunctionOverviewCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteFunctions") + defer func() { + sc := -1 + if result.ssfoc.Response.Response != nil { + sc = result.ssfoc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteFunctions", err.Error()) + } + + result.fn = client.listStaticSiteFunctionsNextResults + req, err := client.ListStaticSiteFunctionsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctions", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteFunctionsSender(req) + if err != nil { + result.ssfoc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctions", resp, "Failure sending request") + return + } + + result.ssfoc, err = client.ListStaticSiteFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteFunctions", resp, "Failure responding to request") + return + } + if result.ssfoc.hasNextLink() && result.ssfoc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListStaticSiteFunctionsPreparer prepares the ListStaticSiteFunctions request. +func (client StaticSitesClient) ListStaticSiteFunctionsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/functions", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteFunctionsSender sends the ListStaticSiteFunctions request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteFunctionsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteFunctionsResponder handles the response to the ListStaticSiteFunctions request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteFunctionsResponder(resp *http.Response) (result StaticSiteFunctionOverviewCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteFunctionsNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteFunctionsNextResults(ctx context.Context, lastResults StaticSiteFunctionOverviewCollection) (result StaticSiteFunctionOverviewCollection, err error) { + req, err := lastResults.staticSiteFunctionOverviewCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteFunctionsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteFunctionsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteFunctionsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteFunctionsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteFunctionsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteFunctionsComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result StaticSiteFunctionOverviewCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteFunctions") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListStaticSiteFunctions(ctx, resourceGroupName, name) + return +} + +// ListStaticSiteSecrets description for Lists the secrets for an existing static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ListStaticSiteSecrets(ctx context.Context, resourceGroupName string, name string) (result StringDictionary, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteSecrets") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteSecrets", err.Error()) + } + + req, err := client.ListStaticSiteSecretsPreparer(ctx, resourceGroupName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteSecrets", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteSecretsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteSecrets", resp, "Failure sending request") + return + } + + result, err = client.ListStaticSiteSecretsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteSecrets", resp, "Failure responding to request") + return + } + + return +} + +// ListStaticSiteSecretsPreparer prepares the ListStaticSiteSecrets request. +func (client StaticSitesClient) ListStaticSiteSecretsPreparer(ctx context.Context, resourceGroupName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/listSecrets", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteSecretsSender sends the ListStaticSiteSecrets request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteSecretsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteSecretsResponder handles the response to the ListStaticSiteSecrets request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteSecretsResponder(resp *http.Response) (result StringDictionary, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListStaticSiteUsers description for Gets the list of users of a static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// authprovider - the auth provider for the users. +func (client StaticSitesClient) ListStaticSiteUsers(ctx context.Context, resourceGroupName string, name string, authprovider string) (result StaticSiteUserCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteUsers") + defer func() { + sc := -1 + if result.ssuc.Response.Response != nil { + sc = result.ssuc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ListStaticSiteUsers", err.Error()) + } + + result.fn = client.listStaticSiteUsersNextResults + req, err := client.ListStaticSiteUsersPreparer(ctx, resourceGroupName, name, authprovider) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteUsers", nil, "Failure preparing request") + return + } + + resp, err := client.ListStaticSiteUsersSender(req) + if err != nil { + result.ssuc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteUsers", resp, "Failure sending request") + return + } + + result.ssuc, err = client.ListStaticSiteUsersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ListStaticSiteUsers", resp, "Failure responding to request") + return + } + if result.ssuc.hasNextLink() && result.ssuc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListStaticSiteUsersPreparer prepares the ListStaticSiteUsers request. +func (client StaticSitesClient) ListStaticSiteUsersPreparer(ctx context.Context, resourceGroupName string, name string, authprovider string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authprovider": autorest.Encode("path", authprovider), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/listUsers", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListStaticSiteUsersSender sends the ListStaticSiteUsers request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ListStaticSiteUsersSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListStaticSiteUsersResponder handles the response to the ListStaticSiteUsers request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ListStaticSiteUsersResponder(resp *http.Response) (result StaticSiteUserCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listStaticSiteUsersNextResults retrieves the next set of results, if any. +func (client StaticSitesClient) listStaticSiteUsersNextResults(ctx context.Context, lastResults StaticSiteUserCollection) (result StaticSiteUserCollection, err error) { + req, err := lastResults.staticSiteUserCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteUsersNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListStaticSiteUsersSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteUsersNextResults", resp, "Failure sending next results request") + } + result, err = client.ListStaticSiteUsersResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "listStaticSiteUsersNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListStaticSiteUsersComplete enumerates all values, automatically crossing page boundaries as required. +func (client StaticSitesClient) ListStaticSiteUsersComplete(ctx context.Context, resourceGroupName string, name string, authprovider string) (result StaticSiteUserCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ListStaticSiteUsers") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListStaticSiteUsers(ctx, resourceGroupName, name, authprovider) + return +} + +// PreviewWorkflow description for Generates a preview workflow file for the static site +// Parameters: +// location - location where you plan to create the static site. +// staticSitesWorkflowPreviewRequest - a JSON representation of the StaticSitesWorkflowPreviewRequest +// properties. See example. +func (client StaticSitesClient) PreviewWorkflow(ctx context.Context, location string, staticSitesWorkflowPreviewRequest StaticSitesWorkflowPreviewRequest) (result StaticSitesWorkflowPreview, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.PreviewWorkflow") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.PreviewWorkflowPreparer(ctx, location, staticSitesWorkflowPreviewRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "PreviewWorkflow", nil, "Failure preparing request") + return + } + + resp, err := client.PreviewWorkflowSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "PreviewWorkflow", resp, "Failure sending request") + return + } + + result, err = client.PreviewWorkflowResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "PreviewWorkflow", resp, "Failure responding to request") + return + } + + return +} + +// PreviewWorkflowPreparer prepares the PreviewWorkflow request. +func (client StaticSitesClient) PreviewWorkflowPreparer(ctx context.Context, location string, staticSitesWorkflowPreviewRequest StaticSitesWorkflowPreviewRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Web/locations/{location}/previewStaticSiteWorkflowFile", pathParameters), + autorest.WithJSON(staticSitesWorkflowPreviewRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PreviewWorkflowSender sends the PreviewWorkflow request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) PreviewWorkflowSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PreviewWorkflowResponder handles the response to the PreviewWorkflow request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) PreviewWorkflowResponder(resp *http.Response) (result StaticSitesWorkflowPreview, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegisterUserProvidedFunctionAppWithStaticSite description for Register a user provided function app with a static +// site +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// functionAppName - name of the function app to register with the static site. +// staticSiteUserProvidedFunctionEnvelope - a JSON representation of the user provided function app properties. +// See example. +// isForced - specify true to force the update of the auth configuration on the function app even +// if an AzureStaticWebApps provider is already configured on the function app. The default is +// false. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, isForced *bool) (result StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "RegisterUserProvidedFunctionAppWithStaticSite", err.Error()) + } + + req, err := client.RegisterUserProvidedFunctionAppWithStaticSitePreparer(ctx, resourceGroupName, name, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "RegisterUserProvidedFunctionAppWithStaticSite", nil, "Failure preparing request") + return + } + + result, err = client.RegisterUserProvidedFunctionAppWithStaticSiteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "RegisterUserProvidedFunctionAppWithStaticSite", result.Response(), "Failure sending request") + return + } + + return +} + +// RegisterUserProvidedFunctionAppWithStaticSitePreparer prepares the RegisterUserProvidedFunctionAppWithStaticSite request. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, isForced *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "functionAppName": autorest.Encode("path", functionAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if isForced != nil { + queryParameters["isForced"] = autorest.Encode("query", *isForced) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/userProvidedFunctionApps/{functionAppName}", pathParameters), + autorest.WithJSON(staticSiteUserProvidedFunctionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegisterUserProvidedFunctionAppWithStaticSiteSender sends the RegisterUserProvidedFunctionAppWithStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteSender(req *http.Request) (future StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RegisterUserProvidedFunctionAppWithStaticSiteResponder handles the response to the RegisterUserProvidedFunctionAppWithStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteResponder(resp *http.Response) (result StaticSiteUserProvidedFunctionAppARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuild description for Register a user provided function app with a +// static site build +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// environmentName - the stage site identifier. +// functionAppName - name of the function app to register with the static site build. +// staticSiteUserProvidedFunctionEnvelope - a JSON representation of the user provided function app properties. +// See example. +// isForced - specify true to force the update of the auth configuration on the function app even +// if an AzureStaticWebApps provider is already configured on the function app. The default is +// false. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, isForced *bool) (result StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.RegisterUserProvidedFunctionAppWithStaticSiteBuild") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "RegisterUserProvidedFunctionAppWithStaticSiteBuild", err.Error()) + } + + req, err := client.RegisterUserProvidedFunctionAppWithStaticSiteBuildPreparer(ctx, resourceGroupName, name, environmentName, functionAppName, staticSiteUserProvidedFunctionEnvelope, isForced) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "RegisterUserProvidedFunctionAppWithStaticSiteBuild", nil, "Failure preparing request") + return + } + + result, err = client.RegisterUserProvidedFunctionAppWithStaticSiteBuildSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "RegisterUserProvidedFunctionAppWithStaticSiteBuild", result.Response(), "Failure sending request") + return + } + + return +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuildPreparer prepares the RegisterUserProvidedFunctionAppWithStaticSiteBuild request. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuildPreparer(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, staticSiteUserProvidedFunctionEnvelope StaticSiteUserProvidedFunctionAppARMResource, isForced *bool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "environmentName": autorest.Encode("path", environmentName), + "functionAppName": autorest.Encode("path", functionAppName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if isForced != nil { + queryParameters["isForced"] = autorest.Encode("query", *isForced) + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/builds/{environmentName}/userProvidedFunctionApps/{functionAppName}", pathParameters), + autorest.WithJSON(staticSiteUserProvidedFunctionEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuildSender sends the RegisterUserProvidedFunctionAppWithStaticSiteBuild request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuildSender(req *http.Request) (future StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RegisterUserProvidedFunctionAppWithStaticSiteBuildResponder handles the response to the RegisterUserProvidedFunctionAppWithStaticSiteBuild request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) RegisterUserProvidedFunctionAppWithStaticSiteBuildResponder(resp *http.Response) (result StaticSiteUserProvidedFunctionAppARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ResetStaticSiteAPIKey description for Resets the api key for an existing static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +func (client StaticSitesClient) ResetStaticSiteAPIKey(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope StaticSiteResetPropertiesARMResource) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ResetStaticSiteAPIKey") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ResetStaticSiteAPIKey", err.Error()) + } + + req, err := client.ResetStaticSiteAPIKeyPreparer(ctx, resourceGroupName, name, resetPropertiesEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ResetStaticSiteAPIKey", nil, "Failure preparing request") + return + } + + resp, err := client.ResetStaticSiteAPIKeySender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ResetStaticSiteAPIKey", resp, "Failure sending request") + return + } + + result, err = client.ResetStaticSiteAPIKeyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ResetStaticSiteAPIKey", resp, "Failure responding to request") + return + } + + return +} + +// ResetStaticSiteAPIKeyPreparer prepares the ResetStaticSiteAPIKey request. +func (client StaticSitesClient) ResetStaticSiteAPIKeyPreparer(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope StaticSiteResetPropertiesARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/resetapikey", pathParameters), + autorest.WithJSON(resetPropertiesEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetStaticSiteAPIKeySender sends the ResetStaticSiteAPIKey request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ResetStaticSiteAPIKeySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ResetStaticSiteAPIKeyResponder handles the response to the ResetStaticSiteAPIKey request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ResetStaticSiteAPIKeyResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// UpdateStaticSite description for Creates a new static site in an existing resource group, or updates an existing +// static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site to create or update. +// staticSiteEnvelope - a JSON representation of the staticsite properties. See example. +func (client StaticSitesClient) UpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSitePatchResource) (result StaticSiteARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.UpdateStaticSite") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "UpdateStaticSite", err.Error()) + } + + req, err := client.UpdateStaticSitePreparer(ctx, resourceGroupName, name, staticSiteEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSite", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateStaticSiteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSite", resp, "Failure sending request") + return + } + + result, err = client.UpdateStaticSiteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSite", resp, "Failure responding to request") + return + } + + return +} + +// UpdateStaticSitePreparer prepares the UpdateStaticSite request. +func (client StaticSitesClient) UpdateStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope StaticSitePatchResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}", pathParameters), + autorest.WithJSON(staticSiteEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateStaticSiteSender sends the UpdateStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) UpdateStaticSiteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateStaticSiteResponder handles the response to the UpdateStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) UpdateStaticSiteResponder(resp *http.Response) (result StaticSiteARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// UpdateStaticSiteUser description for Updates a user entry with the listed roles +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// authprovider - the auth provider for this user. +// userid - the user id of the user. +// staticSiteUserEnvelope - a JSON representation of the StaticSiteUser properties. See example. +func (client StaticSitesClient) UpdateStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope StaticSiteUserARMResource) (result StaticSiteUserARMResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.UpdateStaticSiteUser") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "UpdateStaticSiteUser", err.Error()) + } + + req, err := client.UpdateStaticSiteUserPreparer(ctx, resourceGroupName, name, authprovider, userid, staticSiteUserEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSiteUser", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateStaticSiteUserSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSiteUser", resp, "Failure sending request") + return + } + + result, err = client.UpdateStaticSiteUserResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "UpdateStaticSiteUser", resp, "Failure responding to request") + return + } + + return +} + +// UpdateStaticSiteUserPreparer prepares the UpdateStaticSiteUser request. +func (client StaticSitesClient) UpdateStaticSiteUserPreparer(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope StaticSiteUserARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "authprovider": autorest.Encode("path", authprovider), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userid": autorest.Encode("path", userid), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/authproviders/{authprovider}/users/{userid}", pathParameters), + autorest.WithJSON(staticSiteUserEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateStaticSiteUserSender sends the UpdateStaticSiteUser request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) UpdateStaticSiteUserSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateStaticSiteUserResponder handles the response to the UpdateStaticSiteUser request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) UpdateStaticSiteUserResponder(resp *http.Response) (result StaticSiteUserARMResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ValidateCustomDomainCanBeAddedToStaticSite description for Validates a particular custom domain can be added to a +// static site. +// Parameters: +// resourceGroupName - name of the resource group to which the resource belongs. +// name - name of the static site. +// domainName - the custom domain to validate. +// staticSiteCustomDomainRequestPropertiesEnvelope - a JSON representation of the static site custom domain +// request properties. See example. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource) (result StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/StaticSitesClient.ValidateCustomDomainCanBeAddedToStaticSite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "resourceGroupName", Name: validation.Pattern, Rule: `^[-\w\._\(\)]+[^\.]$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", err.Error()) + } + + req, err := client.ValidateCustomDomainCanBeAddedToStaticSitePreparer(ctx, resourceGroupName, name, domainName, staticSiteCustomDomainRequestPropertiesEnvelope) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", nil, "Failure preparing request") + return + } + + result, err = client.ValidateCustomDomainCanBeAddedToStaticSiteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "web.StaticSitesClient", "ValidateCustomDomainCanBeAddedToStaticSite", result.Response(), "Failure sending request") + return + } + + return +} + +// ValidateCustomDomainCanBeAddedToStaticSitePreparer prepares the ValidateCustomDomainCanBeAddedToStaticSite request. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSitePreparer(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope StaticSiteCustomDomainRequestPropertiesARMResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "domainName": autorest.Encode("path", domainName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Web/staticSites/{name}/customDomains/{domainName}/validate", pathParameters), + autorest.WithJSON(staticSiteCustomDomainRequestPropertiesEnvelope), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ValidateCustomDomainCanBeAddedToStaticSiteSender sends the ValidateCustomDomainCanBeAddedToStaticSite request. The method will close the +// http.Response Body if it receives an error. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSiteSender(req *http.Request) (future StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ValidateCustomDomainCanBeAddedToStaticSiteResponder handles the response to the ValidateCustomDomainCanBeAddedToStaticSite request. The method always +// closes the http.Response Body. +func (client StaticSitesClient) ValidateCustomDomainCanBeAddedToStaticSiteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/web/mgmt/2021-03-01/web/topleveldomains.go b/services/web/mgmt/2021-03-01/web/topleveldomains.go new file mode 100644 index 000000000000..5572d05bb119 --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/topleveldomains.go @@ -0,0 +1,337 @@ +package web + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TopLevelDomainsClient is the webSite Management Client +type TopLevelDomainsClient struct { + BaseClient +} + +// NewTopLevelDomainsClient creates an instance of the TopLevelDomainsClient client. +func NewTopLevelDomainsClient(subscriptionID string) TopLevelDomainsClient { + return NewTopLevelDomainsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTopLevelDomainsClientWithBaseURI creates an instance of the TopLevelDomainsClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTopLevelDomainsClientWithBaseURI(baseURI string, subscriptionID string) TopLevelDomainsClient { + return TopLevelDomainsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get description for Get details of a top-level domain. +// Parameters: +// name - name of the top-level domain. +func (client TopLevelDomainsClient) Get(ctx context.Context, name string) (result TopLevelDomain, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, name) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client TopLevelDomainsClient) GetPreparer(ctx context.Context, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TopLevelDomainsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TopLevelDomainsClient) GetResponder(resp *http.Response) (result TopLevelDomain, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List description for Get all top-level domains supported for registration. +func (client TopLevelDomainsClient) List(ctx context.Context) (result TopLevelDomainCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainsClient.List") + defer func() { + sc := -1 + if result.tldc.Response.Response != nil { + sc = result.tldc.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.tldc.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "List", resp, "Failure sending request") + return + } + + result.tldc, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "List", resp, "Failure responding to request") + return + } + if result.tldc.hasNextLink() && result.tldc.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client TopLevelDomainsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client TopLevelDomainsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client TopLevelDomainsClient) ListResponder(resp *http.Response) (result TopLevelDomainCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client TopLevelDomainsClient) listNextResults(ctx context.Context, lastResults TopLevelDomainCollection) (result TopLevelDomainCollection, err error) { + req, err := lastResults.topLevelDomainCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TopLevelDomainsClient) ListComplete(ctx context.Context) (result TopLevelDomainCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListAgreements description for Gets all legal agreements that user needs to accept before purchasing a domain. +// Parameters: +// name - name of the top-level domain. +// agreementOption - domain agreement options. +func (client TopLevelDomainsClient) ListAgreements(ctx context.Context, name string, agreementOption TopLevelDomainAgreementOption) (result TldLegalAgreementCollectionPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainsClient.ListAgreements") + defer func() { + sc := -1 + if result.tlac.Response.Response != nil { + sc = result.tlac.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listAgreementsNextResults + req, err := client.ListAgreementsPreparer(ctx, name, agreementOption) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "ListAgreements", nil, "Failure preparing request") + return + } + + resp, err := client.ListAgreementsSender(req) + if err != nil { + result.tlac.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "ListAgreements", resp, "Failure sending request") + return + } + + result.tlac, err = client.ListAgreementsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "ListAgreements", resp, "Failure responding to request") + return + } + if result.tlac.hasNextLink() && result.tlac.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListAgreementsPreparer prepares the ListAgreements request. +func (client TopLevelDomainsClient) ListAgreementsPreparer(ctx context.Context, name string, agreementOption TopLevelDomainAgreementOption) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "name": autorest.Encode("path", name), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-03-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.DomainRegistration/topLevelDomains/{name}/listAgreements", pathParameters), + autorest.WithJSON(agreementOption), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListAgreementsSender sends the ListAgreements request. The method will close the +// http.Response Body if it receives an error. +func (client TopLevelDomainsClient) ListAgreementsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListAgreementsResponder handles the response to the ListAgreements request. The method always +// closes the http.Response Body. +func (client TopLevelDomainsClient) ListAgreementsResponder(resp *http.Response) (result TldLegalAgreementCollection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listAgreementsNextResults retrieves the next set of results, if any. +func (client TopLevelDomainsClient) listAgreementsNextResults(ctx context.Context, lastResults TldLegalAgreementCollection) (result TldLegalAgreementCollection, err error) { + req, err := lastResults.tldLegalAgreementCollectionPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "listAgreementsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListAgreementsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "listAgreementsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListAgreementsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "web.TopLevelDomainsClient", "listAgreementsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListAgreementsComplete enumerates all values, automatically crossing page boundaries as required. +func (client TopLevelDomainsClient) ListAgreementsComplete(ctx context.Context, name string, agreementOption TopLevelDomainAgreementOption) (result TldLegalAgreementCollectionIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TopLevelDomainsClient.ListAgreements") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListAgreements(ctx, name, agreementOption) + return +} diff --git a/services/web/mgmt/2021-03-01/web/version.go b/services/web/mgmt/2021-03-01/web/version.go new file mode 100644 index 000000000000..9324c4eed99c --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/version.go @@ -0,0 +1,19 @@ +package web + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " web/2021-03-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/web/mgmt/2021-03-01/web/webapi/interfaces.go b/services/web/mgmt/2021-03-01/web/webapi/interfaces.go new file mode 100644 index 000000000000..f3b5713de7ee --- /dev/null +++ b/services/web/mgmt/2021-03-01/web/webapi/interfaces.go @@ -0,0 +1,942 @@ +package webapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/date" +) + +// BaseClientAPI contains the set of methods on the BaseClient type. +type BaseClientAPI interface { + CheckNameAvailability(ctx context.Context, request web.ResourceNameAvailabilityRequest) (result web.ResourceNameAvailability, err error) + GetPublishingUser(ctx context.Context) (result web.User, err error) + GetSourceControl(ctx context.Context, sourceControlType string) (result web.SourceControl, err error) + GetSubscriptionDeploymentLocations(ctx context.Context) (result web.DeploymentLocations, err error) + ListBillingMeters(ctx context.Context, billingLocation string, osType string) (result web.BillingMeterCollectionPage, err error) + ListBillingMetersComplete(ctx context.Context, billingLocation string, osType string) (result web.BillingMeterCollectionIterator, err error) + ListCustomHostNameSites(ctx context.Context) (result web.CustomHostnameSitesCollectionPage, err error) + ListCustomHostNameSitesComplete(ctx context.Context) (result web.CustomHostnameSitesCollectionIterator, err error) + ListGeoRegions(ctx context.Context, sku web.SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (result web.GeoRegionCollectionPage, err error) + ListGeoRegionsComplete(ctx context.Context, sku web.SkuName, linuxWorkersEnabled *bool, xenonWorkersEnabled *bool, linuxDynamicWorkersEnabled *bool) (result web.GeoRegionCollectionIterator, err error) + ListPremierAddOnOffers(ctx context.Context) (result web.PremierAddOnOfferCollectionPage, err error) + ListPremierAddOnOffersComplete(ctx context.Context) (result web.PremierAddOnOfferCollectionIterator, err error) + ListSiteIdentifiersAssignedToHostName(ctx context.Context, nameIdentifier web.NameIdentifier) (result web.IdentifierCollectionPage, err error) + ListSiteIdentifiersAssignedToHostNameComplete(ctx context.Context, nameIdentifier web.NameIdentifier) (result web.IdentifierCollectionIterator, err error) + ListSkus(ctx context.Context) (result web.SkuInfos, err error) + ListSourceControls(ctx context.Context) (result web.SourceControlCollectionPage, err error) + ListSourceControlsComplete(ctx context.Context) (result web.SourceControlCollectionIterator, err error) + Move(ctx context.Context, resourceGroupName string, moveResourceEnvelope web.CsmMoveResourceEnvelope) (result autorest.Response, err error) + UpdatePublishingUser(ctx context.Context, userDetails web.User) (result web.User, err error) + UpdateSourceControl(ctx context.Context, sourceControlType string, requestMessage web.SourceControl) (result web.SourceControl, err error) + Validate(ctx context.Context, resourceGroupName string, validateRequest web.ValidateRequest) (result web.ValidateResponse, err error) + ValidateMove(ctx context.Context, resourceGroupName string, moveResourceEnvelope web.CsmMoveResourceEnvelope) (result autorest.Response, err error) + VerifyHostingEnvironmentVnet(ctx context.Context, parameters web.VnetParameters) (result web.VnetValidationFailureDetails, err error) +} + +var _ BaseClientAPI = (*web.BaseClient)(nil) + +// AppServiceCertificateOrdersClientAPI contains the set of methods on the AppServiceCertificateOrdersClient type. +type AppServiceCertificateOrdersClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName web.AppServiceCertificateOrder) (result web.AppServiceCertificateOrdersCreateOrUpdateFuture, err error) + CreateOrUpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate web.AppServiceCertificateResource) (result web.AppServiceCertificateOrdersCreateOrUpdateCertificateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) + DeleteCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, certificateOrderName string) (result web.AppServiceCertificateOrder, err error) + GetCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string) (result web.AppServiceCertificateResource, err error) + List(ctx context.Context) (result web.AppServiceCertificateOrderCollectionPage, err error) + ListComplete(ctx context.Context) (result web.AppServiceCertificateOrderCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.AppServiceCertificateOrderCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.AppServiceCertificateOrderCollectionIterator, err error) + ListCertificates(ctx context.Context, resourceGroupName string, certificateOrderName string) (result web.AppServiceCertificateCollectionPage, err error) + ListCertificatesComplete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result web.AppServiceCertificateCollectionIterator, err error) + Reissue(ctx context.Context, resourceGroupName string, certificateOrderName string, reissueCertificateOrderRequest web.ReissueCertificateOrderRequest) (result autorest.Response, err error) + Renew(ctx context.Context, resourceGroupName string, certificateOrderName string, renewCertificateOrderRequest web.RenewCertificateOrderRequest) (result autorest.Response, err error) + ResendEmail(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) + ResendRequestEmails(ctx context.Context, resourceGroupName string, certificateOrderName string, nameIdentifier web.NameIdentifier) (result autorest.Response, err error) + RetrieveCertificateActions(ctx context.Context, resourceGroupName string, name string) (result web.ListCertificateOrderAction, err error) + RetrieveCertificateEmailHistory(ctx context.Context, resourceGroupName string, name string) (result web.ListCertificateEmail, err error) + RetrieveSiteSeal(ctx context.Context, resourceGroupName string, certificateOrderName string, siteSealRequest web.SiteSealRequest) (result web.SiteSeal, err error) + Update(ctx context.Context, resourceGroupName string, certificateOrderName string, certificateDistinguishedName web.AppServiceCertificateOrderPatchResource) (result web.AppServiceCertificateOrder, err error) + UpdateCertificate(ctx context.Context, resourceGroupName string, certificateOrderName string, name string, keyVaultCertificate web.AppServiceCertificatePatchResource) (result web.AppServiceCertificateResource, err error) + ValidatePurchaseInformation(ctx context.Context, appServiceCertificateOrder web.AppServiceCertificateOrder) (result autorest.Response, err error) + VerifyDomainOwnership(ctx context.Context, resourceGroupName string, certificateOrderName string) (result autorest.Response, err error) +} + +var _ AppServiceCertificateOrdersClientAPI = (*web.AppServiceCertificateOrdersClient)(nil) + +// CertificateOrdersDiagnosticsClientAPI contains the set of methods on the CertificateOrdersDiagnosticsClient type. +type CertificateOrdersDiagnosticsClientAPI interface { + GetAppServiceCertificateOrderDetectorResponse(ctx context.Context, resourceGroupName string, certificateOrderName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) + ListAppServiceCertificateOrderDetectorResponse(ctx context.Context, resourceGroupName string, certificateOrderName string) (result web.DetectorResponseCollectionPage, err error) + ListAppServiceCertificateOrderDetectorResponseComplete(ctx context.Context, resourceGroupName string, certificateOrderName string) (result web.DetectorResponseCollectionIterator, err error) +} + +var _ CertificateOrdersDiagnosticsClientAPI = (*web.CertificateOrdersDiagnosticsClient)(nil) + +// CertificateRegistrationProviderClientAPI contains the set of methods on the CertificateRegistrationProviderClient type. +type CertificateRegistrationProviderClientAPI interface { + ListOperations(ctx context.Context) (result web.CsmOperationCollectionPage, err error) + ListOperationsComplete(ctx context.Context) (result web.CsmOperationCollectionIterator, err error) +} + +var _ CertificateRegistrationProviderClientAPI = (*web.CertificateRegistrationProviderClient)(nil) + +// DomainsClientAPI contains the set of methods on the DomainsClient type. +type DomainsClientAPI interface { + CheckAvailability(ctx context.Context, identifier web.NameIdentifier) (result web.DomainAvailabilityCheckResult, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, domainName string, domain web.Domain) (result web.DomainsCreateOrUpdateFuture, err error) + CreateOrUpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier web.DomainOwnershipIdentifier) (result web.DomainOwnershipIdentifier, err error) + Delete(ctx context.Context, resourceGroupName string, domainName string, forceHardDeleteDomain *bool) (result autorest.Response, err error) + DeleteOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, domainName string) (result web.Domain, err error) + GetControlCenterSsoRequest(ctx context.Context) (result web.DomainControlCenterSsoRequest, err error) + GetOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string) (result web.DomainOwnershipIdentifier, err error) + List(ctx context.Context) (result web.DomainCollectionPage, err error) + ListComplete(ctx context.Context) (result web.DomainCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.DomainCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.DomainCollectionIterator, err error) + ListOwnershipIdentifiers(ctx context.Context, resourceGroupName string, domainName string) (result web.DomainOwnershipIdentifierCollectionPage, err error) + ListOwnershipIdentifiersComplete(ctx context.Context, resourceGroupName string, domainName string) (result web.DomainOwnershipIdentifierCollectionIterator, err error) + ListRecommendations(ctx context.Context, parameters web.DomainRecommendationSearchParameters) (result web.NameIdentifierCollectionPage, err error) + ListRecommendationsComplete(ctx context.Context, parameters web.DomainRecommendationSearchParameters) (result web.NameIdentifierCollectionIterator, err error) + Renew(ctx context.Context, resourceGroupName string, domainName string) (result autorest.Response, err error) + TransferOut(ctx context.Context, resourceGroupName string, domainName string) (result web.Domain, err error) + Update(ctx context.Context, resourceGroupName string, domainName string, domain web.DomainPatchResource) (result web.Domain, err error) + UpdateOwnershipIdentifier(ctx context.Context, resourceGroupName string, domainName string, name string, domainOwnershipIdentifier web.DomainOwnershipIdentifier) (result web.DomainOwnershipIdentifier, err error) +} + +var _ DomainsClientAPI = (*web.DomainsClient)(nil) + +// TopLevelDomainsClientAPI contains the set of methods on the TopLevelDomainsClient type. +type TopLevelDomainsClientAPI interface { + Get(ctx context.Context, name string) (result web.TopLevelDomain, err error) + List(ctx context.Context) (result web.TopLevelDomainCollectionPage, err error) + ListComplete(ctx context.Context) (result web.TopLevelDomainCollectionIterator, err error) + ListAgreements(ctx context.Context, name string, agreementOption web.TopLevelDomainAgreementOption) (result web.TldLegalAgreementCollectionPage, err error) + ListAgreementsComplete(ctx context.Context, name string, agreementOption web.TopLevelDomainAgreementOption) (result web.TldLegalAgreementCollectionIterator, err error) +} + +var _ TopLevelDomainsClientAPI = (*web.TopLevelDomainsClient)(nil) + +// DomainRegistrationProviderClientAPI contains the set of methods on the DomainRegistrationProviderClient type. +type DomainRegistrationProviderClientAPI interface { + ListOperations(ctx context.Context) (result web.CsmOperationCollectionPage, err error) + ListOperationsComplete(ctx context.Context) (result web.CsmOperationCollectionIterator, err error) +} + +var _ DomainRegistrationProviderClientAPI = (*web.DomainRegistrationProviderClient)(nil) + +// AppServiceEnvironmentsClientAPI contains the set of methods on the AppServiceEnvironmentsClient type. +type AppServiceEnvironmentsClientAPI interface { + ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper web.PrivateLinkConnectionApprovalRequestResource) (result web.AppServiceEnvironmentsApproveOrRejectPrivateEndpointConnectionFuture, err error) + ChangeVnet(ctx context.Context, resourceGroupName string, name string, vnetInfo web.VirtualNetworkProfile) (result web.AppServiceEnvironmentsChangeVnetFuture, err error) + ChangeVnetComplete(ctx context.Context, resourceGroupName string, name string, vnetInfo web.VirtualNetworkProfile) (result web.AppServiceEnvironmentsChangeVnetAllFuture, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope web.AppServiceEnvironmentResource) (result web.AppServiceEnvironmentsCreateOrUpdateFuture, err error) + CreateOrUpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope web.WorkerPoolResource) (result web.AppServiceEnvironmentsCreateOrUpdateMultiRolePoolFuture, err error) + CreateOrUpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope web.WorkerPoolResource) (result web.AppServiceEnvironmentsCreateOrUpdateWorkerPoolFuture, err error) + Delete(ctx context.Context, resourceGroupName string, name string, forceDelete *bool) (result web.AppServiceEnvironmentsDeleteFuture, err error) + DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.AppServiceEnvironmentsDeletePrivateEndpointConnectionFuture, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentResource, err error) + GetAseV3NetworkingConfiguration(ctx context.Context, resourceGroupName string, name string) (result web.AseV3NetworkingConfiguration, err error) + GetDiagnosticsItem(ctx context.Context, resourceGroupName string, name string, diagnosticsName string) (result web.HostingEnvironmentDiagnostics, err error) + GetInboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.InboundEnvironmentEndpointCollectionPage, err error) + GetInboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result web.InboundEnvironmentEndpointCollectionIterator, err error) + GetMultiRolePool(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolResource, err error) + GetOutboundNetworkDependenciesEndpoints(ctx context.Context, resourceGroupName string, name string) (result web.OutboundEnvironmentEndpointCollectionPage, err error) + GetOutboundNetworkDependenciesEndpointsComplete(ctx context.Context, resourceGroupName string, name string) (result web.OutboundEnvironmentEndpointCollectionIterator, err error) + GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.RemotePrivateEndpointConnectionARMResource, err error) + GetPrivateEndpointConnectionList(ctx context.Context, resourceGroupName string, name string) (result web.PrivateEndpointConnectionCollectionPage, err error) + GetPrivateEndpointConnectionListComplete(ctx context.Context, resourceGroupName string, name string) (result web.PrivateEndpointConnectionCollectionIterator, err error) + GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result web.PrivateLinkResourcesWrapper, err error) + GetVipInfo(ctx context.Context, resourceGroupName string, name string) (result web.AddressResponse, err error) + GetWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.WorkerPoolResource, err error) + List(ctx context.Context) (result web.AppServiceEnvironmentCollectionPage, err error) + ListComplete(ctx context.Context) (result web.AppServiceEnvironmentCollectionIterator, err error) + ListAppServicePlans(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlanCollectionPage, err error) + ListAppServicePlansComplete(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlanCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.AppServiceEnvironmentCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.AppServiceEnvironmentCollectionIterator, err error) + ListCapacities(ctx context.Context, resourceGroupName string, name string) (result web.StampCapacityCollectionPage, err error) + ListCapacitiesComplete(ctx context.Context, resourceGroupName string, name string) (result web.StampCapacityCollectionIterator, err error) + ListDiagnostics(ctx context.Context, resourceGroupName string, name string) (result web.ListHostingEnvironmentDiagnostics, err error) + ListMultiRoleMetricDefinitions(ctx context.Context, resourceGroupName string, name string) (result web.ResourceMetricDefinitionCollectionPage, err error) + ListMultiRoleMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string) (result web.ResourceMetricDefinitionCollectionIterator, err error) + ListMultiRolePoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, instance string) (result web.ResourceMetricDefinitionCollectionPage, err error) + ListMultiRolePoolInstanceMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, instance string) (result web.ResourceMetricDefinitionCollectionIterator, err error) + ListMultiRolePools(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolCollectionPage, err error) + ListMultiRolePoolsComplete(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolCollectionIterator, err error) + ListMultiRolePoolSkus(ctx context.Context, resourceGroupName string, name string) (result web.SkuInfoCollectionPage, err error) + ListMultiRolePoolSkusComplete(ctx context.Context, resourceGroupName string, name string) (result web.SkuInfoCollectionIterator, err error) + ListMultiRoleUsages(ctx context.Context, resourceGroupName string, name string) (result web.UsageCollectionPage, err error) + ListMultiRoleUsagesComplete(ctx context.Context, resourceGroupName string, name string) (result web.UsageCollectionIterator, err error) + ListOperations(ctx context.Context, resourceGroupName string, name string) (result web.ListOperation, err error) + ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionPage, err error) + ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionIterator, err error) + ListWebApps(ctx context.Context, resourceGroupName string, name string, propertiesToInclude string) (result web.AppCollectionPage, err error) + ListWebAppsComplete(ctx context.Context, resourceGroupName string, name string, propertiesToInclude string) (result web.AppCollectionIterator, err error) + ListWebWorkerMetricDefinitions(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.ResourceMetricDefinitionCollectionPage, err error) + ListWebWorkerMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.ResourceMetricDefinitionCollectionIterator, err error) + ListWebWorkerUsages(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.UsageCollectionPage, err error) + ListWebWorkerUsagesComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.UsageCollectionIterator, err error) + ListWorkerPoolInstanceMetricDefinitions(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string) (result web.ResourceMetricDefinitionCollectionPage, err error) + ListWorkerPoolInstanceMetricDefinitionsComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string, instance string) (result web.ResourceMetricDefinitionCollectionIterator, err error) + ListWorkerPools(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolCollectionPage, err error) + ListWorkerPoolsComplete(ctx context.Context, resourceGroupName string, name string) (result web.WorkerPoolCollectionIterator, err error) + ListWorkerPoolSkus(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.SkuInfoCollectionPage, err error) + ListWorkerPoolSkusComplete(ctx context.Context, resourceGroupName string, name string, workerPoolName string) (result web.SkuInfoCollectionIterator, err error) + Reboot(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + Resume(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentsResumeFuture, err error) + ResumeComplete(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentsResumeAllFuture, err error) + Suspend(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentsSuspendFuture, err error) + SuspendComplete(ctx context.Context, resourceGroupName string, name string) (result web.AppServiceEnvironmentsSuspendAllFuture, err error) + Update(ctx context.Context, resourceGroupName string, name string, hostingEnvironmentEnvelope web.AppServiceEnvironmentPatchResource) (result web.AppServiceEnvironmentResource, err error) + UpdateAseNetworkingConfiguration(ctx context.Context, resourceGroupName string, name string, aseNetworkingConfiguration web.AseV3NetworkingConfiguration) (result web.AseV3NetworkingConfiguration, err error) + UpdateMultiRolePool(ctx context.Context, resourceGroupName string, name string, multiRolePoolEnvelope web.WorkerPoolResource) (result web.WorkerPoolResource, err error) + UpdateWorkerPool(ctx context.Context, resourceGroupName string, name string, workerPoolName string, workerPoolEnvelope web.WorkerPoolResource) (result web.WorkerPoolResource, err error) +} + +var _ AppServiceEnvironmentsClientAPI = (*web.AppServiceEnvironmentsClient)(nil) + +// AppServicePlansClientAPI contains the set of methods on the AppServicePlansClient type. +type AppServicePlansClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, appServicePlan web.AppServicePlan) (result web.AppServicePlansCreateOrUpdateFuture, err error) + CreateOrUpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route web.VnetRoute) (result web.VnetRoute, err error) + Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) + DeleteVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result web.AppServicePlan, err error) + GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnection, err error) + GetHybridConnectionPlanLimit(ctx context.Context, resourceGroupName string, name string) (result web.HybridConnectionLimits, err error) + GetRouteForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string) (result web.ListVnetRoute, err error) + GetServerFarmSkus(ctx context.Context, resourceGroupName string, name string) (result web.SetObject, err error) + GetVnetFromServerFarm(ctx context.Context, resourceGroupName string, name string, vnetName string) (result web.VnetInfoResource, err error) + GetVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result web.VnetGateway, err error) + List(ctx context.Context, detailed *bool) (result web.AppServicePlanCollectionPage, err error) + ListComplete(ctx context.Context, detailed *bool) (result web.AppServicePlanCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.AppServicePlanCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.AppServicePlanCollectionIterator, err error) + ListCapabilities(ctx context.Context, resourceGroupName string, name string) (result web.ListCapability, err error) + ListHybridConnectionKeys(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnectionKey, err error) + ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result web.HybridConnectionCollectionPage, err error) + ListHybridConnectionsComplete(ctx context.Context, resourceGroupName string, name string) (result web.HybridConnectionCollectionIterator, err error) + ListRoutesForVnet(ctx context.Context, resourceGroupName string, name string, vnetName string) (result web.ListVnetRoute, err error) + ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionPage, err error) + ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionIterator, err error) + ListVnets(ctx context.Context, resourceGroupName string, name string) (result web.ListVnetInfoResource, err error) + ListWebApps(ctx context.Context, resourceGroupName string, name string, skipToken string, filter string, top string) (result web.AppCollectionPage, err error) + ListWebAppsComplete(ctx context.Context, resourceGroupName string, name string, skipToken string, filter string, top string) (result web.AppCollectionIterator, err error) + ListWebAppsByHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.ResourceCollectionPage, err error) + ListWebAppsByHybridConnectionComplete(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.ResourceCollectionIterator, err error) + RebootWorker(ctx context.Context, resourceGroupName string, name string, workerName string) (result autorest.Response, err error) + RestartWebApps(ctx context.Context, resourceGroupName string, name string, softRestart *bool) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, name string, appServicePlan web.AppServicePlanPatchResource) (result web.AppServicePlan, err error) + UpdateVnetGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope web.VnetGateway) (result web.VnetGateway, err error) + UpdateVnetRoute(ctx context.Context, resourceGroupName string, name string, vnetName string, routeName string, route web.VnetRoute) (result web.VnetRoute, err error) +} + +var _ AppServicePlansClientAPI = (*web.AppServicePlansClient)(nil) + +// CertificatesClientAPI contains the set of methods on the CertificatesClient type. +type CertificatesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, certificateEnvelope web.Certificate) (result web.Certificate, err error) + Delete(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result web.Certificate, err error) + List(ctx context.Context, filter string) (result web.CertificateCollectionPage, err error) + ListComplete(ctx context.Context, filter string) (result web.CertificateCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.CertificateCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.CertificateCollectionIterator, err error) + Update(ctx context.Context, resourceGroupName string, name string, certificateEnvelope web.CertificatePatchResource) (result web.Certificate, err error) +} + +var _ CertificatesClientAPI = (*web.CertificatesClient)(nil) + +// ContainerAppsClientAPI contains the set of methods on the ContainerAppsClient type. +type ContainerAppsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, containerAppEnvelope web.ContainerApp) (result web.ContainerAppsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, name string) (result web.ContainerAppsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result web.ContainerApp, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.ContainerAppCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.ContainerAppCollectionIterator, err error) + ListBySubscription(ctx context.Context) (result web.ContainerAppCollectionPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result web.ContainerAppCollectionIterator, err error) + ListSecrets(ctx context.Context, name string) (result web.SecretsCollection, err error) +} + +var _ ContainerAppsClientAPI = (*web.ContainerAppsClient)(nil) + +// ContainerAppsRevisionsClientAPI contains the set of methods on the ContainerAppsRevisionsClient type. +type ContainerAppsRevisionsClientAPI interface { + ActivateRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result autorest.Response, err error) + DeactivateRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result autorest.Response, err error) + GetRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result web.Revision, err error) + ListRevisions(ctx context.Context, resourceGroupName string, containerAppName string) (result web.RevisionCollectionPage, err error) + ListRevisionsComplete(ctx context.Context, resourceGroupName string, containerAppName string) (result web.RevisionCollectionIterator, err error) + RestartRevision(ctx context.Context, resourceGroupName string, containerAppName string, name string) (result autorest.Response, err error) +} + +var _ ContainerAppsRevisionsClientAPI = (*web.ContainerAppsRevisionsClient)(nil) + +// DeletedWebAppsClientAPI contains the set of methods on the DeletedWebAppsClient type. +type DeletedWebAppsClientAPI interface { + GetDeletedWebAppByLocation(ctx context.Context, location string, deletedSiteID string) (result web.DeletedSite, err error) + List(ctx context.Context) (result web.DeletedWebAppCollectionPage, err error) + ListComplete(ctx context.Context) (result web.DeletedWebAppCollectionIterator, err error) + ListByLocation(ctx context.Context, location string) (result web.DeletedWebAppCollectionPage, err error) + ListByLocationComplete(ctx context.Context, location string) (result web.DeletedWebAppCollectionIterator, err error) +} + +var _ DeletedWebAppsClientAPI = (*web.DeletedWebAppsClient)(nil) + +// DiagnosticsClientAPI contains the set of methods on the DiagnosticsClient type. +type DiagnosticsClientAPI interface { + ExecuteSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DiagnosticAnalysis, err error) + ExecuteSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DiagnosticAnalysis, err error) + ExecuteSiteDetector(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DiagnosticDetectorResponse, err error) + ExecuteSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, diagnosticCategory string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DiagnosticDetectorResponse, err error) + GetHostingEnvironmentDetectorResponse(ctx context.Context, resourceGroupName string, name string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) + GetSiteAnalysis(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string) (result web.AnalysisDefinition, err error) + GetSiteAnalysisSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, analysisName string, slot string) (result web.AnalysisDefinition, err error) + GetSiteDetector(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string) (result web.DetectorDefinitionResource, err error) + GetSiteDetectorResponse(ctx context.Context, resourceGroupName string, siteName string, detectorName string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) + GetSiteDetectorResponseSlot(ctx context.Context, resourceGroupName string, siteName string, detectorName string, slot string, startTime *date.Time, endTime *date.Time, timeGrain string) (result web.DetectorResponse, err error) + GetSiteDetectorSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, detectorName string, slot string) (result web.DetectorDefinitionResource, err error) + GetSiteDiagnosticCategory(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result web.DiagnosticCategory, err error) + GetSiteDiagnosticCategorySlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result web.DiagnosticCategory, err error) + ListHostingEnvironmentDetectorResponses(ctx context.Context, resourceGroupName string, name string) (result web.DetectorResponseCollectionPage, err error) + ListHostingEnvironmentDetectorResponsesComplete(ctx context.Context, resourceGroupName string, name string) (result web.DetectorResponseCollectionIterator, err error) + ListSiteAnalyses(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result web.DiagnosticAnalysisCollectionPage, err error) + ListSiteAnalysesComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result web.DiagnosticAnalysisCollectionIterator, err error) + ListSiteAnalysesSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result web.DiagnosticAnalysisCollectionPage, err error) + ListSiteAnalysesSlotComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result web.DiagnosticAnalysisCollectionIterator, err error) + ListSiteDetectorResponses(ctx context.Context, resourceGroupName string, siteName string) (result web.DetectorResponseCollectionPage, err error) + ListSiteDetectorResponsesComplete(ctx context.Context, resourceGroupName string, siteName string) (result web.DetectorResponseCollectionIterator, err error) + ListSiteDetectorResponsesSlot(ctx context.Context, resourceGroupName string, siteName string, slot string) (result web.DetectorResponseCollectionPage, err error) + ListSiteDetectorResponsesSlotComplete(ctx context.Context, resourceGroupName string, siteName string, slot string) (result web.DetectorResponseCollectionIterator, err error) + ListSiteDetectors(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result web.DiagnosticDetectorCollectionPage, err error) + ListSiteDetectorsComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string) (result web.DiagnosticDetectorCollectionIterator, err error) + ListSiteDetectorsSlot(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result web.DiagnosticDetectorCollectionPage, err error) + ListSiteDetectorsSlotComplete(ctx context.Context, resourceGroupName string, siteName string, diagnosticCategory string, slot string) (result web.DiagnosticDetectorCollectionIterator, err error) + ListSiteDiagnosticCategories(ctx context.Context, resourceGroupName string, siteName string) (result web.DiagnosticCategoryCollectionPage, err error) + ListSiteDiagnosticCategoriesComplete(ctx context.Context, resourceGroupName string, siteName string) (result web.DiagnosticCategoryCollectionIterator, err error) + ListSiteDiagnosticCategoriesSlot(ctx context.Context, resourceGroupName string, siteName string, slot string) (result web.DiagnosticCategoryCollectionPage, err error) + ListSiteDiagnosticCategoriesSlotComplete(ctx context.Context, resourceGroupName string, siteName string, slot string) (result web.DiagnosticCategoryCollectionIterator, err error) +} + +var _ DiagnosticsClientAPI = (*web.DiagnosticsClient)(nil) + +// GlobalClientAPI contains the set of methods on the GlobalClient type. +type GlobalClientAPI interface { + GetDeletedWebApp(ctx context.Context, deletedSiteID string) (result web.DeletedSite, err error) + GetDeletedWebAppSnapshots(ctx context.Context, deletedSiteID string) (result web.ListSnapshot, err error) + GetSubscriptionOperationWithAsyncResponse(ctx context.Context, location string, operationID string) (result autorest.Response, err error) +} + +var _ GlobalClientAPI = (*web.GlobalClient)(nil) + +// KubeEnvironmentsClientAPI contains the set of methods on the KubeEnvironmentsClient type. +type KubeEnvironmentsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope web.KubeEnvironment) (result web.KubeEnvironmentsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, name string) (result web.KubeEnvironmentsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result web.KubeEnvironment, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.KubeEnvironmentCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.KubeEnvironmentCollectionIterator, err error) + ListBySubscription(ctx context.Context) (result web.KubeEnvironmentCollectionPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result web.KubeEnvironmentCollectionIterator, err error) + Update(ctx context.Context, resourceGroupName string, name string, kubeEnvironmentEnvelope web.KubeEnvironmentPatchResource) (result web.KubeEnvironment, err error) +} + +var _ KubeEnvironmentsClientAPI = (*web.KubeEnvironmentsClient)(nil) + +// ProviderClientAPI contains the set of methods on the ProviderClient type. +type ProviderClientAPI interface { + GetAvailableStacks(ctx context.Context, osTypeSelected string) (result web.ApplicationStackCollectionPage, err error) + GetAvailableStacksComplete(ctx context.Context, osTypeSelected string) (result web.ApplicationStackCollectionIterator, err error) + GetAvailableStacksOnPrem(ctx context.Context, osTypeSelected string) (result web.ApplicationStackCollectionPage, err error) + GetAvailableStacksOnPremComplete(ctx context.Context, osTypeSelected string) (result web.ApplicationStackCollectionIterator, err error) + GetFunctionAppStacks(ctx context.Context, stackOsType string) (result web.FunctionAppStackCollectionPage, err error) + GetFunctionAppStacksComplete(ctx context.Context, stackOsType string) (result web.FunctionAppStackCollectionIterator, err error) + GetFunctionAppStacksForLocation(ctx context.Context, location string, stackOsType string) (result web.FunctionAppStackCollectionPage, err error) + GetFunctionAppStacksForLocationComplete(ctx context.Context, location string, stackOsType string) (result web.FunctionAppStackCollectionIterator, err error) + GetWebAppStacks(ctx context.Context, stackOsType string) (result web.AppStackCollectionPage, err error) + GetWebAppStacksComplete(ctx context.Context, stackOsType string) (result web.AppStackCollectionIterator, err error) + GetWebAppStacksForLocation(ctx context.Context, location string, stackOsType string) (result web.AppStackCollectionPage, err error) + GetWebAppStacksForLocationComplete(ctx context.Context, location string, stackOsType string) (result web.AppStackCollectionIterator, err error) + ListOperations(ctx context.Context) (result web.CsmOperationCollectionPage, err error) + ListOperationsComplete(ctx context.Context) (result web.CsmOperationCollectionIterator, err error) +} + +var _ ProviderClientAPI = (*web.ProviderClient)(nil) + +// RecommendationsClientAPI contains the set of methods on the RecommendationsClient type. +type RecommendationsClientAPI interface { + DisableAllForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) + DisableAllForWebApp(ctx context.Context, resourceGroupName string, siteName string) (result autorest.Response, err error) + DisableRecommendationForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, name string, hostingEnvironmentName string) (result autorest.Response, err error) + DisableRecommendationForSite(ctx context.Context, resourceGroupName string, siteName string, name string) (result autorest.Response, err error) + DisableRecommendationForSubscription(ctx context.Context, name string) (result autorest.Response, err error) + GetRuleDetailsByHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, name string, updateSeen *bool, recommendationID string) (result web.RecommendationRule, err error) + GetRuleDetailsByWebApp(ctx context.Context, resourceGroupName string, siteName string, name string, updateSeen *bool, recommendationID string) (result web.RecommendationRule, err error) + List(ctx context.Context, featured *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListComplete(ctx context.Context, featured *bool, filter string) (result web.RecommendationCollectionIterator, err error) + ListHistoryForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListHistoryForHostingEnvironmentComplete(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, expiredOnly *bool, filter string) (result web.RecommendationCollectionIterator, err error) + ListHistoryForWebApp(ctx context.Context, resourceGroupName string, siteName string, expiredOnly *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListHistoryForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, expiredOnly *bool, filter string) (result web.RecommendationCollectionIterator, err error) + ListRecommendedRulesForHostingEnvironment(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListRecommendedRulesForHostingEnvironmentComplete(ctx context.Context, resourceGroupName string, hostingEnvironmentName string, featured *bool, filter string) (result web.RecommendationCollectionIterator, err error) + ListRecommendedRulesForWebApp(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result web.RecommendationCollectionPage, err error) + ListRecommendedRulesForWebAppComplete(ctx context.Context, resourceGroupName string, siteName string, featured *bool, filter string) (result web.RecommendationCollectionIterator, err error) + ResetAllFilters(ctx context.Context) (result autorest.Response, err error) + ResetAllFiltersForHostingEnvironment(ctx context.Context, resourceGroupName string, environmentName string, hostingEnvironmentName string) (result autorest.Response, err error) + ResetAllFiltersForWebApp(ctx context.Context, resourceGroupName string, siteName string) (result autorest.Response, err error) +} + +var _ RecommendationsClientAPI = (*web.RecommendationsClient)(nil) + +// ResourceHealthMetadataClientAPI contains the set of methods on the ResourceHealthMetadataClient type. +type ResourceHealthMetadataClientAPI interface { + GetBySite(ctx context.Context, resourceGroupName string, name string) (result web.ResourceHealthMetadata, err error) + GetBySiteSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ResourceHealthMetadata, err error) + List(ctx context.Context) (result web.ResourceHealthMetadataCollectionPage, err error) + ListComplete(ctx context.Context) (result web.ResourceHealthMetadataCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result web.ResourceHealthMetadataCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.ResourceHealthMetadataCollectionIterator, err error) + ListBySite(ctx context.Context, resourceGroupName string, name string) (result web.ResourceHealthMetadataCollectionPage, err error) + ListBySiteComplete(ctx context.Context, resourceGroupName string, name string) (result web.ResourceHealthMetadataCollectionIterator, err error) + ListBySiteSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ResourceHealthMetadataCollectionPage, err error) + ListBySiteSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ResourceHealthMetadataCollectionIterator, err error) +} + +var _ ResourceHealthMetadataClientAPI = (*web.ResourceHealthMetadataClient)(nil) + +// StaticSitesClientAPI contains the set of methods on the StaticSitesClient type. +type StaticSitesClientAPI interface { + ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper web.PrivateLinkConnectionApprovalRequestResource) (result web.StaticSitesApproveOrRejectPrivateEndpointConnectionFuture, err error) + CreateOrUpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope web.StaticSiteARMResource) (result web.StaticSitesCreateOrUpdateStaticSiteFuture, err error) + CreateOrUpdateStaticSiteAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + CreateOrUpdateStaticSiteBuildAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + CreateOrUpdateStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + CreateOrUpdateStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope web.StaticSiteCustomDomainRequestPropertiesARMResource) (result web.StaticSitesCreateOrUpdateStaticSiteCustomDomainFuture, err error) + CreateOrUpdateStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + CreateUserRolesInvitationLink(ctx context.Context, resourceGroupName string, name string, staticSiteUserRolesInvitationEnvelope web.StaticSiteUserInvitationRequestResource) (result web.StaticSiteUserInvitationResponseResource, err error) + CreateZipDeploymentForStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteZipDeploymentEnvelope web.StaticSiteZipDeploymentARMResource) (result web.StaticSitesCreateZipDeploymentForStaticSiteFuture, err error) + CreateZipDeploymentForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, staticSiteZipDeploymentEnvelope web.StaticSiteZipDeploymentARMResource) (result web.StaticSitesCreateZipDeploymentForStaticSiteBuildFuture, err error) + DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.StaticSitesDeletePrivateEndpointConnectionFuture, err error) + DeleteStaticSite(ctx context.Context, resourceGroupName string, name string) (result web.StaticSitesDeleteStaticSiteFuture, err error) + DeleteStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StaticSitesDeleteStaticSiteBuildFuture, err error) + DeleteStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result web.StaticSitesDeleteStaticSiteCustomDomainFuture, err error) + DeleteStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string) (result autorest.Response, err error) + DetachStaticSite(ctx context.Context, resourceGroupName string, name string) (result web.StaticSitesDetachStaticSiteFuture, err error) + DetachUserProvidedFunctionAppFromStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string) (result autorest.Response, err error) + DetachUserProvidedFunctionAppFromStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string) (result autorest.Response, err error) + GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.RemotePrivateEndpointConnectionARMResource, err error) + GetPrivateEndpointConnectionList(ctx context.Context, resourceGroupName string, name string) (result web.PrivateEndpointConnectionCollectionPage, err error) + GetPrivateEndpointConnectionListComplete(ctx context.Context, resourceGroupName string, name string) (result web.PrivateEndpointConnectionCollectionIterator, err error) + GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result web.PrivateLinkResourcesWrapper, err error) + GetStaticSite(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteARMResource, err error) + GetStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StaticSiteBuildARMResource, err error) + GetStaticSiteBuilds(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteBuildCollectionPage, err error) + GetStaticSiteBuildsComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteBuildCollectionIterator, err error) + GetStaticSiteCustomDomain(ctx context.Context, resourceGroupName string, name string, domainName string) (result web.StaticSiteCustomDomainOverviewARMResource, err error) + GetStaticSitesByResourceGroup(ctx context.Context, resourceGroupName string) (result web.StaticSiteCollectionPage, err error) + GetStaticSitesByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result web.StaticSiteCollectionIterator, err error) + GetUserProvidedFunctionAppForStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string) (result web.StaticSiteUserProvidedFunctionAppARMResource, err error) + GetUserProvidedFunctionAppForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string) (result web.StaticSiteUserProvidedFunctionAppARMResource, err error) + GetUserProvidedFunctionAppsForStaticSite(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteUserProvidedFunctionAppsCollectionPage, err error) + GetUserProvidedFunctionAppsForStaticSiteComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteUserProvidedFunctionAppsCollectionIterator, err error) + GetUserProvidedFunctionAppsForStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StaticSiteUserProvidedFunctionAppsCollectionPage, err error) + GetUserProvidedFunctionAppsForStaticSiteBuildComplete(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StaticSiteUserProvidedFunctionAppsCollectionIterator, err error) + List(ctx context.Context) (result web.StaticSiteCollectionPage, err error) + ListComplete(ctx context.Context) (result web.StaticSiteCollectionIterator, err error) + ListStaticSiteAppSettings(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListStaticSiteBuildAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StringDictionary, err error) + ListStaticSiteBuildFunctionAppSettings(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StringDictionary, err error) + ListStaticSiteBuildFunctions(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StaticSiteFunctionOverviewCollectionPage, err error) + ListStaticSiteBuildFunctionsComplete(ctx context.Context, resourceGroupName string, name string, environmentName string) (result web.StaticSiteFunctionOverviewCollectionIterator, err error) + ListStaticSiteConfiguredRoles(ctx context.Context, resourceGroupName string, name string) (result web.StringList, err error) + ListStaticSiteCustomDomains(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteCustomDomainOverviewCollectionPage, err error) + ListStaticSiteCustomDomainsComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteCustomDomainOverviewCollectionIterator, err error) + ListStaticSiteFunctionAppSettings(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListStaticSiteFunctions(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteFunctionOverviewCollectionPage, err error) + ListStaticSiteFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result web.StaticSiteFunctionOverviewCollectionIterator, err error) + ListStaticSiteSecrets(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListStaticSiteUsers(ctx context.Context, resourceGroupName string, name string, authprovider string) (result web.StaticSiteUserCollectionPage, err error) + ListStaticSiteUsersComplete(ctx context.Context, resourceGroupName string, name string, authprovider string) (result web.StaticSiteUserCollectionIterator, err error) + PreviewWorkflow(ctx context.Context, location string, staticSitesWorkflowPreviewRequest web.StaticSitesWorkflowPreviewRequest) (result web.StaticSitesWorkflowPreview, err error) + RegisterUserProvidedFunctionAppWithStaticSite(ctx context.Context, resourceGroupName string, name string, functionAppName string, staticSiteUserProvidedFunctionEnvelope web.StaticSiteUserProvidedFunctionAppARMResource, isForced *bool) (result web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteFuture, err error) + RegisterUserProvidedFunctionAppWithStaticSiteBuild(ctx context.Context, resourceGroupName string, name string, environmentName string, functionAppName string, staticSiteUserProvidedFunctionEnvelope web.StaticSiteUserProvidedFunctionAppARMResource, isForced *bool) (result web.StaticSitesRegisterUserProvidedFunctionAppWithStaticSiteBuildFuture, err error) + ResetStaticSiteAPIKey(ctx context.Context, resourceGroupName string, name string, resetPropertiesEnvelope web.StaticSiteResetPropertiesARMResource) (result autorest.Response, err error) + UpdateStaticSite(ctx context.Context, resourceGroupName string, name string, staticSiteEnvelope web.StaticSitePatchResource) (result web.StaticSiteARMResource, err error) + UpdateStaticSiteUser(ctx context.Context, resourceGroupName string, name string, authprovider string, userid string, staticSiteUserEnvelope web.StaticSiteUserARMResource) (result web.StaticSiteUserARMResource, err error) + ValidateCustomDomainCanBeAddedToStaticSite(ctx context.Context, resourceGroupName string, name string, domainName string, staticSiteCustomDomainRequestPropertiesEnvelope web.StaticSiteCustomDomainRequestPropertiesARMResource) (result web.StaticSitesValidateCustomDomainCanBeAddedToStaticSiteFuture, err error) +} + +var _ StaticSitesClientAPI = (*web.StaticSitesClient)(nil) + +// AppsClientAPI contains the set of methods on the AppsClient type. +type AppsClientAPI interface { + AddPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn web.PremierAddOn) (result web.PremierAddOn, err error) + AddPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn web.PremierAddOn, slot string) (result web.PremierAddOn, err error) + AnalyzeCustomHostname(ctx context.Context, resourceGroupName string, name string, hostName string) (result web.CustomHostnameAnalysisResult, err error) + AnalyzeCustomHostnameSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result web.CustomHostnameAnalysisResult, err error) + ApplySlotConfigToProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity) (result autorest.Response, err error) + ApplySlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result autorest.Response, err error) + ApproveOrRejectPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper web.PrivateLinkConnectionApprovalRequestResource) (result web.AppsApproveOrRejectPrivateEndpointConnectionFuture, err error) + ApproveOrRejectPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, privateEndpointWrapper web.PrivateLinkConnectionApprovalRequestResource, slot string) (result web.AppsApproveOrRejectPrivateEndpointConnectionSlotFuture, err error) + Backup(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest) (result web.BackupItem, err error) + BackupSlot(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest, slot string) (result web.BackupItem, err error) + CreateDeployment(ctx context.Context, resourceGroupName string, name string, ID string, deployment web.Deployment) (result web.Deployment, err error) + CreateDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string, deployment web.Deployment) (result web.Deployment, err error) + CreateFunction(ctx context.Context, resourceGroupName string, name string, functionName string, functionEnvelope web.FunctionEnvelope) (result web.AppsCreateFunctionFuture, err error) + CreateInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string, functionEnvelope web.FunctionEnvelope) (result web.AppsCreateInstanceFunctionSlotFuture, err error) + CreateInstanceMSDeployOperation(ctx context.Context, resourceGroupName string, name string, instanceID string, mSDeploy web.MSDeploy) (result web.AppsCreateInstanceMSDeployOperationFuture, err error) + CreateInstanceMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string, mSDeploy web.MSDeploy) (result web.AppsCreateInstanceMSDeployOperationSlotFuture, err error) + CreateMSDeployOperation(ctx context.Context, resourceGroupName string, name string, mSDeploy web.MSDeploy) (result web.AppsCreateMSDeployOperationFuture, err error) + CreateMSDeployOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, mSDeploy web.MSDeploy) (result web.AppsCreateMSDeployOperationSlotFuture, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, name string, siteEnvelope web.Site) (result web.AppsCreateOrUpdateFuture, err error) + CreateOrUpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig web.SiteConfigResource) (result web.SiteConfigResource, err error) + CreateOrUpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig web.SiteConfigResource, slot string) (result web.SiteConfigResource, err error) + CreateOrUpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier web.Identifier) (result web.Identifier, err error) + CreateOrUpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier web.Identifier, slot string) (result web.Identifier, err error) + CreateOrUpdateFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, key web.KeyInfo) (result web.KeyInfo, err error) + CreateOrUpdateFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string, key web.KeyInfo) (result web.KeyInfo, err error) + CreateOrUpdateHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding web.HostNameBinding) (result web.HostNameBinding, err error) + CreateOrUpdateHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, hostName string, hostNameBinding web.HostNameBinding, slot string) (result web.HostNameBinding, err error) + CreateOrUpdateHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, key web.KeyInfo) (result web.KeyInfo, err error) + CreateOrUpdateHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string, key web.KeyInfo) (result web.KeyInfo, err error) + CreateOrUpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope web.HybridConnection) (result web.HybridConnection, err error) + CreateOrUpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope web.HybridConnection, slot string) (result web.HybridConnection, err error) + CreateOrUpdatePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate web.PublicCertificate) (result web.PublicCertificate, err error) + CreateOrUpdatePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, publicCertificateName string, publicCertificate web.PublicCertificate, slot string) (result web.PublicCertificate, err error) + CreateOrUpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope web.RelayServiceConnectionEntity) (result web.RelayServiceConnectionEntity, err error) + CreateOrUpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope web.RelayServiceConnectionEntity, slot string) (result web.RelayServiceConnectionEntity, err error) + CreateOrUpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope web.Site, slot string) (result web.AppsCreateOrUpdateSlotFuture, err error) + CreateOrUpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl web.SiteSourceControl) (result web.AppsCreateOrUpdateSourceControlFuture, err error) + CreateOrUpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl web.SiteSourceControl, slot string) (result web.AppsCreateOrUpdateSourceControlSlotFuture, err error) + CreateOrUpdateSwiftVirtualNetworkConnectionWithCheck(ctx context.Context, resourceGroupName string, name string, connectionEnvelope web.SwiftVirtualNetwork) (result web.SwiftVirtualNetwork, err error) + CreateOrUpdateSwiftVirtualNetworkConnectionWithCheckSlot(ctx context.Context, resourceGroupName string, name string, connectionEnvelope web.SwiftVirtualNetwork, slot string) (result web.SwiftVirtualNetwork, err error) + CreateOrUpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope web.VnetInfoResource) (result web.VnetInfoResource, err error) + CreateOrUpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope web.VnetGateway) (result web.VnetGateway, err error) + CreateOrUpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope web.VnetGateway, slot string) (result web.VnetGateway, err error) + CreateOrUpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope web.VnetInfoResource, slot string) (result web.VnetInfoResource, err error) + Delete(ctx context.Context, resourceGroupName string, name string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) + DeleteBackup(ctx context.Context, resourceGroupName string, name string, backupID string) (result autorest.Response, err error) + DeleteBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + DeleteBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + DeleteBackupSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result autorest.Response, err error) + DeleteContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) + DeleteContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) + DeleteDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result autorest.Response, err error) + DeleteDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result autorest.Response, err error) + DeleteDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result autorest.Response, err error) + DeleteDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result autorest.Response, err error) + DeleteFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result autorest.Response, err error) + DeleteFunctionSecret(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string) (result autorest.Response, err error) + DeleteFunctionSecretSlot(ctx context.Context, resourceGroupName string, name string, functionName string, keyName string, slot string) (result autorest.Response, err error) + DeleteHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result autorest.Response, err error) + DeleteHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result autorest.Response, err error) + DeleteHostSecret(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string) (result autorest.Response, err error) + DeleteHostSecretSlot(ctx context.Context, resourceGroupName string, name string, keyType string, keyName string, slot string) (result autorest.Response, err error) + DeleteHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result autorest.Response, err error) + DeleteHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result autorest.Response, err error) + DeleteInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result autorest.Response, err error) + DeleteInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result autorest.Response, err error) + DeleteInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result autorest.Response, err error) + DeletePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result autorest.Response, err error) + DeletePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result autorest.Response, err error) + DeletePrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.AppsDeletePrivateEndpointConnectionFuture, err error) + DeletePrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string) (result web.AppsDeletePrivateEndpointConnectionSlotFuture, err error) + DeleteProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result autorest.Response, err error) + DeleteProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result autorest.Response, err error) + DeletePublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result autorest.Response, err error) + DeletePublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result autorest.Response, err error) + DeleteRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result autorest.Response, err error) + DeleteRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result autorest.Response, err error) + DeleteSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result autorest.Response, err error) + DeleteSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result autorest.Response, err error) + DeleteSlot(ctx context.Context, resourceGroupName string, name string, slot string, deleteMetrics *bool, deleteEmptyServerFarm *bool) (result autorest.Response, err error) + DeleteSourceControl(ctx context.Context, resourceGroupName string, name string, additionalFlags string) (result autorest.Response, err error) + DeleteSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string, additionalFlags string) (result autorest.Response, err error) + DeleteSwiftVirtualNetwork(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + DeleteSwiftVirtualNetworkSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + DeleteTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) + DeleteTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) + DeleteVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result autorest.Response, err error) + DeleteVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result autorest.Response, err error) + DiscoverBackup(ctx context.Context, resourceGroupName string, name string, request web.RestoreRequest) (result web.RestoreRequest, err error) + DiscoverBackupSlot(ctx context.Context, resourceGroupName string, name string, request web.RestoreRequest, slot string) (result web.RestoreRequest, err error) + GenerateNewSitePublishingPassword(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + GenerateNewSitePublishingPasswordSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + Get(ctx context.Context, resourceGroupName string, name string) (result web.Site, err error) + GetAppSettingKeyVaultReference(ctx context.Context, resourceGroupName string, name string, appSettingKey string) (result web.APIKVReference, err error) + GetAppSettingKeyVaultReferenceSlot(ctx context.Context, resourceGroupName string, name string, appSettingKey string, slot string) (result web.APIKVReference, err error) + GetAppSettingsKeyVaultReferences(ctx context.Context, resourceGroupName string, name string) (result web.APIKVReferenceCollectionPage, err error) + GetAppSettingsKeyVaultReferencesComplete(ctx context.Context, resourceGroupName string, name string) (result web.APIKVReferenceCollectionIterator, err error) + GetAppSettingsKeyVaultReferencesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.APIKVReferenceCollectionPage, err error) + GetAppSettingsKeyVaultReferencesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.APIKVReferenceCollectionIterator, err error) + GetAuthSettings(ctx context.Context, resourceGroupName string, name string) (result web.SiteAuthSettings, err error) + GetAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteAuthSettings, err error) + GetAuthSettingsV2(ctx context.Context, resourceGroupName string, name string) (result web.SiteAuthSettingsV2, err error) + GetAuthSettingsV2Slot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteAuthSettingsV2, err error) + GetAuthSettingsV2WithoutSecrets(ctx context.Context, resourceGroupName string, name string) (result web.SiteAuthSettingsV2, err error) + GetBackupConfiguration(ctx context.Context, resourceGroupName string, name string) (result web.BackupRequest, err error) + GetBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.BackupRequest, err error) + GetBackupStatus(ctx context.Context, resourceGroupName string, name string, backupID string) (result web.BackupItem, err error) + GetBackupStatusSlot(ctx context.Context, resourceGroupName string, name string, backupID string, slot string) (result web.BackupItem, err error) + GetConfiguration(ctx context.Context, resourceGroupName string, name string) (result web.SiteConfigResource, err error) + GetConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteConfigResource, err error) + GetConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result web.SiteConfigResource, err error) + GetConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result web.SiteConfigResource, err error) + GetContainerLogsZip(ctx context.Context, resourceGroupName string, name string) (result web.ReadCloser, err error) + GetContainerLogsZipSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ReadCloser, err error) + GetContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result web.ContinuousWebJob, err error) + GetContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result web.ContinuousWebJob, err error) + GetDeployment(ctx context.Context, resourceGroupName string, name string, ID string) (result web.Deployment, err error) + GetDeploymentSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result web.Deployment, err error) + GetDiagnosticLogsConfiguration(ctx context.Context, resourceGroupName string, name string) (result web.SiteLogsConfig, err error) + GetDiagnosticLogsConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteLogsConfig, err error) + GetDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string) (result web.Identifier, err error) + GetDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, slot string) (result web.Identifier, err error) + GetFtpAllowed(ctx context.Context, resourceGroupName string, name string) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + GetFtpAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + GetFunction(ctx context.Context, resourceGroupName string, name string, functionName string) (result web.FunctionEnvelope, err error) + GetFunctionsAdminToken(ctx context.Context, resourceGroupName string, name string) (result web.String, err error) + GetFunctionsAdminTokenSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.String, err error) + GetHostNameBinding(ctx context.Context, resourceGroupName string, name string, hostName string) (result web.HostNameBinding, err error) + GetHostNameBindingSlot(ctx context.Context, resourceGroupName string, name string, slot string, hostName string) (result web.HostNameBinding, err error) + GetHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string) (result web.HybridConnection, err error) + GetHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, slot string) (result web.HybridConnection, err error) + GetInstanceFunctionSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.FunctionEnvelope, err error) + GetInstanceInfo(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.SiteInstanceStatus, err error) + GetInstanceInfoSlot(ctx context.Context, resourceGroupName string, name string, instanceID string, slot string) (result web.SiteInstanceStatus, err error) + GetInstanceMSDeployLog(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.MSDeployLog, err error) + GetInstanceMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result web.MSDeployLog, err error) + GetInstanceMsDeployStatus(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.MSDeployStatus, err error) + GetInstanceMsDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result web.MSDeployStatus, err error) + GetInstanceProcess(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result web.ProcessInfo, err error) + GetInstanceProcessDump(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result web.ReadCloser, err error) + GetInstanceProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ReadCloser, err error) + GetInstanceProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, instanceID string) (result web.ProcessModuleInfo, err error) + GetInstanceProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string, instanceID string) (result web.ProcessModuleInfo, err error) + GetInstanceProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessInfo, err error) + GetMigrateMySQLStatus(ctx context.Context, resourceGroupName string, name string) (result web.MigrateMySQLStatus, err error) + GetMigrateMySQLStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.MigrateMySQLStatus, err error) + GetMSDeployLog(ctx context.Context, resourceGroupName string, name string) (result web.MSDeployLog, err error) + GetMSDeployLogSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.MSDeployLog, err error) + GetMSDeployStatus(ctx context.Context, resourceGroupName string, name string) (result web.MSDeployStatus, err error) + GetMSDeployStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.MSDeployStatus, err error) + GetNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, operationID string) (result web.ListNetworkTrace, err error) + GetNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result web.ListNetworkTrace, err error) + GetNetworkTraceOperationSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result web.ListNetworkTrace, err error) + GetNetworkTraceOperationV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result web.ListNetworkTrace, err error) + GetNetworkTraces(ctx context.Context, resourceGroupName string, name string, operationID string) (result web.ListNetworkTrace, err error) + GetNetworkTracesSlot(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result web.ListNetworkTrace, err error) + GetNetworkTracesSlotV2(ctx context.Context, resourceGroupName string, name string, operationID string, slot string) (result web.ListNetworkTrace, err error) + GetNetworkTracesV2(ctx context.Context, resourceGroupName string, name string, operationID string) (result web.ListNetworkTrace, err error) + GetPremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string) (result web.PremierAddOn, err error) + GetPremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, slot string) (result web.PremierAddOn, err error) + GetPrivateAccess(ctx context.Context, resourceGroupName string, name string) (result web.PrivateAccess, err error) + GetPrivateAccessSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PrivateAccess, err error) + GetPrivateEndpointConnection(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string) (result web.RemotePrivateEndpointConnectionARMResource, err error) + GetPrivateEndpointConnectionList(ctx context.Context, resourceGroupName string, name string) (result web.PrivateEndpointConnectionCollectionPage, err error) + GetPrivateEndpointConnectionListComplete(ctx context.Context, resourceGroupName string, name string) (result web.PrivateEndpointConnectionCollectionIterator, err error) + GetPrivateEndpointConnectionListSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PrivateEndpointConnectionCollectionPage, err error) + GetPrivateEndpointConnectionListSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PrivateEndpointConnectionCollectionIterator, err error) + GetPrivateEndpointConnectionSlot(ctx context.Context, resourceGroupName string, name string, privateEndpointConnectionName string, slot string) (result web.RemotePrivateEndpointConnectionARMResource, err error) + GetPrivateLinkResources(ctx context.Context, resourceGroupName string, name string) (result web.PrivateLinkResourcesWrapper, err error) + GetPrivateLinkResourcesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PrivateLinkResourcesWrapper, err error) + GetProcess(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ProcessInfo, err error) + GetProcessDump(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ReadCloser, err error) + GetProcessDumpSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ReadCloser, err error) + GetProcessModule(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string) (result web.ProcessModuleInfo, err error) + GetProcessModuleSlot(ctx context.Context, resourceGroupName string, name string, processID string, baseAddress string, slot string) (result web.ProcessModuleInfo, err error) + GetProcessSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ProcessInfo, err error) + GetPublicCertificate(ctx context.Context, resourceGroupName string, name string, publicCertificateName string) (result web.PublicCertificate, err error) + GetPublicCertificateSlot(ctx context.Context, resourceGroupName string, name string, slot string, publicCertificateName string) (result web.PublicCertificate, err error) + GetRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string) (result web.RelayServiceConnectionEntity, err error) + GetRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, slot string) (result web.RelayServiceConnectionEntity, err error) + GetScmAllowed(ctx context.Context, resourceGroupName string, name string) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + GetScmAllowedSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + GetSiteConnectionStringKeyVaultReference(ctx context.Context, resourceGroupName string, name string, connectionStringKey string) (result web.APIKVReference, err error) + GetSiteConnectionStringKeyVaultReferences(ctx context.Context, resourceGroupName string, name string) (result web.APIKVReferenceCollectionPage, err error) + GetSiteConnectionStringKeyVaultReferencesComplete(ctx context.Context, resourceGroupName string, name string) (result web.APIKVReferenceCollectionIterator, err error) + GetSiteConnectionStringKeyVaultReferenceSlot(ctx context.Context, resourceGroupName string, name string, connectionStringKey string, slot string) (result web.APIKVReference, err error) + GetSiteConnectionStringKeyVaultReferencesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.APIKVReferenceCollectionPage, err error) + GetSiteConnectionStringKeyVaultReferencesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.APIKVReferenceCollectionIterator, err error) + GetSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result web.SiteExtensionInfo, err error) + GetSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result web.SiteExtensionInfo, err error) + GetSitePhpErrorLogFlag(ctx context.Context, resourceGroupName string, name string) (result web.SitePhpErrorLogFlag, err error) + GetSitePhpErrorLogFlagSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SitePhpErrorLogFlag, err error) + GetSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.Site, err error) + GetSourceControl(ctx context.Context, resourceGroupName string, name string) (result web.SiteSourceControl, err error) + GetSourceControlSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteSourceControl, err error) + GetSwiftVirtualNetworkConnection(ctx context.Context, resourceGroupName string, name string) (result web.SwiftVirtualNetwork, err error) + GetSwiftVirtualNetworkConnectionSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SwiftVirtualNetwork, err error) + GetTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result web.TriggeredWebJob, err error) + GetTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string) (result web.TriggeredJobHistory, err error) + GetTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, ID string, slot string) (result web.TriggeredJobHistory, err error) + GetTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result web.TriggeredWebJob, err error) + GetVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string) (result web.VnetInfoResource, err error) + GetVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string) (result web.VnetGateway, err error) + GetVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, slot string) (result web.VnetGateway, err error) + GetVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, slot string) (result web.VnetInfoResource, err error) + GetWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result web.Job, err error) + GetWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result web.Job, err error) + GetWebSiteContainerLogs(ctx context.Context, resourceGroupName string, name string) (result web.ReadCloser, err error) + GetWebSiteContainerLogsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ReadCloser, err error) + InstallSiteExtension(ctx context.Context, resourceGroupName string, name string, siteExtensionID string) (result web.AppsInstallSiteExtensionFuture, err error) + InstallSiteExtensionSlot(ctx context.Context, resourceGroupName string, name string, siteExtensionID string, slot string) (result web.AppsInstallSiteExtensionSlotFuture, err error) + IsCloneable(ctx context.Context, resourceGroupName string, name string) (result web.SiteCloneability, err error) + IsCloneableSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteCloneability, err error) + List(ctx context.Context) (result web.AppCollectionPage, err error) + ListComplete(ctx context.Context) (result web.AppCollectionIterator, err error) + ListApplicationSettings(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.StringDictionary, err error) + ListAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string) (result web.AzureStoragePropertyDictionaryResource, err error) + ListAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.AzureStoragePropertyDictionaryResource, err error) + ListBackups(ctx context.Context, resourceGroupName string, name string) (result web.BackupItemCollectionPage, err error) + ListBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result web.BackupItemCollectionIterator, err error) + ListBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.BackupItemCollectionPage, err error) + ListBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.BackupItemCollectionIterator, err error) + ListBackupStatusSecrets(ctx context.Context, resourceGroupName string, name string, backupID string, request web.BackupRequest) (result web.BackupItem, err error) + ListBackupStatusSecretsSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request web.BackupRequest, slot string) (result web.BackupItem, err error) + ListBasicPublishingCredentialsPolicies(ctx context.Context, resourceGroupName string, name string) (result web.PublishingCredentialsPoliciesCollectionPage, err error) + ListBasicPublishingCredentialsPoliciesComplete(ctx context.Context, resourceGroupName string, name string) (result web.PublishingCredentialsPoliciesCollectionIterator, err error) + ListBasicPublishingCredentialsPoliciesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PublishingCredentialsPoliciesCollectionPage, err error) + ListBasicPublishingCredentialsPoliciesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PublishingCredentialsPoliciesCollectionIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string, includeSlots *bool) (result web.AppCollectionPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, includeSlots *bool) (result web.AppCollectionIterator, err error) + ListConfigurations(ctx context.Context, resourceGroupName string, name string) (result web.SiteConfigResourceCollectionPage, err error) + ListConfigurationsComplete(ctx context.Context, resourceGroupName string, name string) (result web.SiteConfigResourceCollectionIterator, err error) + ListConfigurationSnapshotInfo(ctx context.Context, resourceGroupName string, name string) (result web.SiteConfigurationSnapshotInfoCollectionPage, err error) + ListConfigurationSnapshotInfoComplete(ctx context.Context, resourceGroupName string, name string) (result web.SiteConfigurationSnapshotInfoCollectionIterator, err error) + ListConfigurationSnapshotInfoSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteConfigurationSnapshotInfoCollectionPage, err error) + ListConfigurationSnapshotInfoSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteConfigurationSnapshotInfoCollectionIterator, err error) + ListConfigurationsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteConfigResourceCollectionPage, err error) + ListConfigurationsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteConfigResourceCollectionIterator, err error) + ListConnectionStrings(ctx context.Context, resourceGroupName string, name string) (result web.ConnectionStringDictionary, err error) + ListConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ConnectionStringDictionary, err error) + ListContinuousWebJobs(ctx context.Context, resourceGroupName string, name string) (result web.ContinuousWebJobCollectionPage, err error) + ListContinuousWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result web.ContinuousWebJobCollectionIterator, err error) + ListContinuousWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ContinuousWebJobCollectionPage, err error) + ListContinuousWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ContinuousWebJobCollectionIterator, err error) + ListDeploymentLog(ctx context.Context, resourceGroupName string, name string, ID string) (result web.Deployment, err error) + ListDeploymentLogSlot(ctx context.Context, resourceGroupName string, name string, ID string, slot string) (result web.Deployment, err error) + ListDeployments(ctx context.Context, resourceGroupName string, name string) (result web.DeploymentCollectionPage, err error) + ListDeploymentsComplete(ctx context.Context, resourceGroupName string, name string) (result web.DeploymentCollectionIterator, err error) + ListDeploymentsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.DeploymentCollectionPage, err error) + ListDeploymentsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.DeploymentCollectionIterator, err error) + ListDomainOwnershipIdentifiers(ctx context.Context, resourceGroupName string, name string) (result web.IdentifierCollectionPage, err error) + ListDomainOwnershipIdentifiersComplete(ctx context.Context, resourceGroupName string, name string) (result web.IdentifierCollectionIterator, err error) + ListDomainOwnershipIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.IdentifierCollectionPage, err error) + ListDomainOwnershipIdentifiersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.IdentifierCollectionIterator, err error) + ListFunctionKeys(ctx context.Context, resourceGroupName string, name string, functionName string) (result web.StringDictionary, err error) + ListFunctionKeysSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.StringDictionary, err error) + ListFunctions(ctx context.Context, resourceGroupName string, name string) (result web.FunctionEnvelopeCollectionPage, err error) + ListFunctionsComplete(ctx context.Context, resourceGroupName string, name string) (result web.FunctionEnvelopeCollectionIterator, err error) + ListFunctionSecrets(ctx context.Context, resourceGroupName string, name string, functionName string) (result web.FunctionSecrets, err error) + ListFunctionSecretsSlot(ctx context.Context, resourceGroupName string, name string, functionName string, slot string) (result web.FunctionSecrets, err error) + ListHostKeys(ctx context.Context, resourceGroupName string, name string) (result web.HostKeys, err error) + ListHostKeysSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HostKeys, err error) + ListHostNameBindings(ctx context.Context, resourceGroupName string, name string) (result web.HostNameBindingCollectionPage, err error) + ListHostNameBindingsComplete(ctx context.Context, resourceGroupName string, name string) (result web.HostNameBindingCollectionIterator, err error) + ListHostNameBindingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HostNameBindingCollectionPage, err error) + ListHostNameBindingsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HostNameBindingCollectionIterator, err error) + ListHybridConnections(ctx context.Context, resourceGroupName string, name string) (result web.HybridConnection, err error) + ListHybridConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.HybridConnection, err error) + ListInstanceFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.FunctionEnvelopeCollectionPage, err error) + ListInstanceFunctionsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.FunctionEnvelopeCollectionIterator, err error) + ListInstanceIdentifiers(ctx context.Context, resourceGroupName string, name string) (result web.AppInstanceStatusCollectionPage, err error) + ListInstanceIdentifiersComplete(ctx context.Context, resourceGroupName string, name string) (result web.AppInstanceStatusCollectionIterator, err error) + ListInstanceIdentifiersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.AppInstanceStatusCollectionPage, err error) + ListInstanceIdentifiersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.AppInstanceStatusCollectionIterator, err error) + ListInstanceProcesses(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.ProcessInfoCollectionPage, err error) + ListInstanceProcessesComplete(ctx context.Context, resourceGroupName string, name string, instanceID string) (result web.ProcessInfoCollectionIterator, err error) + ListInstanceProcessesSlot(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result web.ProcessInfoCollectionPage, err error) + ListInstanceProcessesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, instanceID string) (result web.ProcessInfoCollectionIterator, err error) + ListInstanceProcessModules(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result web.ProcessModuleInfoCollectionPage, err error) + ListInstanceProcessModulesComplete(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result web.ProcessModuleInfoCollectionIterator, err error) + ListInstanceProcessModulesSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessModuleInfoCollectionPage, err error) + ListInstanceProcessModulesSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessModuleInfoCollectionIterator, err error) + ListInstanceProcessThreads(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result web.ProcessThreadInfoCollectionPage, err error) + ListInstanceProcessThreadsComplete(ctx context.Context, resourceGroupName string, name string, processID string, instanceID string) (result web.ProcessThreadInfoCollectionIterator, err error) + ListInstanceProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessThreadInfoCollectionPage, err error) + ListInstanceProcessThreadsSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string, instanceID string) (result web.ProcessThreadInfoCollectionIterator, err error) + ListMetadata(ctx context.Context, resourceGroupName string, name string) (result web.StringDictionary, err error) + ListMetadataSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.StringDictionary, err error) + ListNetworkFeatures(ctx context.Context, resourceGroupName string, name string, view string) (result web.NetworkFeatures, err error) + ListNetworkFeaturesSlot(ctx context.Context, resourceGroupName string, name string, view string, slot string) (result web.NetworkFeatures, err error) + ListPerfMonCounters(ctx context.Context, resourceGroupName string, name string, filter string) (result web.PerfMonCounterCollectionPage, err error) + ListPerfMonCountersComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result web.PerfMonCounterCollectionIterator, err error) + ListPerfMonCountersSlot(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result web.PerfMonCounterCollectionPage, err error) + ListPerfMonCountersSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result web.PerfMonCounterCollectionIterator, err error) + ListPremierAddOns(ctx context.Context, resourceGroupName string, name string) (result web.PremierAddOn, err error) + ListPremierAddOnsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PremierAddOn, err error) + ListProcesses(ctx context.Context, resourceGroupName string, name string) (result web.ProcessInfoCollectionPage, err error) + ListProcessesComplete(ctx context.Context, resourceGroupName string, name string) (result web.ProcessInfoCollectionIterator, err error) + ListProcessesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ProcessInfoCollectionPage, err error) + ListProcessesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ProcessInfoCollectionIterator, err error) + ListProcessModules(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ProcessModuleInfoCollectionPage, err error) + ListProcessModulesComplete(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ProcessModuleInfoCollectionIterator, err error) + ListProcessModulesSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ProcessModuleInfoCollectionPage, err error) + ListProcessModulesSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ProcessModuleInfoCollectionIterator, err error) + ListProcessThreads(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ProcessThreadInfoCollectionPage, err error) + ListProcessThreadsComplete(ctx context.Context, resourceGroupName string, name string, processID string) (result web.ProcessThreadInfoCollectionIterator, err error) + ListProcessThreadsSlot(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ProcessThreadInfoCollectionPage, err error) + ListProcessThreadsSlotComplete(ctx context.Context, resourceGroupName string, name string, processID string, slot string) (result web.ProcessThreadInfoCollectionIterator, err error) + ListPublicCertificates(ctx context.Context, resourceGroupName string, name string) (result web.PublicCertificateCollectionPage, err error) + ListPublicCertificatesComplete(ctx context.Context, resourceGroupName string, name string) (result web.PublicCertificateCollectionIterator, err error) + ListPublicCertificatesSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PublicCertificateCollectionPage, err error) + ListPublicCertificatesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PublicCertificateCollectionIterator, err error) + ListPublishingCredentials(ctx context.Context, resourceGroupName string, name string) (result web.AppsListPublishingCredentialsFuture, err error) + ListPublishingCredentialsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.AppsListPublishingCredentialsSlotFuture, err error) + ListPublishingProfileXMLWithSecrets(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions web.CsmPublishingProfileOptions) (result web.ReadCloser, err error) + ListPublishingProfileXMLWithSecretsSlot(ctx context.Context, resourceGroupName string, name string, publishingProfileOptions web.CsmPublishingProfileOptions, slot string) (result web.ReadCloser, err error) + ListRelayServiceConnections(ctx context.Context, resourceGroupName string, name string) (result web.RelayServiceConnectionEntity, err error) + ListRelayServiceConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.RelayServiceConnectionEntity, err error) + ListSiteBackups(ctx context.Context, resourceGroupName string, name string) (result web.BackupItemCollectionPage, err error) + ListSiteBackupsComplete(ctx context.Context, resourceGroupName string, name string) (result web.BackupItemCollectionIterator, err error) + ListSiteBackupsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.BackupItemCollectionPage, err error) + ListSiteBackupsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.BackupItemCollectionIterator, err error) + ListSiteExtensions(ctx context.Context, resourceGroupName string, name string) (result web.SiteExtensionInfoCollectionPage, err error) + ListSiteExtensionsComplete(ctx context.Context, resourceGroupName string, name string) (result web.SiteExtensionInfoCollectionIterator, err error) + ListSiteExtensionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteExtensionInfoCollectionPage, err error) + ListSiteExtensionsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SiteExtensionInfoCollectionIterator, err error) + ListSitePushSettings(ctx context.Context, resourceGroupName string, name string) (result web.PushSettings, err error) + ListSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.PushSettings, err error) + ListSlotConfigurationNames(ctx context.Context, resourceGroupName string, name string) (result web.SlotConfigNamesResource, err error) + ListSlotDifferencesFromProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity) (result web.SlotDifferenceCollectionPage, err error) + ListSlotDifferencesFromProductionComplete(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity) (result web.SlotDifferenceCollectionIterator, err error) + ListSlotDifferencesSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result web.SlotDifferenceCollectionPage, err error) + ListSlotDifferencesSlotComplete(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result web.SlotDifferenceCollectionIterator, err error) + ListSlots(ctx context.Context, resourceGroupName string, name string) (result web.AppCollectionPage, err error) + ListSlotsComplete(ctx context.Context, resourceGroupName string, name string) (result web.AppCollectionIterator, err error) + ListSnapshots(ctx context.Context, resourceGroupName string, name string) (result web.SnapshotCollectionPage, err error) + ListSnapshotsComplete(ctx context.Context, resourceGroupName string, name string) (result web.SnapshotCollectionIterator, err error) + ListSnapshotsFromDRSecondary(ctx context.Context, resourceGroupName string, name string) (result web.SnapshotCollectionPage, err error) + ListSnapshotsFromDRSecondaryComplete(ctx context.Context, resourceGroupName string, name string) (result web.SnapshotCollectionIterator, err error) + ListSnapshotsFromDRSecondarySlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SnapshotCollectionPage, err error) + ListSnapshotsFromDRSecondarySlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SnapshotCollectionIterator, err error) + ListSnapshotsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SnapshotCollectionPage, err error) + ListSnapshotsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.SnapshotCollectionIterator, err error) + ListSyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result web.FunctionSecrets, err error) + ListSyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.FunctionSecrets, err error) + ListSyncStatus(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + ListSyncStatusSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + ListTriggeredWebJobHistory(ctx context.Context, resourceGroupName string, name string, webJobName string) (result web.TriggeredJobHistoryCollectionPage, err error) + ListTriggeredWebJobHistoryComplete(ctx context.Context, resourceGroupName string, name string, webJobName string) (result web.TriggeredJobHistoryCollectionIterator, err error) + ListTriggeredWebJobHistorySlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result web.TriggeredJobHistoryCollectionPage, err error) + ListTriggeredWebJobHistorySlotComplete(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result web.TriggeredJobHistoryCollectionIterator, err error) + ListTriggeredWebJobs(ctx context.Context, resourceGroupName string, name string) (result web.TriggeredWebJobCollectionPage, err error) + ListTriggeredWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result web.TriggeredWebJobCollectionIterator, err error) + ListTriggeredWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.TriggeredWebJobCollectionPage, err error) + ListTriggeredWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.TriggeredWebJobCollectionIterator, err error) + ListUsages(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionPage, err error) + ListUsagesComplete(ctx context.Context, resourceGroupName string, name string, filter string) (result web.CsmUsageQuotaCollectionIterator, err error) + ListUsagesSlot(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result web.CsmUsageQuotaCollectionPage, err error) + ListUsagesSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string, filter string) (result web.CsmUsageQuotaCollectionIterator, err error) + ListVnetConnections(ctx context.Context, resourceGroupName string, name string) (result web.ListVnetInfoResource, err error) + ListVnetConnectionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.ListVnetInfoResource, err error) + ListWebJobs(ctx context.Context, resourceGroupName string, name string) (result web.JobCollectionPage, err error) + ListWebJobsComplete(ctx context.Context, resourceGroupName string, name string) (result web.JobCollectionIterator, err error) + ListWebJobsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result web.JobCollectionPage, err error) + ListWebJobsSlotComplete(ctx context.Context, resourceGroupName string, name string, slot string) (result web.JobCollectionIterator, err error) + MigrateMySQL(ctx context.Context, resourceGroupName string, name string, migrationRequestEnvelope web.MigrateMySQLRequest) (result web.AppsMigrateMySQLFuture, err error) + MigrateStorage(ctx context.Context, subscriptionName string, resourceGroupName string, name string, migrationOptions web.StorageMigrationOptions) (result web.AppsMigrateStorageFuture, err error) + PutPrivateAccessVnet(ctx context.Context, resourceGroupName string, name string, access web.PrivateAccess) (result web.PrivateAccess, err error) + PutPrivateAccessVnetSlot(ctx context.Context, resourceGroupName string, name string, access web.PrivateAccess, slot string) (result web.PrivateAccess, err error) + RecoverSiteConfigurationSnapshot(ctx context.Context, resourceGroupName string, name string, snapshotID string) (result autorest.Response, err error) + RecoverSiteConfigurationSnapshotSlot(ctx context.Context, resourceGroupName string, name string, snapshotID string, slot string) (result autorest.Response, err error) + ResetProductionSlotConfig(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + ResetSlotConfigurationSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + Restart(ctx context.Context, resourceGroupName string, name string, softRestart *bool, synchronous *bool) (result autorest.Response, err error) + RestartSlot(ctx context.Context, resourceGroupName string, name string, slot string, softRestart *bool, synchronous *bool) (result autorest.Response, err error) + Restore(ctx context.Context, resourceGroupName string, name string, backupID string, request web.RestoreRequest) (result web.AppsRestoreFuture, err error) + RestoreFromBackupBlob(ctx context.Context, resourceGroupName string, name string, request web.RestoreRequest) (result web.AppsRestoreFromBackupBlobFuture, err error) + RestoreFromBackupBlobSlot(ctx context.Context, resourceGroupName string, name string, request web.RestoreRequest, slot string) (result web.AppsRestoreFromBackupBlobSlotFuture, err error) + RestoreFromDeletedApp(ctx context.Context, resourceGroupName string, name string, restoreRequest web.DeletedAppRestoreRequest) (result web.AppsRestoreFromDeletedAppFuture, err error) + RestoreFromDeletedAppSlot(ctx context.Context, resourceGroupName string, name string, restoreRequest web.DeletedAppRestoreRequest, slot string) (result web.AppsRestoreFromDeletedAppSlotFuture, err error) + RestoreSlot(ctx context.Context, resourceGroupName string, name string, backupID string, request web.RestoreRequest, slot string) (result web.AppsRestoreSlotFuture, err error) + RestoreSnapshot(ctx context.Context, resourceGroupName string, name string, restoreRequest web.SnapshotRestoreRequest) (result web.AppsRestoreSnapshotFuture, err error) + RestoreSnapshotSlot(ctx context.Context, resourceGroupName string, name string, restoreRequest web.SnapshotRestoreRequest, slot string) (result web.AppsRestoreSnapshotSlotFuture, err error) + RunTriggeredWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) + RunTriggeredWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) + Start(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + StartContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) + StartContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) + StartNetworkTrace(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result web.AppsStartNetworkTraceFuture, err error) + StartNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result web.AppsStartNetworkTraceSlotFuture, err error) + StartSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + StartWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result web.String, err error) + StartWebSiteNetworkTraceOperation(ctx context.Context, resourceGroupName string, name string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result web.AppsStartWebSiteNetworkTraceOperationFuture, err error) + StartWebSiteNetworkTraceOperationSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result web.AppsStartWebSiteNetworkTraceOperationSlotFuture, err error) + StartWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string, durationInSeconds *int32, maxFrameLength *int32, sasURL string) (result web.String, err error) + Stop(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + StopContinuousWebJob(ctx context.Context, resourceGroupName string, name string, webJobName string) (result autorest.Response, err error) + StopContinuousWebJobSlot(ctx context.Context, resourceGroupName string, name string, webJobName string, slot string) (result autorest.Response, err error) + StopNetworkTrace(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + StopNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + StopSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + StopWebSiteNetworkTrace(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + StopWebSiteNetworkTraceSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + SwapSlotSlot(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity, slot string) (result web.AppsSwapSlotSlotFuture, err error) + SwapSlotWithProduction(ctx context.Context, resourceGroupName string, name string, slotSwapEntity web.CsmSlotEntity) (result web.AppsSwapSlotWithProductionFuture, err error) + SyncFunctions(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + SyncFunctionsSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + SyncFunctionTriggers(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + SyncFunctionTriggersSlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + SyncRepository(ctx context.Context, resourceGroupName string, name string) (result autorest.Response, err error) + SyncRepositorySlot(ctx context.Context, resourceGroupName string, name string, slot string) (result autorest.Response, err error) + Update(ctx context.Context, resourceGroupName string, name string, siteEnvelope web.SitePatchResource) (result web.Site, err error) + UpdateApplicationSettings(ctx context.Context, resourceGroupName string, name string, appSettings web.StringDictionary) (result web.StringDictionary, err error) + UpdateApplicationSettingsSlot(ctx context.Context, resourceGroupName string, name string, appSettings web.StringDictionary, slot string) (result web.StringDictionary, err error) + UpdateAuthSettings(ctx context.Context, resourceGroupName string, name string, siteAuthSettings web.SiteAuthSettings) (result web.SiteAuthSettings, err error) + UpdateAuthSettingsSlot(ctx context.Context, resourceGroupName string, name string, siteAuthSettings web.SiteAuthSettings, slot string) (result web.SiteAuthSettings, err error) + UpdateAuthSettingsV2(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 web.SiteAuthSettingsV2) (result web.SiteAuthSettingsV2, err error) + UpdateAuthSettingsV2Slot(ctx context.Context, resourceGroupName string, name string, siteAuthSettingsV2 web.SiteAuthSettingsV2, slot string) (result web.SiteAuthSettingsV2, err error) + UpdateAzureStorageAccounts(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts web.AzureStoragePropertyDictionaryResource) (result web.AzureStoragePropertyDictionaryResource, err error) + UpdateAzureStorageAccountsSlot(ctx context.Context, resourceGroupName string, name string, azureStorageAccounts web.AzureStoragePropertyDictionaryResource, slot string) (result web.AzureStoragePropertyDictionaryResource, err error) + UpdateBackupConfiguration(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest) (result web.BackupRequest, err error) + UpdateBackupConfigurationSlot(ctx context.Context, resourceGroupName string, name string, request web.BackupRequest, slot string) (result web.BackupRequest, err error) + UpdateConfiguration(ctx context.Context, resourceGroupName string, name string, siteConfig web.SiteConfigResource) (result web.SiteConfigResource, err error) + UpdateConfigurationSlot(ctx context.Context, resourceGroupName string, name string, siteConfig web.SiteConfigResource, slot string) (result web.SiteConfigResource, err error) + UpdateConnectionStrings(ctx context.Context, resourceGroupName string, name string, connectionStrings web.ConnectionStringDictionary) (result web.ConnectionStringDictionary, err error) + UpdateConnectionStringsSlot(ctx context.Context, resourceGroupName string, name string, connectionStrings web.ConnectionStringDictionary, slot string) (result web.ConnectionStringDictionary, err error) + UpdateDiagnosticLogsConfig(ctx context.Context, resourceGroupName string, name string, siteLogsConfig web.SiteLogsConfig) (result web.SiteLogsConfig, err error) + UpdateDiagnosticLogsConfigSlot(ctx context.Context, resourceGroupName string, name string, siteLogsConfig web.SiteLogsConfig, slot string) (result web.SiteLogsConfig, err error) + UpdateDomainOwnershipIdentifier(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier web.Identifier) (result web.Identifier, err error) + UpdateDomainOwnershipIdentifierSlot(ctx context.Context, resourceGroupName string, name string, domainOwnershipIdentifierName string, domainOwnershipIdentifier web.Identifier, slot string) (result web.Identifier, err error) + UpdateFtpAllowed(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity web.CsmPublishingCredentialsPoliciesEntity) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + UpdateFtpAllowedSlot(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity web.CsmPublishingCredentialsPoliciesEntity, slot string) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + UpdateHybridConnection(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope web.HybridConnection) (result web.HybridConnection, err error) + UpdateHybridConnectionSlot(ctx context.Context, resourceGroupName string, name string, namespaceName string, relayName string, connectionEnvelope web.HybridConnection, slot string) (result web.HybridConnection, err error) + UpdateMetadata(ctx context.Context, resourceGroupName string, name string, metadata web.StringDictionary) (result web.StringDictionary, err error) + UpdateMetadataSlot(ctx context.Context, resourceGroupName string, name string, metadata web.StringDictionary, slot string) (result web.StringDictionary, err error) + UpdatePremierAddOn(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn web.PremierAddOnPatchResource) (result web.PremierAddOn, err error) + UpdatePremierAddOnSlot(ctx context.Context, resourceGroupName string, name string, premierAddOnName string, premierAddOn web.PremierAddOnPatchResource, slot string) (result web.PremierAddOn, err error) + UpdateRelayServiceConnection(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope web.RelayServiceConnectionEntity) (result web.RelayServiceConnectionEntity, err error) + UpdateRelayServiceConnectionSlot(ctx context.Context, resourceGroupName string, name string, entityName string, connectionEnvelope web.RelayServiceConnectionEntity, slot string) (result web.RelayServiceConnectionEntity, err error) + UpdateScmAllowed(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity web.CsmPublishingCredentialsPoliciesEntity) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + UpdateScmAllowedSlot(ctx context.Context, resourceGroupName string, name string, csmPublishingAccessPoliciesEntity web.CsmPublishingCredentialsPoliciesEntity, slot string) (result web.CsmPublishingCredentialsPoliciesEntity, err error) + UpdateSitePushSettings(ctx context.Context, resourceGroupName string, name string, pushSettings web.PushSettings) (result web.PushSettings, err error) + UpdateSitePushSettingsSlot(ctx context.Context, resourceGroupName string, name string, pushSettings web.PushSettings, slot string) (result web.PushSettings, err error) + UpdateSlot(ctx context.Context, resourceGroupName string, name string, siteEnvelope web.SitePatchResource, slot string) (result web.Site, err error) + UpdateSlotConfigurationNames(ctx context.Context, resourceGroupName string, name string, slotConfigNames web.SlotConfigNamesResource) (result web.SlotConfigNamesResource, err error) + UpdateSourceControl(ctx context.Context, resourceGroupName string, name string, siteSourceControl web.SiteSourceControl) (result web.SiteSourceControl, err error) + UpdateSourceControlSlot(ctx context.Context, resourceGroupName string, name string, siteSourceControl web.SiteSourceControl, slot string) (result web.SiteSourceControl, err error) + UpdateSwiftVirtualNetworkConnectionWithCheck(ctx context.Context, resourceGroupName string, name string, connectionEnvelope web.SwiftVirtualNetwork) (result web.SwiftVirtualNetwork, err error) + UpdateSwiftVirtualNetworkConnectionWithCheckSlot(ctx context.Context, resourceGroupName string, name string, connectionEnvelope web.SwiftVirtualNetwork, slot string) (result web.SwiftVirtualNetwork, err error) + UpdateVnetConnection(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope web.VnetInfoResource) (result web.VnetInfoResource, err error) + UpdateVnetConnectionGateway(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope web.VnetGateway) (result web.VnetGateway, err error) + UpdateVnetConnectionGatewaySlot(ctx context.Context, resourceGroupName string, name string, vnetName string, gatewayName string, connectionEnvelope web.VnetGateway, slot string) (result web.VnetGateway, err error) + UpdateVnetConnectionSlot(ctx context.Context, resourceGroupName string, name string, vnetName string, connectionEnvelope web.VnetInfoResource, slot string) (result web.VnetInfoResource, err error) +} + +var _ AppsClientAPI = (*web.AppsClient)(nil) From 78e73f4cad33cd8317374fc7503b1796f51bc5ae Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:11:02 +0800 Subject: [PATCH 2/8] Generated from specification/botservice/resource-manager/readme.md tag package-preview-2021-05 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- .../botservice/mgmt/botservice/models.go | 15 + .../botservice/CHANGELOG.md | 116 ++++ .../2021-05-01-preview/botservice/_meta.json | 6 +- .../botservice/botserviceapi/interfaces.go | 2 +- .../2021-05-01-preview/botservice/channels.go | 4 +- .../2021-05-01-preview/botservice/enums.go | 15 + .../2021-05-01-preview/botservice/models.go | 555 +++++++++++++++++- 7 files changed, 698 insertions(+), 15 deletions(-) diff --git a/profiles/preview/preview/botservice/mgmt/botservice/models.go b/profiles/preview/preview/botservice/mgmt/botservice/models.go index 6544f25eb5bf..2d0e6f1d4d8d 100644 --- a/profiles/preview/preview/botservice/mgmt/botservice/models.go +++ b/profiles/preview/preview/botservice/mgmt/botservice/models.go @@ -108,6 +108,13 @@ const ( PrivateEndpointServiceConnectionStatusRejected PrivateEndpointServiceConnectionStatus = original.PrivateEndpointServiceConnectionStatusRejected ) +type PublicNetworkAccess = original.PublicNetworkAccess + +const ( + PublicNetworkAccessDisabled PublicNetworkAccess = original.PublicNetworkAccessDisabled + PublicNetworkAccessEnabled PublicNetworkAccess = original.PublicNetworkAccessEnabled +) + type RegenerateKeysChannelName = original.RegenerateKeysChannelName const ( @@ -145,6 +152,7 @@ type Channel = original.Channel type ChannelResponseList = original.ChannelResponseList type ChannelResponseListIterator = original.ChannelResponseListIterator type ChannelResponseListPage = original.ChannelResponseListPage +type ChannelSettings = original.ChannelSettings type ChannelsClient = original.ChannelsClient type CheckNameAvailabilityRequestBody = original.CheckNameAvailabilityRequestBody type CheckNameAvailabilityResponseBody = original.CheckNameAvailabilityResponseBody @@ -175,6 +183,7 @@ type KikChannelProperties = original.KikChannelProperties type LineChannel = original.LineChannel type LineChannelProperties = original.LineChannelProperties type LineRegistration = original.LineRegistration +type ListChannelWithKeysResponse = original.ListChannelWithKeysResponse type MsTeamsChannel = original.MsTeamsChannel type MsTeamsChannelProperties = original.MsTeamsChannelProperties type OperationDisplayInfo = original.OperationDisplayInfo @@ -200,8 +209,11 @@ type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionSt type Resource = original.Resource type ServiceProvider = original.ServiceProvider type ServiceProviderParameter = original.ServiceProviderParameter +type ServiceProviderParameterMetadata = original.ServiceProviderParameterMetadata +type ServiceProviderParameterMetadataConstraints = original.ServiceProviderParameterMetadataConstraints type ServiceProviderProperties = original.ServiceProviderProperties type ServiceProviderResponseList = original.ServiceProviderResponseList +type Site = original.Site type SiteInfo = original.SiteInfo type Sku = original.Sku type SkypeChannel = original.SkypeChannel @@ -324,6 +336,9 @@ func PossiblePrivateEndpointConnectionProvisioningStateValues() []PrivateEndpoin func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointServiceConnectionStatus { return original.PossiblePrivateEndpointServiceConnectionStatusValues() } +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return original.PossiblePublicNetworkAccessValues() +} func PossibleRegenerateKeysChannelNameValues() []RegenerateKeysChannelName { return original.PossibleRegenerateKeysChannelNameValues() } diff --git a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/CHANGELOG.md b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/CHANGELOG.md index 52911e4cc5e4..64acef3f50e3 100644 --- a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/CHANGELOG.md +++ b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/CHANGELOG.md @@ -1,2 +1,118 @@ # Change History +## Breaking Changes + +### Struct Changes + +#### Removed Struct Fields + +1. BotProperties.IsIsolated +1. WebChatSite.EnablePreview + +### Signature Changes + +#### Funcs + +1. ChannelsClient.ListWithKeys + - Returns + - From: BotChannel, error + - To: ListChannelWithKeysResponse, error +1. ChannelsClient.ListWithKeysResponder + - Returns + - From: BotChannel, error + - To: ListChannelWithKeysResponse, error + +## Additive Changes + +### New Constants + +1. PublicNetworkAccess.PublicNetworkAccessDisabled +1. PublicNetworkAccess.PublicNetworkAccessEnabled + +### New Funcs + +1. *ListChannelWithKeysResponse.UnmarshalJSON([]byte) error +1. ListChannelWithKeysResponse.MarshalJSON() ([]byte, error) +1. PossiblePublicNetworkAccessValues() []PublicNetworkAccess +1. Site.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### New Structs + +1. ChannelSettings +1. ListChannelWithKeysResponse +1. ServiceProviderParameterMetadata +1. ServiceProviderParameterMetadataConstraints +1. Site + +#### New Struct Fields + +1. AlexaChannel.Etag +1. AlexaChannel.Location +1. AlexaChannel.ProvisioningState +1. Bot.Zones +1. BotChannel.Zones +1. BotProperties.AllSettings +1. BotProperties.CmekEncryptionStatus +1. BotProperties.IsDeveloperAppInsightsAPIKeySet +1. BotProperties.IsStreamingSupported +1. BotProperties.ManifestURL +1. BotProperties.MigrationToken +1. BotProperties.Parameters +1. BotProperties.ProvisioningState +1. BotProperties.PublicNetworkAccess +1. BotProperties.PublishingCredentials +1. BotProperties.StorageResourceID +1. Channel.Etag +1. Channel.Location +1. Channel.ProvisioningState +1. ConnectionSetting.Zones +1. ConnectionSettingProperties.ID +1. ConnectionSettingProperties.Name +1. ConnectionSettingProperties.ProvisioningState +1. DirectLineChannel.Etag +1. DirectLineChannel.Location +1. DirectLineChannel.ProvisioningState +1. DirectLineChannelProperties.DirectLineEmbedCode +1. DirectLineSite.IsBlockUserUploadEnabled +1. DirectLineSpeechChannel.Etag +1. DirectLineSpeechChannel.Location +1. DirectLineSpeechChannel.ProvisioningState +1. EmailChannel.Etag +1. EmailChannel.Location +1. EmailChannel.ProvisioningState +1. FacebookChannel.Etag +1. FacebookChannel.Location +1. FacebookChannel.ProvisioningState +1. KikChannel.Etag +1. KikChannel.Location +1. KikChannel.ProvisioningState +1. LineChannel.Etag +1. LineChannel.Location +1. LineChannel.ProvisioningState +1. MsTeamsChannel.Etag +1. MsTeamsChannel.Location +1. MsTeamsChannel.ProvisioningState +1. MsTeamsChannelProperties.AcceptedTerms +1. MsTeamsChannelProperties.DeploymentEnvironment +1. MsTeamsChannelProperties.IncomingCallRoute +1. Resource.Zones +1. ServiceProviderParameter.Metadata +1. SkypeChannel.Etag +1. SkypeChannel.Location +1. SkypeChannel.ProvisioningState +1. SkypeChannelProperties.IncomingCallRoute +1. SlackChannel.Etag +1. SlackChannel.Location +1. SlackChannel.ProvisioningState +1. SmsChannel.Etag +1. SmsChannel.Location +1. SmsChannel.ProvisioningState +1. TelegramChannel.Etag +1. TelegramChannel.Location +1. TelegramChannel.ProvisioningState +1. WebChatChannel.Etag +1. WebChatChannel.Location +1. WebChatChannel.ProvisioningState +1. WebChatSite.IsWebchatPreviewEnabled diff --git a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/_meta.json b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/_meta.json index 1cfe0bdb62bf..c84aaff788c4 100644 --- a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/_meta.json +++ b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/_meta.json @@ -1,11 +1,11 @@ { - "commit": "bd64220293a403f70ae8beebd56fb86951007acf", + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", "readme": "/_/azure-rest-api-specs/specification/botservice/resource-manager/readme.md", "tag": "package-preview-2021-05", "use": "@microsoft.azure/autorest.go@2.1.187", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-preview-2021-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/botservice/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-preview-2021-05 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/botservice/resource-manager/readme.md", "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" } } \ No newline at end of file diff --git a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/botserviceapi/interfaces.go b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/botserviceapi/interfaces.go index aa786317ee81..cbbd2878251f 100644 --- a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/botserviceapi/interfaces.go +++ b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/botserviceapi/interfaces.go @@ -34,7 +34,7 @@ type ChannelsClientAPI interface { Get(ctx context.Context, resourceGroupName string, resourceName string, channelName string) (result botservice.BotChannel, err error) ListByResourceGroup(ctx context.Context, resourceGroupName string, resourceName string) (result botservice.ChannelResponseListPage, err error) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string, resourceName string) (result botservice.ChannelResponseListIterator, err error) - ListWithKeys(ctx context.Context, resourceGroupName string, resourceName string, channelName botservice.ChannelName) (result botservice.BotChannel, err error) + ListWithKeys(ctx context.Context, resourceGroupName string, resourceName string, channelName botservice.ChannelName) (result botservice.ListChannelWithKeysResponse, err error) Update(ctx context.Context, resourceGroupName string, resourceName string, channelName botservice.ChannelName, parameters botservice.BotChannel) (result botservice.BotChannel, err error) } diff --git a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/channels.go b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/channels.go index 94b1e32851b6..b8c4463a0dd2 100644 --- a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/channels.go +++ b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/channels.go @@ -446,7 +446,7 @@ func (client ChannelsClient) ListByResourceGroupComplete(ctx context.Context, re // resourceGroupName - the name of the Bot resource group in the user subscription. // resourceName - the name of the Bot resource. // channelName - the name of the Channel resource. -func (client ChannelsClient) ListWithKeys(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName) (result BotChannel, err error) { +func (client ChannelsClient) ListWithKeys(ctx context.Context, resourceGroupName string, resourceName string, channelName ChannelName) (result ListChannelWithKeysResponse, err error) { if tracing.IsEnabled() { ctx = tracing.StartSpan(ctx, fqdn+"/ChannelsClient.ListWithKeys") defer func() { @@ -521,7 +521,7 @@ func (client ChannelsClient) ListWithKeysSender(req *http.Request) (*http.Respon // ListWithKeysResponder handles the response to the ListWithKeys request. The method always // closes the http.Response Body. -func (client ChannelsClient) ListWithKeysResponder(resp *http.Response) (result BotChannel, err error) { +func (client ChannelsClient) ListWithKeysResponder(resp *http.Response) (result ListChannelWithKeysResponse, err error) { err = autorest.Respond( resp, azure.WithErrorUnlessStatusCode(http.StatusOK), diff --git a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/enums.go b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/enums.go index c13c9770b543..7a8fd515e9e0 100644 --- a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/enums.go +++ b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/enums.go @@ -193,6 +193,21 @@ func PossiblePrivateEndpointServiceConnectionStatusValues() []PrivateEndpointSer return []PrivateEndpointServiceConnectionStatus{PrivateEndpointServiceConnectionStatusApproved, PrivateEndpointServiceConnectionStatusPending, PrivateEndpointServiceConnectionStatusRejected} } +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled ... + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled ... + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} +} + // RegenerateKeysChannelName enumerates the values for regenerate keys channel name. type RegenerateKeysChannelName string diff --git a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/models.go b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/models.go index 717f2469f81b..07e64f91bab8 100644 --- a/services/preview/botservice/mgmt/2021-05-01-preview/botservice/models.go +++ b/services/preview/botservice/mgmt/2021-05-01-preview/botservice/models.go @@ -24,6 +24,12 @@ const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt type AlexaChannel struct { // Properties - The set of properties specific to Alexa channel resource Properties *AlexaChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -35,6 +41,12 @@ func (ac AlexaChannel) MarshalJSON() ([]byte, error) { if ac.Properties != nil { objectMap["properties"] = ac.Properties } + if ac.Etag != nil { + objectMap["etag"] = ac.Etag + } + if ac.Location != nil { + objectMap["location"] = ac.Location + } if ac.ChannelName != "" { objectMap["channelName"] = ac.ChannelName } @@ -161,6 +173,8 @@ type Bot struct { Kind Kind `json:"kind,omitempty"` // Etag - Entity Tag Etag *string `json:"etag,omitempty"` + // Zones - READ-ONLY; Entity zones + Zones *[]string `json:"zones,omitempty"` } // MarshalJSON is the custom marshaler for Bot. @@ -208,6 +222,8 @@ type BotChannel struct { Kind Kind `json:"kind,omitempty"` // Etag - Entity Tag Etag *string `json:"etag,omitempty"` + // Zones - READ-ONLY; Entity zones + Zones *[]string `json:"zones,omitempty"` } // MarshalJSON is the custom marshaler for BotChannel. @@ -321,6 +337,15 @@ func (bc *BotChannel) UnmarshalJSON(body []byte) error { } bc.Etag = &etag } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + bc.Zones = &zones + } } } @@ -339,6 +364,12 @@ type BotProperties struct { Endpoint *string `json:"endpoint,omitempty"` // EndpointVersion - READ-ONLY; The bot's endpoint version EndpointVersion *string `json:"endpointVersion,omitempty"` + // AllSettings - Contains resource all settings defined as key/value pairs. + AllSettings map[string]*string `json:"allSettings"` + // Parameters - Contains resource parameters defined as key/value pairs. + Parameters map[string]*string `json:"parameters"` + // ManifestURL - The bot's manifest url + ManifestURL *string `json:"manifestUrl,omitempty"` // MsaAppType - Microsoft App Type for the bot. Possible values include: 'MsaAppTypeUserAssignedMSI', 'MsaAppTypeSingleTenant', 'MsaAppTypeMultiTenant' MsaAppType MsaAppType `json:"msaAppType,omitempty"` // MsaAppID - Microsoft App Id for the bot @@ -365,18 +396,32 @@ type BotProperties struct { IsCmekEnabled *bool `json:"isCmekEnabled,omitempty"` // CmekKeyVaultURL - The CMK Url CmekKeyVaultURL *string `json:"cmekKeyVaultUrl,omitempty"` - // IsIsolated - Whether the bot is in an isolated network - IsIsolated *bool `json:"isIsolated,omitempty"` + // CmekEncryptionStatus - The CMK encryption status + CmekEncryptionStatus *string `json:"cmekEncryptionStatus,omitempty"` + // PublicNetworkAccess - Whether the bot is in an isolated network. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // IsStreamingSupported - Whether the bot is streaming supported + IsStreamingSupported *bool `json:"isStreamingSupported,omitempty"` + // IsDeveloperAppInsightsAPIKeySet - Whether the bot is developerAppInsightsApiKey set + IsDeveloperAppInsightsAPIKeySet *bool `json:"isDeveloperAppInsightsApiKeySet,omitempty"` + // MigrationToken - READ-ONLY; Token used to migrate non Azure bot to azure subscription + MigrationToken *string `json:"migrationToken,omitempty"` // DisableLocalAuth - Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` // SchemaTransformationVersion - The channel schema transformation version for the bot SchemaTransformationVersion *string `json:"schemaTransformationVersion,omitempty"` + // StorageResourceID - The storage resourceId for the bot + StorageResourceID *string `json:"storageResourceId,omitempty"` // PrivateEndpointConnections - READ-ONLY; List of Private Endpoint Connections configured for the bot PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` // OpenWithHint - The hint to browser (e.g. protocol handler) on how to open the bot for authoring OpenWithHint *string `json:"openWithHint,omitempty"` // AppPasswordHint - The hint (e.g. keyVault secret resourceId) on how to fetch the app secret AppPasswordHint *string `json:"appPasswordHint,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // PublishingCredentials - Publishing credentials of the resource + PublishingCredentials *string `json:"publishingCredentials,omitempty"` } // MarshalJSON is the custom marshaler for BotProperties. @@ -394,6 +439,15 @@ func (bp BotProperties) MarshalJSON() ([]byte, error) { if bp.Endpoint != nil { objectMap["endpoint"] = bp.Endpoint } + if bp.AllSettings != nil { + objectMap["allSettings"] = bp.AllSettings + } + if bp.Parameters != nil { + objectMap["parameters"] = bp.Parameters + } + if bp.ManifestURL != nil { + objectMap["manifestUrl"] = bp.ManifestURL + } if bp.MsaAppType != "" { objectMap["msaAppType"] = bp.MsaAppType } @@ -427,8 +481,17 @@ func (bp BotProperties) MarshalJSON() ([]byte, error) { if bp.CmekKeyVaultURL != nil { objectMap["cmekKeyVaultUrl"] = bp.CmekKeyVaultURL } - if bp.IsIsolated != nil { - objectMap["isIsolated"] = bp.IsIsolated + if bp.CmekEncryptionStatus != nil { + objectMap["cmekEncryptionStatus"] = bp.CmekEncryptionStatus + } + if bp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = bp.PublicNetworkAccess + } + if bp.IsStreamingSupported != nil { + objectMap["isStreamingSupported"] = bp.IsStreamingSupported + } + if bp.IsDeveloperAppInsightsAPIKeySet != nil { + objectMap["isDeveloperAppInsightsApiKeySet"] = bp.IsDeveloperAppInsightsAPIKeySet } if bp.DisableLocalAuth != nil { objectMap["disableLocalAuth"] = bp.DisableLocalAuth @@ -436,12 +499,18 @@ func (bp BotProperties) MarshalJSON() ([]byte, error) { if bp.SchemaTransformationVersion != nil { objectMap["schemaTransformationVersion"] = bp.SchemaTransformationVersion } + if bp.StorageResourceID != nil { + objectMap["storageResourceId"] = bp.StorageResourceID + } if bp.OpenWithHint != nil { objectMap["openWithHint"] = bp.OpenWithHint } if bp.AppPasswordHint != nil { objectMap["appPasswordHint"] = bp.AppPasswordHint } + if bp.PublishingCredentials != nil { + objectMap["publishingCredentials"] = bp.PublishingCredentials + } return json.Marshal(objectMap) } @@ -633,6 +702,12 @@ type BasicChannel interface { // Channel channel definition type Channel struct { + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -726,6 +801,12 @@ func unmarshalBasicChannelArray(body []byte) ([]BasicChannel, error) { func (c Channel) MarshalJSON() ([]byte, error) { c.ChannelName = ChannelNameBasicChannelChannelNameChannel objectMap := make(map[string]interface{}) + if c.Etag != nil { + objectMap["etag"] = c.Etag + } + if c.Location != nil { + objectMap["location"] = c.Location + } if c.ChannelName != "" { objectMap["channelName"] = c.ChannelName } @@ -975,6 +1056,28 @@ func NewChannelResponseListPage(cur ChannelResponseList, getNextPage func(contex } } +// ChannelSettings channel settings definition +type ChannelSettings struct { + // ExtensionKey1 - The extensionKey1 + ExtensionKey1 *string `json:"extensionKey1,omitempty"` + // ExtensionKey2 - The extensionKey2 + ExtensionKey2 *string `json:"extensionKey2,omitempty"` + // Sites - The list of sites + Sites *[]Site `json:"sites,omitempty"` + // ChannelID - The channel id + ChannelID *string `json:"channelId,omitempty"` + // ChannelDisplayName - The channel display name + ChannelDisplayName *string `json:"channelDisplayName,omitempty"` + // BotID - The bot id + BotID *string `json:"botId,omitempty"` + // BotIconURL - The bot icon url + BotIconURL *string `json:"botIconUrl,omitempty"` + // IsEnabled - Whether this channel is enabled for the bot + IsEnabled *bool `json:"isEnabled,omitempty"` + // DisableLocalAuth - Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` +} + // CheckNameAvailabilityRequestBody the request body for a request to Bot Service Management to check // availability of a bot name. type CheckNameAvailabilityRequestBody struct { @@ -1027,6 +1130,8 @@ type ConnectionSetting struct { Kind Kind `json:"kind,omitempty"` // Etag - Entity Tag Etag *string `json:"etag,omitempty"` + // Zones - READ-ONLY; Entity zones + Zones *[]string `json:"zones,omitempty"` } // MarshalJSON is the custom marshaler for ConnectionSetting. @@ -1064,6 +1169,10 @@ type ConnectionSettingParameter struct { // ConnectionSettingProperties properties for a Connection Setting Item type ConnectionSettingProperties struct { + // ID - Id associated with the Connection Setting. + ID *string `json:"id,omitempty"` + // Name - Name associated with the Connection Setting. + Name *string `json:"name,omitempty"` // ClientID - Client Id associated with the Connection Setting. ClientID *string `json:"clientId,omitempty"` // SettingID - READ-ONLY; Setting Id set by the service for the Connection Setting. @@ -1078,11 +1187,19 @@ type ConnectionSettingProperties struct { ServiceProviderDisplayName *string `json:"serviceProviderDisplayName,omitempty"` // Parameters - Service Provider Parameters associated with the Connection Setting Parameters *[]ConnectionSettingParameter `json:"parameters,omitempty"` + // ProvisioningState - Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` } // MarshalJSON is the custom marshaler for ConnectionSettingProperties. func (csp ConnectionSettingProperties) MarshalJSON() ([]byte, error) { objectMap := make(map[string]interface{}) + if csp.ID != nil { + objectMap["id"] = csp.ID + } + if csp.Name != nil { + objectMap["name"] = csp.Name + } if csp.ClientID != nil { objectMap["clientId"] = csp.ClientID } @@ -1101,6 +1218,9 @@ func (csp ConnectionSettingProperties) MarshalJSON() ([]byte, error) { if csp.Parameters != nil { objectMap["parameters"] = csp.Parameters } + if csp.ProvisioningState != nil { + objectMap["provisioningState"] = csp.ProvisioningState + } return json.Marshal(objectMap) } @@ -1276,6 +1396,12 @@ func NewConnectionSettingResponseListPage(cur ConnectionSettingResponseList, get type DirectLineChannel struct { // Properties - The set of properties specific to Direct Line channel resource Properties *DirectLineChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -1287,6 +1413,12 @@ func (dlc DirectLineChannel) MarshalJSON() ([]byte, error) { if dlc.Properties != nil { objectMap["properties"] = dlc.Properties } + if dlc.Etag != nil { + objectMap["etag"] = dlc.Etag + } + if dlc.Location != nil { + objectMap["location"] = dlc.Location + } if dlc.ChannelName != "" { objectMap["channelName"] = dlc.ChannelName } @@ -1372,6 +1504,8 @@ func (dlc DirectLineChannel) AsBasicChannel() (BasicChannel, bool) { type DirectLineChannelProperties struct { // Sites - The list of Direct Line sites Sites *[]DirectLineSite `json:"sites,omitempty"` + // DirectLineEmbedCode - Direct Line embed code of the resource + DirectLineEmbedCode *string `json:"DirectLineEmbedCode,omitempty"` } // DirectLineSite a site for the Direct Line channel @@ -1392,6 +1526,8 @@ type DirectLineSite struct { IsV3Enabled *bool `json:"isV3Enabled,omitempty"` // IsSecureSiteEnabled - Whether this site is enabled for authentication with Bot Framework. IsSecureSiteEnabled *bool `json:"isSecureSiteEnabled,omitempty"` + // IsBlockUserUploadEnabled - Whether this site is enabled for block user upload. + IsBlockUserUploadEnabled *bool `json:"isBlockUserUploadEnabled,omitempty"` // TrustedOrigins - List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. TrustedOrigins *[]string `json:"trustedOrigins,omitempty"` } @@ -1414,6 +1550,9 @@ func (dls DirectLineSite) MarshalJSON() ([]byte, error) { if dls.IsSecureSiteEnabled != nil { objectMap["isSecureSiteEnabled"] = dls.IsSecureSiteEnabled } + if dls.IsBlockUserUploadEnabled != nil { + objectMap["isBlockUserUploadEnabled"] = dls.IsBlockUserUploadEnabled + } if dls.TrustedOrigins != nil { objectMap["trustedOrigins"] = dls.TrustedOrigins } @@ -1424,6 +1563,12 @@ func (dls DirectLineSite) MarshalJSON() ([]byte, error) { type DirectLineSpeechChannel struct { // Properties - The set of properties specific to DirectLine Speech channel resource Properties *DirectLineSpeechChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -1435,6 +1580,12 @@ func (dlsc DirectLineSpeechChannel) MarshalJSON() ([]byte, error) { if dlsc.Properties != nil { objectMap["properties"] = dlsc.Properties } + if dlsc.Etag != nil { + objectMap["etag"] = dlsc.Etag + } + if dlsc.Location != nil { + objectMap["location"] = dlsc.Location + } if dlsc.ChannelName != "" { objectMap["channelName"] = dlsc.ChannelName } @@ -1536,6 +1687,12 @@ type DirectLineSpeechChannelProperties struct { type EmailChannel struct { // Properties - The set of properties specific to email channel resource Properties *EmailChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -1547,6 +1704,12 @@ func (ec EmailChannel) MarshalJSON() ([]byte, error) { if ec.Properties != nil { objectMap["properties"] = ec.Properties } + if ec.Etag != nil { + objectMap["etag"] = ec.Etag + } + if ec.Location != nil { + objectMap["location"] = ec.Location + } if ec.ChannelName != "" { objectMap["channelName"] = ec.ChannelName } @@ -1656,6 +1819,12 @@ type ErrorBody struct { type FacebookChannel struct { // Properties - The set of properties specific to bot facebook channel Properties *FacebookChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -1667,6 +1836,12 @@ func (fc FacebookChannel) MarshalJSON() ([]byte, error) { if fc.Properties != nil { objectMap["properties"] = fc.Properties } + if fc.Etag != nil { + objectMap["etag"] = fc.Etag + } + if fc.Location != nil { + objectMap["location"] = fc.Location + } if fc.ChannelName != "" { objectMap["channelName"] = fc.ChannelName } @@ -1816,6 +1991,12 @@ type HostSettingsResponse struct { type KikChannel struct { // Properties - The set of properties specific to Kik channel resource Properties *KikChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -1827,6 +2008,12 @@ func (kc KikChannel) MarshalJSON() ([]byte, error) { if kc.Properties != nil { objectMap["properties"] = kc.Properties } + if kc.Etag != nil { + objectMap["etag"] = kc.Etag + } + if kc.Location != nil { + objectMap["location"] = kc.Location + } if kc.ChannelName != "" { objectMap["channelName"] = kc.ChannelName } @@ -1924,6 +2111,12 @@ type KikChannelProperties struct { type LineChannel struct { // Properties - The set of properties specific to line channel resource Properties *LineChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -1935,6 +2128,12 @@ func (lc LineChannel) MarshalJSON() ([]byte, error) { if lc.Properties != nil { objectMap["properties"] = lc.Properties } + if lc.Etag != nil { + objectMap["etag"] = lc.Etag + } + if lc.Location != nil { + objectMap["location"] = lc.Location + } if lc.ChannelName != "" { objectMap["channelName"] = lc.ChannelName } @@ -2057,10 +2256,192 @@ func (lr LineRegistration) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ListChannelWithKeysResponse the ARM channel of list channel with keys operation response. +type ListChannelWithKeysResponse struct { + autorest.Response `json:"-"` + // Resource - The set of properties specific to bot channel resource + Resource BasicChannel `json:"resource,omitempty"` + // Setting - Channel settings + Setting *ChannelSettings `json:"setting,omitempty"` + // Properties - The set of properties specific to bot channel resource + Properties BasicChannel `json:"properties,omitempty"` + // ID - READ-ONLY; Specifies the resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; Specifies the name of the resource. + Name *string `json:"name,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` + // Type - READ-ONLY; Specifies the type of the resource. + Type *string `json:"type,omitempty"` + // Tags - Contains resource tags defined as key/value pairs. + Tags map[string]*string `json:"tags"` + // Sku - Gets or sets the SKU of the resource. + Sku *Sku `json:"sku,omitempty"` + // Kind - Required. Gets or sets the Kind of the resource. Possible values include: 'KindSdk', 'KindDesigner', 'KindBot', 'KindFunction', 'KindAzurebot' + Kind Kind `json:"kind,omitempty"` + // Etag - Entity Tag + Etag *string `json:"etag,omitempty"` + // Zones - READ-ONLY; Entity zones + Zones *[]string `json:"zones,omitempty"` +} + +// MarshalJSON is the custom marshaler for ListChannelWithKeysResponse. +func (lcwkr ListChannelWithKeysResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["resource"] = lcwkr.Resource + if lcwkr.Setting != nil { + objectMap["setting"] = lcwkr.Setting + } + objectMap["properties"] = lcwkr.Properties + if lcwkr.Location != nil { + objectMap["location"] = lcwkr.Location + } + if lcwkr.Tags != nil { + objectMap["tags"] = lcwkr.Tags + } + if lcwkr.Sku != nil { + objectMap["sku"] = lcwkr.Sku + } + if lcwkr.Kind != "" { + objectMap["kind"] = lcwkr.Kind + } + if lcwkr.Etag != nil { + objectMap["etag"] = lcwkr.Etag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ListChannelWithKeysResponse struct. +func (lcwkr *ListChannelWithKeysResponse) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "resource": + if v != nil { + resource, err := unmarshalBasicChannel(*v) + if err != nil { + return err + } + lcwkr.Resource = resource + } + case "setting": + if v != nil { + var setting ChannelSettings + err = json.Unmarshal(*v, &setting) + if err != nil { + return err + } + lcwkr.Setting = &setting + } + case "properties": + if v != nil { + properties, err := unmarshalBasicChannel(*v) + if err != nil { + return err + } + lcwkr.Properties = properties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lcwkr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lcwkr.Name = &name + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + lcwkr.Location = &location + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lcwkr.Type = &typeVar + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lcwkr.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + lcwkr.Sku = &sku + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + lcwkr.Kind = kind + } + case "etag": + if v != nil { + var etag string + err = json.Unmarshal(*v, &etag) + if err != nil { + return err + } + lcwkr.Etag = &etag + } + case "zones": + if v != nil { + var zones []string + err = json.Unmarshal(*v, &zones) + if err != nil { + return err + } + lcwkr.Zones = &zones + } + } + } + + return nil +} + // MsTeamsChannel microsoft Teams channel definition type MsTeamsChannel struct { // Properties - The set of properties specific to Microsoft Teams channel resource Properties *MsTeamsChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -2072,6 +2453,12 @@ func (mtc MsTeamsChannel) MarshalJSON() ([]byte, error) { if mtc.Properties != nil { objectMap["properties"] = mtc.Properties } + if mtc.Etag != nil { + objectMap["etag"] = mtc.Etag + } + if mtc.Location != nil { + objectMap["location"] = mtc.Location + } if mtc.ChannelName != "" { objectMap["channelName"] = mtc.ChannelName } @@ -2161,6 +2548,12 @@ type MsTeamsChannelProperties struct { CallingWebHook *string `json:"callingWebHook,omitempty"` // IsEnabled - Whether this channel is enabled for the bot IsEnabled *bool `json:"isEnabled,omitempty"` + // IncomingCallRoute - Webhook for Microsoft Teams channel calls + IncomingCallRoute *string `json:"incomingCallRoute,omitempty"` + // DeploymentEnvironment - Deployment environment for Microsoft Teams channel calls + DeploymentEnvironment *string `json:"deploymentEnvironment,omitempty"` + // AcceptedTerms - Whether this channel accepted terms + AcceptedTerms *bool `json:"acceptedTerms,omitempty"` } // OperationDisplayInfo the operation supported by Bot Service Management. @@ -2655,6 +3048,8 @@ type Resource struct { Kind Kind `json:"kind,omitempty"` // Etag - Entity Tag Etag *string `json:"etag,omitempty"` + // Zones - READ-ONLY; Entity zones + Zones *[]string `json:"zones,omitempty"` } // MarshalJSON is the custom marshaler for Resource. @@ -2698,6 +3093,8 @@ type ServiceProviderParameter struct { HelpURL *string `json:"helpUrl,omitempty"` // Default - READ-ONLY; Default Name for the Service Provider Default *string `json:"default,omitempty"` + // Metadata - READ-ONLY; Meta data for the Service Provider + Metadata *ServiceProviderParameterMetadata `json:"metadata,omitempty"` } // MarshalJSON is the custom marshaler for ServiceProviderParameter. @@ -2706,6 +3103,18 @@ func (spp ServiceProviderParameter) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ServiceProviderParameterMetadata meta data for the Service Provider +type ServiceProviderParameterMetadata struct { + // Constraints - the constraints of the bot meta data. + Constraints *ServiceProviderParameterMetadataConstraints `json:"constraints,omitempty"` +} + +// ServiceProviderParameterMetadataConstraints the constraints of the bot meta data. +type ServiceProviderParameterMetadataConstraints struct { + // Required - Whether required the constraints of the bot meta data. + Required *bool `json:"required,omitempty"` +} + // ServiceProviderProperties the Object used to describe a Service Provider supported by Bot Service type ServiceProviderProperties struct { // ID - READ-ONLY; Id for Service Provider @@ -2749,6 +3158,72 @@ func (sprl ServiceProviderResponseList) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// Site a site for the channel +type Site struct { + // SiteID - READ-ONLY; Site Id + SiteID *string `json:"siteId,omitempty"` + // SiteName - Site name + SiteName *string `json:"siteName,omitempty"` + // Key - READ-ONLY; Primary key. Value only returned through POST to the action Channel List API, otherwise empty. + Key *string `json:"key,omitempty"` + // Key2 - READ-ONLY; Secondary key. Value only returned through POST to the action Channel List API, otherwise empty. + Key2 *string `json:"key2,omitempty"` + // IsEnabled - Whether this site is enabled for DirectLine channel + IsEnabled *bool `json:"isEnabled,omitempty"` + // IsWebchatPreviewEnabled - Whether this site is enabled for preview versions of Webchat + IsWebchatPreviewEnabled *bool `json:"isWebchatPreviewEnabled,omitempty"` + // IsV1Enabled - Whether this site is enabled for Bot Framework V1 protocol. + IsV1Enabled *bool `json:"isV1Enabled,omitempty"` + // IsV3Enabled - Whether this site is enabled for Bot Framework V1 protocol. + IsV3Enabled *bool `json:"isV3Enabled,omitempty"` + // IsSecureSiteEnabled - Whether this site is enabled for authentication with Bot Framework. + IsSecureSiteEnabled *bool `json:"isSecureSiteEnabled,omitempty"` + // IsBlockUserUploadEnabled - Whether this site is enabled for block user upload. + IsBlockUserUploadEnabled *bool `json:"isBlockUserUploadEnabled,omitempty"` + // TrustedOrigins - List of Trusted Origin URLs for this site. This field is applicable only if isSecureSiteEnabled is True. + TrustedOrigins *[]string `json:"trustedOrigins,omitempty"` + // IsTokenEnabled - Whether this site is token enabled for channel + IsTokenEnabled *bool `json:"isTokenEnabled,omitempty"` + // ETag - Entity Tag + ETag *string `json:"eTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for Site. +func (s Site) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.SiteName != nil { + objectMap["siteName"] = s.SiteName + } + if s.IsEnabled != nil { + objectMap["isEnabled"] = s.IsEnabled + } + if s.IsWebchatPreviewEnabled != nil { + objectMap["isWebchatPreviewEnabled"] = s.IsWebchatPreviewEnabled + } + if s.IsV1Enabled != nil { + objectMap["isV1Enabled"] = s.IsV1Enabled + } + if s.IsV3Enabled != nil { + objectMap["isV3Enabled"] = s.IsV3Enabled + } + if s.IsSecureSiteEnabled != nil { + objectMap["isSecureSiteEnabled"] = s.IsSecureSiteEnabled + } + if s.IsBlockUserUploadEnabled != nil { + objectMap["isBlockUserUploadEnabled"] = s.IsBlockUserUploadEnabled + } + if s.TrustedOrigins != nil { + objectMap["trustedOrigins"] = s.TrustedOrigins + } + if s.IsTokenEnabled != nil { + objectMap["isTokenEnabled"] = s.IsTokenEnabled + } + if s.ETag != nil { + objectMap["eTag"] = s.ETag + } + return json.Marshal(objectMap) +} + // SiteInfo site information for WebChat or DirectLine Channels to identify which site to regenerate keys // for. type SiteInfo struct { @@ -2779,6 +3254,12 @@ func (s Sku) MarshalJSON() ([]byte, error) { type SkypeChannel struct { // Properties - The set of properties specific to Skype channel resource Properties *SkypeChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -2790,6 +3271,12 @@ func (sc SkypeChannel) MarshalJSON() ([]byte, error) { if sc.Properties != nil { objectMap["properties"] = sc.Properties } + if sc.Etag != nil { + objectMap["etag"] = sc.Etag + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } if sc.ChannelName != "" { objectMap["channelName"] = sc.ChannelName } @@ -2889,6 +3376,8 @@ type SkypeChannelProperties struct { GroupsMode *string `json:"groupsMode,omitempty"` // CallingWebHook - Calling web hook for Skype channel CallingWebHook *string `json:"callingWebHook,omitempty"` + // IncomingCallRoute - Incoming call route for Skype channel + IncomingCallRoute *string `json:"incomingCallRoute,omitempty"` // IsEnabled - Whether this channel is enabled for the bot IsEnabled *bool `json:"isEnabled,omitempty"` } @@ -2897,6 +3386,12 @@ type SkypeChannelProperties struct { type SlackChannel struct { // Properties - The set of properties specific to Slack channel resource Properties *SlackChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -2908,6 +3403,12 @@ func (sc SlackChannel) MarshalJSON() ([]byte, error) { if sc.Properties != nil { objectMap["properties"] = sc.Properties } + if sc.Etag != nil { + objectMap["etag"] = sc.Etag + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } if sc.ChannelName != "" { objectMap["channelName"] = sc.ChannelName } @@ -3008,7 +3509,7 @@ type SlackChannelProperties struct { // RegisterBeforeOAuthFlow - READ-ONLY; Whether to register the settings before OAuth validation is performed. Recommended to True. RegisterBeforeOAuthFlow *bool `json:"registerBeforeOAuthFlow,omitempty"` // IsValidated - READ-ONLY; Whether this channel is validated for the bot - IsValidated *bool `json:"isValidated,omitempty"` + IsValidated *bool `json:"IsValidated,omitempty"` // SigningSecret - The Slack signing secret. SigningSecret *string `json:"signingSecret,omitempty"` // IsEnabled - Whether this channel is enabled for the bot @@ -3046,6 +3547,12 @@ func (scp SlackChannelProperties) MarshalJSON() ([]byte, error) { type SmsChannel struct { // Properties - The set of properties specific to Sms channel resource Properties *SmsChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -3057,6 +3564,12 @@ func (sc SmsChannel) MarshalJSON() ([]byte, error) { if sc.Properties != nil { objectMap["properties"] = sc.Properties } + if sc.Etag != nil { + objectMap["etag"] = sc.Etag + } + if sc.Location != nil { + objectMap["location"] = sc.Location + } if sc.ChannelName != "" { objectMap["channelName"] = sc.ChannelName } @@ -3156,6 +3669,12 @@ type SmsChannelProperties struct { type TelegramChannel struct { // Properties - The set of properties specific to Telegram channel resource Properties *TelegramChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -3167,6 +3686,12 @@ func (tc TelegramChannel) MarshalJSON() ([]byte, error) { if tc.Properties != nil { objectMap["properties"] = tc.Properties } + if tc.Etag != nil { + objectMap["etag"] = tc.Etag + } + if tc.Location != nil { + objectMap["location"] = tc.Location + } if tc.ChannelName != "" { objectMap["channelName"] = tc.ChannelName } @@ -3262,6 +3787,12 @@ type TelegramChannelProperties struct { type WebChatChannel struct { // Properties - The set of properties specific to Web Chat channel resource Properties *WebChatChannelProperties `json:"properties,omitempty"` + // Etag - Entity Tag of the resource + Etag *string `json:"etag,omitempty"` + // ProvisioningState - READ-ONLY; Provisioning state of the resource + ProvisioningState *string `json:"provisioningState,omitempty"` + // Location - Specifies the location of the resource. + Location *string `json:"location,omitempty"` // ChannelName - Possible values include: 'ChannelNameBasicChannelChannelNameChannel', 'ChannelNameBasicChannelChannelNameAlexaChannel', 'ChannelNameBasicChannelChannelNameFacebookChannel', 'ChannelNameBasicChannelChannelNameEmailChannel', 'ChannelNameBasicChannelChannelNameMsTeamsChannel', 'ChannelNameBasicChannelChannelNameSkypeChannel', 'ChannelNameBasicChannelChannelNameKikChannel', 'ChannelNameBasicChannelChannelNameWebChatChannel', 'ChannelNameBasicChannelChannelNameDirectLineChannel', 'ChannelNameBasicChannelChannelNameTelegramChannel', 'ChannelNameBasicChannelChannelNameSmsChannel', 'ChannelNameBasicChannelChannelNameSlackChannel', 'ChannelNameBasicChannelChannelNameLineChannel', 'ChannelNameBasicChannelChannelNameDirectLineSpeechChannel' ChannelName ChannelNameBasicChannel `json:"channelName,omitempty"` } @@ -3273,6 +3804,12 @@ func (wcc WebChatChannel) MarshalJSON() ([]byte, error) { if wcc.Properties != nil { objectMap["properties"] = wcc.Properties } + if wcc.Etag != nil { + objectMap["etag"] = wcc.Etag + } + if wcc.Location != nil { + objectMap["location"] = wcc.Location + } if wcc.ChannelName != "" { objectMap["channelName"] = wcc.ChannelName } @@ -3383,8 +3920,8 @@ type WebChatSite struct { Key2 *string `json:"key2,omitempty"` // IsEnabled - Whether this site is enabled for DirectLine channel IsEnabled *bool `json:"isEnabled,omitempty"` - // EnablePreview - Whether this site is enabled for preview versions of Webchat - EnablePreview *bool `json:"enablePreview,omitempty"` + // IsWebchatPreviewEnabled - Whether this site is enabled for preview versions of Webchat + IsWebchatPreviewEnabled *bool `json:"isWebchatPreviewEnabled,omitempty"` } // MarshalJSON is the custom marshaler for WebChatSite. @@ -3396,8 +3933,8 @@ func (wcs WebChatSite) MarshalJSON() ([]byte, error) { if wcs.IsEnabled != nil { objectMap["isEnabled"] = wcs.IsEnabled } - if wcs.EnablePreview != nil { - objectMap["enablePreview"] = wcs.EnablePreview + if wcs.IsWebchatPreviewEnabled != nil { + objectMap["isWebchatPreviewEnabled"] = wcs.IsWebchatPreviewEnabled } return json.Marshal(objectMap) } From 72253a57d4d541f9445d45273b1adcbfcabea1cf Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:12:25 +0800 Subject: [PATCH 3/8] Generated from specification/containerregistry/resource-manager/readme.md tag package-2021-09 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- .../containerregistryapi/models.go | 8 +- .../mgmt/containerregistry/models.go | 307 +- .../2021-09-01/containerregistry/CHANGELOG.md | 2 + .../2021-09-01/containerregistry/_meta.json | 11 + .../containerregistry/agentpools.go | 634 ++ .../2021-09-01/containerregistry/client.go | 41 + .../containerregistryapi/interfaces.go | 134 + .../2021-09-01/containerregistry/enums.go | 679 ++ .../2021-09-01/containerregistry/models.go | 7237 +++++++++++++++++ .../containerregistry/operations.go | 140 + .../privateendpointconnections.go | 434 + .../containerregistry/registries.go | 1467 ++++ .../containerregistry/replications.go | 542 ++ .../mgmt/2021-09-01/containerregistry/runs.go | 529 ++ .../2021-09-01/containerregistry/taskruns.go | 634 ++ .../2021-09-01/containerregistry/tasks.go | 645 ++ .../2021-09-01/containerregistry/version.go | 19 + .../2021-09-01/containerregistry/webhooks.go | 866 ++ 18 files changed, 14018 insertions(+), 311 deletions(-) create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/CHANGELOG.md create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/_meta.json create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/agentpools.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/client.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/containerregistryapi/interfaces.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/enums.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/models.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/operations.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/privateendpointconnections.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/registries.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/replications.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/runs.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/taskruns.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/tasks.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/version.go create mode 100644 services/preview/containerregistry/mgmt/2021-09-01/containerregistry/webhooks.go diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go index 7f7045973e65..c77a7b87a848 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/containerregistryapi/models.go @@ -9,20 +9,14 @@ package containerregistryapi -import original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry/containerregistryapi" +import original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/containerregistryapi" type AgentPoolsClientAPI = original.AgentPoolsClientAPI -type ConnectedRegistriesClientAPI = original.ConnectedRegistriesClientAPI -type ExportPipelinesClientAPI = original.ExportPipelinesClientAPI -type ImportPipelinesClientAPI = original.ImportPipelinesClientAPI type OperationsClientAPI = original.OperationsClientAPI -type PipelineRunsClientAPI = original.PipelineRunsClientAPI type PrivateEndpointConnectionsClientAPI = original.PrivateEndpointConnectionsClientAPI type RegistriesClientAPI = original.RegistriesClientAPI type ReplicationsClientAPI = original.ReplicationsClientAPI type RunsClientAPI = original.RunsClientAPI -type ScopeMapsClientAPI = original.ScopeMapsClientAPI type TaskRunsClientAPI = original.TaskRunsClientAPI type TasksClientAPI = original.TasksClientAPI -type TokensClientAPI = original.TokensClientAPI type WebhooksClientAPI = original.WebhooksClientAPI diff --git a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go index f2c054705072..46f01103154c 100644 --- a/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go +++ b/profiles/preview/preview/containerregistry/mgmt/containerregistry/models.go @@ -12,7 +12,7 @@ package containerregistry import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-08-01-preview/containerregistry" + original "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-09-01/containerregistry" ) const ( @@ -32,13 +32,6 @@ const ( ActionsRequiredRecreate ActionsRequired = original.ActionsRequiredRecreate ) -type ActivationStatus = original.ActivationStatus - -const ( - ActivationStatusActive ActivationStatus = original.ActivationStatusActive - ActivationStatusInactive ActivationStatus = original.ActivationStatusInactive -) - type Architecture = original.Architecture const ( @@ -49,13 +42,6 @@ const ( ArchitectureX86 Architecture = original.ArchitectureX86 ) -type AuditLogStatus = original.AuditLogStatus - -const ( - AuditLogStatusDisabled AuditLogStatus = original.AuditLogStatusDisabled - AuditLogStatusEnabled AuditLogStatus = original.AuditLogStatusEnabled -) - type BaseImageDependencyType = original.BaseImageDependencyType const ( @@ -70,30 +56,6 @@ const ( BaseImageTriggerTypeRuntime BaseImageTriggerType = original.BaseImageTriggerTypeRuntime ) -type CertificateType = original.CertificateType - -const ( - CertificateTypeLocalDirectory CertificateType = original.CertificateTypeLocalDirectory -) - -type ConnectedRegistryMode = original.ConnectedRegistryMode - -const ( - ConnectedRegistryModeMirror ConnectedRegistryMode = original.ConnectedRegistryModeMirror - ConnectedRegistryModeReadOnly ConnectedRegistryMode = original.ConnectedRegistryModeReadOnly - ConnectedRegistryModeReadWrite ConnectedRegistryMode = original.ConnectedRegistryModeReadWrite - ConnectedRegistryModeRegistry ConnectedRegistryMode = original.ConnectedRegistryModeRegistry -) - -type ConnectionState = original.ConnectionState - -const ( - ConnectionStateOffline ConnectionState = original.ConnectionStateOffline - ConnectionStateOnline ConnectionState = original.ConnectionStateOnline - ConnectionStateSyncing ConnectionState = original.ConnectionStateSyncing - ConnectionStateUnhealthy ConnectionState = original.ConnectionStateUnhealthy -) - type ConnectionStatus = original.ConnectionStatus const ( @@ -149,16 +111,6 @@ const ( LastModifiedByTypeUser LastModifiedByType = original.LastModifiedByTypeUser ) -type LogLevel = original.LogLevel - -const ( - LogLevelDebug LogLevel = original.LogLevelDebug - LogLevelError LogLevel = original.LogLevelError - LogLevelInformation LogLevel = original.LogLevelInformation - LogLevelNone LogLevel = original.LogLevelNone - LogLevelWarning LogLevel = original.LogLevelWarning -) - type NetworkRuleBypassOptions = original.NetworkRuleBypassOptions const ( @@ -180,33 +132,6 @@ const ( PasswordNamePassword2 PasswordName = original.PasswordNamePassword2 ) -type PipelineOptions = original.PipelineOptions - -const ( - PipelineOptionsContinueOnErrors PipelineOptions = original.PipelineOptionsContinueOnErrors - PipelineOptionsDeleteSourceBlobOnSuccess PipelineOptions = original.PipelineOptionsDeleteSourceBlobOnSuccess - PipelineOptionsOverwriteBlobs PipelineOptions = original.PipelineOptionsOverwriteBlobs - PipelineOptionsOverwriteTags PipelineOptions = original.PipelineOptionsOverwriteTags -) - -type PipelineRunSourceType = original.PipelineRunSourceType - -const ( - PipelineRunSourceTypeAzureStorageBlob PipelineRunSourceType = original.PipelineRunSourceTypeAzureStorageBlob -) - -type PipelineRunTargetType = original.PipelineRunTargetType - -const ( - PipelineRunTargetTypeAzureStorageBlob PipelineRunTargetType = original.PipelineRunTargetTypeAzureStorageBlob -) - -type PipelineSourceType = original.PipelineSourceType - -const ( - PipelineSourceTypeAzureStorageBlobContainer PipelineSourceType = original.PipelineSourceTypeAzureStorageBlobContainer -) - type PolicyStatus = original.PolicyStatus const ( @@ -316,13 +241,6 @@ const ( SourceTriggerEventPullrequest SourceTriggerEvent = original.SourceTriggerEventPullrequest ) -type TLSStatus = original.TLSStatus - -const ( - TLSStatusDisabled TLSStatus = original.TLSStatusDisabled - TLSStatusEnabled TLSStatus = original.TLSStatusEnabled -) - type TaskStatus = original.TaskStatus const ( @@ -330,27 +248,6 @@ const ( TaskStatusEnabled TaskStatus = original.TaskStatusEnabled ) -type TokenCertificateName = original.TokenCertificateName - -const ( - TokenCertificateNameCertificate1 TokenCertificateName = original.TokenCertificateNameCertificate1 - TokenCertificateNameCertificate2 TokenCertificateName = original.TokenCertificateNameCertificate2 -) - -type TokenPasswordName = original.TokenPasswordName - -const ( - TokenPasswordNamePassword1 TokenPasswordName = original.TokenPasswordNamePassword1 - TokenPasswordNamePassword2 TokenPasswordName = original.TokenPasswordNamePassword2 -) - -type TokenStatus = original.TokenStatus - -const ( - TokenStatusDisabled TokenStatus = original.TokenStatusDisabled - TokenStatusEnabled TokenStatus = original.TokenStatusEnabled -) - type TokenType = original.TokenType const ( @@ -438,8 +335,6 @@ const ( ZoneRedundancyEnabled ZoneRedundancy = original.ZoneRedundancyEnabled ) -type ActivationProperties = original.ActivationProperties -type ActiveDirectoryObject = original.ActiveDirectoryObject type Actor = original.Actor type AgentPool = original.AgentPool type AgentPoolListResult = original.AgentPoolListResult @@ -465,18 +360,6 @@ type BasicRunRequest = original.BasicRunRequest type BasicTaskStepProperties = original.BasicTaskStepProperties type BasicTaskStepUpdateParameters = original.BasicTaskStepUpdateParameters type CallbackConfig = original.CallbackConfig -type ConnectedRegistriesClient = original.ConnectedRegistriesClient -type ConnectedRegistriesCreateFuture = original.ConnectedRegistriesCreateFuture -type ConnectedRegistriesDeactivateFuture = original.ConnectedRegistriesDeactivateFuture -type ConnectedRegistriesDeleteFuture = original.ConnectedRegistriesDeleteFuture -type ConnectedRegistriesUpdateFuture = original.ConnectedRegistriesUpdateFuture -type ConnectedRegistry = original.ConnectedRegistry -type ConnectedRegistryListResult = original.ConnectedRegistryListResult -type ConnectedRegistryListResultIterator = original.ConnectedRegistryListResultIterator -type ConnectedRegistryListResultPage = original.ConnectedRegistryListResultPage -type ConnectedRegistryProperties = original.ConnectedRegistryProperties -type ConnectedRegistryUpdateParameters = original.ConnectedRegistryUpdateParameters -type ConnectedRegistryUpdateProperties = original.ConnectedRegistryUpdateProperties type Credentials = original.Credentials type CustomRegistryCredentials = original.CustomRegistryCredentials type DockerBuildRequest = original.DockerBuildRequest @@ -496,41 +379,19 @@ type EventListResultIterator = original.EventListResultIterator type EventListResultPage = original.EventListResultPage type EventRequestMessage = original.EventRequestMessage type EventResponseMessage = original.EventResponseMessage -type ExportPipeline = original.ExportPipeline -type ExportPipelineListResult = original.ExportPipelineListResult -type ExportPipelineListResultIterator = original.ExportPipelineListResultIterator -type ExportPipelineListResultPage = original.ExportPipelineListResultPage -type ExportPipelineProperties = original.ExportPipelineProperties -type ExportPipelineTargetProperties = original.ExportPipelineTargetProperties -type ExportPipelinesClient = original.ExportPipelinesClient -type ExportPipelinesCreateFuture = original.ExportPipelinesCreateFuture -type ExportPipelinesDeleteFuture = original.ExportPipelinesDeleteFuture type ExportPolicy = original.ExportPolicy type FileTaskRunRequest = original.FileTaskRunRequest type FileTaskStep = original.FileTaskStep type FileTaskStepUpdateParameters = original.FileTaskStepUpdateParameters -type GenerateCredentialsParameters = original.GenerateCredentialsParameters -type GenerateCredentialsResult = original.GenerateCredentialsResult type IPRule = original.IPRule type IdentityProperties = original.IdentityProperties type ImageDescriptor = original.ImageDescriptor type ImageUpdateTrigger = original.ImageUpdateTrigger type ImportImageParameters = original.ImportImageParameters -type ImportPipeline = original.ImportPipeline -type ImportPipelineListResult = original.ImportPipelineListResult -type ImportPipelineListResultIterator = original.ImportPipelineListResultIterator -type ImportPipelineListResultPage = original.ImportPipelineListResultPage -type ImportPipelineProperties = original.ImportPipelineProperties -type ImportPipelineSourceProperties = original.ImportPipelineSourceProperties -type ImportPipelinesClient = original.ImportPipelinesClient -type ImportPipelinesCreateFuture = original.ImportPipelinesCreateFuture -type ImportPipelinesDeleteFuture = original.ImportPipelinesDeleteFuture type ImportSource = original.ImportSource type ImportSourceCredentials = original.ImportSourceCredentials type InnerErrorDescription = original.InnerErrorDescription type KeyVaultProperties = original.KeyVaultProperties -type LoggingProperties = original.LoggingProperties -type LoginServerProperties = original.LoginServerProperties type NetworkRuleSet = original.NetworkRuleSet type OperationDefinition = original.OperationDefinition type OperationDisplayDefinition = original.OperationDisplayDefinition @@ -543,23 +404,7 @@ type OperationPropertiesDefinition = original.OperationPropertiesDefinition type OperationServiceSpecificationDefinition = original.OperationServiceSpecificationDefinition type OperationsClient = original.OperationsClient type OverrideTaskStepProperties = original.OverrideTaskStepProperties -type ParentProperties = original.ParentProperties -type PipelineRun = original.PipelineRun -type PipelineRunListResult = original.PipelineRunListResult -type PipelineRunListResultIterator = original.PipelineRunListResultIterator -type PipelineRunListResultPage = original.PipelineRunListResultPage -type PipelineRunProperties = original.PipelineRunProperties -type PipelineRunRequest = original.PipelineRunRequest -type PipelineRunResponse = original.PipelineRunResponse -type PipelineRunSourceProperties = original.PipelineRunSourceProperties -type PipelineRunTargetProperties = original.PipelineRunTargetProperties -type PipelineRunsClient = original.PipelineRunsClient -type PipelineRunsCreateFuture = original.PipelineRunsCreateFuture -type PipelineRunsDeleteFuture = original.PipelineRunsDeleteFuture -type PipelineSourceTriggerDescriptor = original.PipelineSourceTriggerDescriptor -type PipelineSourceTriggerProperties = original.PipelineSourceTriggerProperties -type PipelineTriggerDescriptor = original.PipelineTriggerDescriptor -type PipelineTriggerProperties = original.PipelineTriggerProperties +type PackageType = original.PackageType type PlatformProperties = original.PlatformProperties type PlatformUpdateParameters = original.PlatformUpdateParameters type Policies = original.Policies @@ -578,14 +423,12 @@ type PrivateLinkResourceListResultIterator = original.PrivateLinkResourceListRes type PrivateLinkResourceListResultPage = original.PrivateLinkResourceListResultPage type PrivateLinkResourceProperties = original.PrivateLinkResourceProperties type PrivateLinkServiceConnectionState = original.PrivateLinkServiceConnectionState -type ProgressProperties = original.ProgressProperties type ProxyResource = original.ProxyResource type QuarantinePolicy = original.QuarantinePolicy type RegenerateCredentialParameters = original.RegenerateCredentialParameters type RegistriesClient = original.RegistriesClient type RegistriesCreateFuture = original.RegistriesCreateFuture type RegistriesDeleteFuture = original.RegistriesDeleteFuture -type RegistriesGenerateCredentialsFuture = original.RegistriesGenerateCredentialsFuture type RegistriesImportImageFuture = original.RegistriesImportImageFuture type RegistriesScheduleRunFuture = original.RegistriesScheduleRunFuture type RegistriesUpdateFuture = original.RegistriesUpdateFuture @@ -628,17 +471,6 @@ type RunUpdateParameters = original.RunUpdateParameters type RunsCancelFuture = original.RunsCancelFuture type RunsClient = original.RunsClient type RunsUpdateFuture = original.RunsUpdateFuture -type ScopeMap = original.ScopeMap -type ScopeMapListResult = original.ScopeMapListResult -type ScopeMapListResultIterator = original.ScopeMapListResultIterator -type ScopeMapListResultPage = original.ScopeMapListResultPage -type ScopeMapProperties = original.ScopeMapProperties -type ScopeMapPropertiesUpdateParameters = original.ScopeMapPropertiesUpdateParameters -type ScopeMapUpdateParameters = original.ScopeMapUpdateParameters -type ScopeMapsClient = original.ScopeMapsClient -type ScopeMapsCreateFuture = original.ScopeMapsCreateFuture -type ScopeMapsDeleteFuture = original.ScopeMapsDeleteFuture -type ScopeMapsUpdateFuture = original.ScopeMapsUpdateFuture type SecretObject = original.SecretObject type SetValue = original.SetValue type Sku = original.Sku @@ -651,12 +483,8 @@ type SourceTriggerUpdateParameters = original.SourceTriggerUpdateParameters type SourceUpdateParameters = original.SourceUpdateParameters type SourceUploadDefinition = original.SourceUploadDefinition type Status = original.Status -type StatusDetailProperties = original.StatusDetailProperties -type SyncProperties = original.SyncProperties -type SyncUpdateProperties = original.SyncUpdateProperties +type StorageAccountProperties = original.StorageAccountProperties type SystemData = original.SystemData -type TLSCertificateProperties = original.TLSCertificateProperties -type TLSProperties = original.TLSProperties type Target = original.Target type Task = original.Task type TaskListResult = original.TaskListResult @@ -686,25 +514,10 @@ type TasksUpdateFuture = original.TasksUpdateFuture type TimerTrigger = original.TimerTrigger type TimerTriggerDescriptor = original.TimerTriggerDescriptor type TimerTriggerUpdateParameters = original.TimerTriggerUpdateParameters -type Token = original.Token -type TokenCertificate = original.TokenCertificate -type TokenCredentialsProperties = original.TokenCredentialsProperties -type TokenListResult = original.TokenListResult -type TokenListResultIterator = original.TokenListResultIterator -type TokenListResultPage = original.TokenListResultPage -type TokenPassword = original.TokenPassword -type TokenProperties = original.TokenProperties -type TokenUpdateParameters = original.TokenUpdateParameters -type TokenUpdateProperties = original.TokenUpdateProperties -type TokensClient = original.TokensClient -type TokensCreateFuture = original.TokensCreateFuture -type TokensDeleteFuture = original.TokensDeleteFuture -type TokensUpdateFuture = original.TokensUpdateFuture type TriggerProperties = original.TriggerProperties type TriggerUpdateParameters = original.TriggerUpdateParameters type TrustPolicy = original.TrustPolicy type UserIdentityProperties = original.UserIdentityProperties -type VirtualNetworkRule = original.VirtualNetworkRule type Webhook = original.Webhook type WebhookCreateParameters = original.WebhookCreateParameters type WebhookListResult = original.WebhookListResult @@ -734,48 +547,12 @@ func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient { func NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient { return original.NewAgentPoolsClientWithBaseURI(baseURI, subscriptionID) } -func NewConnectedRegistriesClient(subscriptionID string) ConnectedRegistriesClient { - return original.NewConnectedRegistriesClient(subscriptionID) -} -func NewConnectedRegistriesClientWithBaseURI(baseURI string, subscriptionID string) ConnectedRegistriesClient { - return original.NewConnectedRegistriesClientWithBaseURI(baseURI, subscriptionID) -} -func NewConnectedRegistryListResultIterator(page ConnectedRegistryListResultPage) ConnectedRegistryListResultIterator { - return original.NewConnectedRegistryListResultIterator(page) -} -func NewConnectedRegistryListResultPage(cur ConnectedRegistryListResult, getNextPage func(context.Context, ConnectedRegistryListResult) (ConnectedRegistryListResult, error)) ConnectedRegistryListResultPage { - return original.NewConnectedRegistryListResultPage(cur, getNextPage) -} func NewEventListResultIterator(page EventListResultPage) EventListResultIterator { return original.NewEventListResultIterator(page) } func NewEventListResultPage(cur EventListResult, getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage { return original.NewEventListResultPage(cur, getNextPage) } -func NewExportPipelineListResultIterator(page ExportPipelineListResultPage) ExportPipelineListResultIterator { - return original.NewExportPipelineListResultIterator(page) -} -func NewExportPipelineListResultPage(cur ExportPipelineListResult, getNextPage func(context.Context, ExportPipelineListResult) (ExportPipelineListResult, error)) ExportPipelineListResultPage { - return original.NewExportPipelineListResultPage(cur, getNextPage) -} -func NewExportPipelinesClient(subscriptionID string) ExportPipelinesClient { - return original.NewExportPipelinesClient(subscriptionID) -} -func NewExportPipelinesClientWithBaseURI(baseURI string, subscriptionID string) ExportPipelinesClient { - return original.NewExportPipelinesClientWithBaseURI(baseURI, subscriptionID) -} -func NewImportPipelineListResultIterator(page ImportPipelineListResultPage) ImportPipelineListResultIterator { - return original.NewImportPipelineListResultIterator(page) -} -func NewImportPipelineListResultPage(cur ImportPipelineListResult, getNextPage func(context.Context, ImportPipelineListResult) (ImportPipelineListResult, error)) ImportPipelineListResultPage { - return original.NewImportPipelineListResultPage(cur, getNextPage) -} -func NewImportPipelinesClient(subscriptionID string) ImportPipelinesClient { - return original.NewImportPipelinesClient(subscriptionID) -} -func NewImportPipelinesClientWithBaseURI(baseURI string, subscriptionID string) ImportPipelinesClient { - return original.NewImportPipelinesClientWithBaseURI(baseURI, subscriptionID) -} func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { return original.NewOperationListResultIterator(page) } @@ -788,18 +565,6 @@ func NewOperationsClient(subscriptionID string) OperationsClient { func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) } -func NewPipelineRunListResultIterator(page PipelineRunListResultPage) PipelineRunListResultIterator { - return original.NewPipelineRunListResultIterator(page) -} -func NewPipelineRunListResultPage(cur PipelineRunListResult, getNextPage func(context.Context, PipelineRunListResult) (PipelineRunListResult, error)) PipelineRunListResultPage { - return original.NewPipelineRunListResultPage(cur, getNextPage) -} -func NewPipelineRunsClient(subscriptionID string) PipelineRunsClient { - return original.NewPipelineRunsClient(subscriptionID) -} -func NewPipelineRunsClientWithBaseURI(baseURI string, subscriptionID string) PipelineRunsClient { - return original.NewPipelineRunsClientWithBaseURI(baseURI, subscriptionID) -} func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { return original.NewPrivateEndpointConnectionListResultIterator(page) } @@ -854,18 +619,6 @@ func NewRunsClient(subscriptionID string) RunsClient { func NewRunsClientWithBaseURI(baseURI string, subscriptionID string) RunsClient { return original.NewRunsClientWithBaseURI(baseURI, subscriptionID) } -func NewScopeMapListResultIterator(page ScopeMapListResultPage) ScopeMapListResultIterator { - return original.NewScopeMapListResultIterator(page) -} -func NewScopeMapListResultPage(cur ScopeMapListResult, getNextPage func(context.Context, ScopeMapListResult) (ScopeMapListResult, error)) ScopeMapListResultPage { - return original.NewScopeMapListResultPage(cur, getNextPage) -} -func NewScopeMapsClient(subscriptionID string) ScopeMapsClient { - return original.NewScopeMapsClient(subscriptionID) -} -func NewScopeMapsClientWithBaseURI(baseURI string, subscriptionID string) ScopeMapsClient { - return original.NewScopeMapsClientWithBaseURI(baseURI, subscriptionID) -} func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator { return original.NewTaskListResultIterator(page) } @@ -890,18 +643,6 @@ func NewTasksClient(subscriptionID string) TasksClient { func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { return original.NewTasksClientWithBaseURI(baseURI, subscriptionID) } -func NewTokenListResultIterator(page TokenListResultPage) TokenListResultIterator { - return original.NewTokenListResultIterator(page) -} -func NewTokenListResultPage(cur TokenListResult, getNextPage func(context.Context, TokenListResult) (TokenListResult, error)) TokenListResultPage { - return original.NewTokenListResultPage(cur, getNextPage) -} -func NewTokensClient(subscriptionID string) TokensClient { - return original.NewTokensClient(subscriptionID) -} -func NewTokensClientWithBaseURI(baseURI string, subscriptionID string) TokensClient { - return original.NewTokensClientWithBaseURI(baseURI, subscriptionID) -} func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { return original.NewWebhookListResultIterator(page) } @@ -923,30 +664,15 @@ func PossibleActionValues() []Action { func PossibleActionsRequiredValues() []ActionsRequired { return original.PossibleActionsRequiredValues() } -func PossibleActivationStatusValues() []ActivationStatus { - return original.PossibleActivationStatusValues() -} func PossibleArchitectureValues() []Architecture { return original.PossibleArchitectureValues() } -func PossibleAuditLogStatusValues() []AuditLogStatus { - return original.PossibleAuditLogStatusValues() -} func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { return original.PossibleBaseImageDependencyTypeValues() } func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { return original.PossibleBaseImageTriggerTypeValues() } -func PossibleCertificateTypeValues() []CertificateType { - return original.PossibleCertificateTypeValues() -} -func PossibleConnectedRegistryModeValues() []ConnectedRegistryMode { - return original.PossibleConnectedRegistryModeValues() -} -func PossibleConnectionStateValues() []ConnectionState { - return original.PossibleConnectionStateValues() -} func PossibleConnectionStatusValues() []ConnectionStatus { return original.PossibleConnectionStatusValues() } @@ -968,9 +694,6 @@ func PossibleImportModeValues() []ImportMode { func PossibleLastModifiedByTypeValues() []LastModifiedByType { return original.PossibleLastModifiedByTypeValues() } -func PossibleLogLevelValues() []LogLevel { - return original.PossibleLogLevelValues() -} func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { return original.PossibleNetworkRuleBypassOptionsValues() } @@ -980,18 +703,6 @@ func PossibleOSValues() []OS { func PossiblePasswordNameValues() []PasswordName { return original.PossiblePasswordNameValues() } -func PossiblePipelineOptionsValues() []PipelineOptions { - return original.PossiblePipelineOptionsValues() -} -func PossiblePipelineRunSourceTypeValues() []PipelineRunSourceType { - return original.PossiblePipelineRunSourceTypeValues() -} -func PossiblePipelineRunTargetTypeValues() []PipelineRunTargetType { - return original.PossiblePipelineRunTargetTypeValues() -} -func PossiblePipelineSourceTypeValues() []PipelineSourceType { - return original.PossiblePipelineSourceTypeValues() -} func PossiblePolicyStatusValues() []PolicyStatus { return original.PossiblePolicyStatusValues() } @@ -1031,21 +742,9 @@ func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode { func PossibleSourceTriggerEventValues() []SourceTriggerEvent { return original.PossibleSourceTriggerEventValues() } -func PossibleTLSStatusValues() []TLSStatus { - return original.PossibleTLSStatusValues() -} func PossibleTaskStatusValues() []TaskStatus { return original.PossibleTaskStatusValues() } -func PossibleTokenCertificateNameValues() []TokenCertificateName { - return original.PossibleTokenCertificateNameValues() -} -func PossibleTokenPasswordNameValues() []TokenPasswordName { - return original.PossibleTokenPasswordNameValues() -} -func PossibleTokenStatusValues() []TokenStatus { - return original.PossibleTokenStatusValues() -} func PossibleTokenTypeValues() []TokenType { return original.PossibleTokenTypeValues() } diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/CHANGELOG.md b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/_meta.json b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/_meta.json new file mode 100644 index 000000000000..101c1150d5bd --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", + "readme": "/_/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md", + "tag": "package-2021-09", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-09 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/containerregistry/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" + } +} \ No newline at end of file diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/agentpools.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/agentpools.go new file mode 100644 index 000000000000..1ae5928434f8 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/agentpools.go @@ -0,0 +1,634 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// AgentPoolsClient is the client for the AgentPools methods of the Containerregistry service. +type AgentPoolsClient struct { + BaseClient +} + +// NewAgentPoolsClient creates an instance of the AgentPoolsClient client. +func NewAgentPoolsClient(subscriptionID string) AgentPoolsClient { + return NewAgentPoolsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewAgentPoolsClientWithBaseURI creates an instance of the AgentPoolsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewAgentPoolsClientWithBaseURI(baseURI string, subscriptionID string) AgentPoolsClient { + return AgentPoolsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates an agent pool for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// agentPoolName - the name of the agent pool. +// agentPool - the parameters of an agent pool that needs to scheduled. +func (client AgentPoolsClient) Create(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool AgentPool) (result AgentPoolsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: agentPoolName, + Constraints: []validation.Constraint{{Target: "agentPoolName", Name: validation.MaxLength, Rule: 20, Chain: nil}, + {Target: "agentPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "agentPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.AgentPoolsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, agentPoolName, agentPool) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client AgentPoolsClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool AgentPool) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithJSON(agentPool), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) CreateSender(req *http.Request) (future AgentPoolsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) CreateResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a specified agent pool resource. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (result AgentPoolsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: agentPoolName, + Constraints: []validation.Constraint{{Target: "agentPoolName", Name: validation.MaxLength, Rule: 20, Chain: nil}, + {Target: "agentPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "agentPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.AgentPoolsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client AgentPoolsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) DeleteSender(req *http.Request) (future AgentPoolsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the detailed information for a given agent pool. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) Get(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (result AgentPool, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: agentPoolName, + Constraints: []validation.Constraint{{Target: "agentPoolName", Name: validation.MaxLength, Rule: 20, Chain: nil}, + {Target: "agentPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "agentPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.AgentPoolsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client AgentPoolsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetQueueStatus gets the count of queued runs for a given agent pool. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// agentPoolName - the name of the agent pool. +func (client AgentPoolsClient) GetQueueStatus(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (result AgentPoolQueueStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.GetQueueStatus") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: agentPoolName, + Constraints: []validation.Constraint{{Target: "agentPoolName", Name: validation.MaxLength, Rule: 20, Chain: nil}, + {Target: "agentPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "agentPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.AgentPoolsClient", "GetQueueStatus", err.Error()) + } + + req, err := client.GetQueueStatusPreparer(ctx, resourceGroupName, registryName, agentPoolName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "GetQueueStatus", nil, "Failure preparing request") + return + } + + resp, err := client.GetQueueStatusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "GetQueueStatus", resp, "Failure sending request") + return + } + + result, err = client.GetQueueStatusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "GetQueueStatus", resp, "Failure responding to request") + return + } + + return +} + +// GetQueueStatusPreparer prepares the GetQueueStatus request. +func (client AgentPoolsClient) GetQueueStatusPreparer(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}/listQueueStatus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetQueueStatusSender sends the GetQueueStatus request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) GetQueueStatusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetQueueStatusResponder handles the response to the GetQueueStatus request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) GetQueueStatusResponder(resp *http.Response) (result AgentPoolQueueStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the agent pools for a specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client AgentPoolsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result AgentPoolListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.aplr.Response.Response != nil { + sc = result.aplr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.AgentPoolsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.aplr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "List", resp, "Failure sending request") + return + } + + result.aplr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "List", resp, "Failure responding to request") + return + } + if result.aplr.hasNextLink() && result.aplr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client AgentPoolsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) ListResponder(resp *http.Response) (result AgentPoolListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client AgentPoolsClient) listNextResults(ctx context.Context, lastResults AgentPoolListResult) (result AgentPoolListResult, err error) { + req, err := lastResults.agentPoolListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client AgentPoolsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result AgentPoolListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// Update updates an agent pool with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// agentPoolName - the name of the agent pool. +// updateParameters - the parameters for updating an agent pool. +func (client AgentPoolsClient) Update(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters AgentPoolUpdateParameters) (result AgentPoolsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: agentPoolName, + Constraints: []validation.Constraint{{Target: "agentPoolName", Name: validation.MaxLength, Rule: 20, Chain: nil}, + {Target: "agentPoolName", Name: validation.MinLength, Rule: 3, Chain: nil}, + {Target: "agentPoolName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.AgentPoolsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, agentPoolName, updateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client AgentPoolsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters AgentPoolUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "agentPoolName": autorest.Encode("path", agentPoolName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/agentPools/{agentPoolName}", pathParameters), + autorest.WithJSON(updateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client AgentPoolsClient) UpdateSender(req *http.Request) (future AgentPoolsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client AgentPoolsClient) UpdateResponder(resp *http.Response) (result AgentPool, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/client.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/client.go new file mode 100644 index 000000000000..79937e123765 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/client.go @@ -0,0 +1,41 @@ +// Package containerregistry implements the Azure ARM Containerregistry service API version . +// +// +package containerregistry + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Containerregistry + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Containerregistry. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/containerregistryapi/interfaces.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/containerregistryapi/interfaces.go new file mode 100644 index 000000000000..4f36398c2b39 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/containerregistryapi/interfaces.go @@ -0,0 +1,134 @@ +package containerregistryapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-09-01/containerregistry" +) + +// RegistriesClientAPI contains the set of methods on the RegistriesClient type. +type RegistriesClientAPI interface { + CheckNameAvailability(ctx context.Context, registryNameCheckRequest containerregistry.RegistryNameCheckRequest) (result containerregistry.RegistryNameStatus, err error) + Create(ctx context.Context, resourceGroupName string, registryName string, registry containerregistry.Registry) (result containerregistry.RegistriesCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistriesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.Registry, err error) + GetBuildSourceUploadURL(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.SourceUploadDefinition, err error) + GetPrivateLinkResource(ctx context.Context, resourceGroupName string, registryName string, groupName string) (result containerregistry.PrivateLinkResource, err error) + ImportImage(ctx context.Context, resourceGroupName string, registryName string, parameters containerregistry.ImportImageParameters) (result containerregistry.RegistriesImportImageFuture, err error) + List(ctx context.Context) (result containerregistry.RegistryListResultPage, err error) + ListComplete(ctx context.Context) (result containerregistry.RegistryListResultIterator, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result containerregistry.RegistryListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result containerregistry.RegistryListResultIterator, err error) + ListCredentials(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistryListCredentialsResult, err error) + ListPrivateLinkResources(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.PrivateLinkResourceListResultPage, err error) + ListPrivateLinkResourcesComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.PrivateLinkResourceListResultIterator, err error) + ListUsages(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.RegistryUsageListResult, err error) + RegenerateCredential(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters containerregistry.RegenerateCredentialParameters) (result containerregistry.RegistryListCredentialsResult, err error) + ScheduleRun(ctx context.Context, resourceGroupName string, registryName string, runRequest containerregistry.BasicRunRequest) (result containerregistry.RegistriesScheduleRunFuture, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters containerregistry.RegistryUpdateParameters) (result containerregistry.RegistriesUpdateFuture, err error) +} + +var _ RegistriesClientAPI = (*containerregistry.RegistriesClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result containerregistry.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result containerregistry.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*containerregistry.OperationsClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, privateEndpointConnection containerregistry.PrivateEndpointConnection) (result containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string) (result containerregistry.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string) (result containerregistry.PrivateEndpointConnection, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.PrivateEndpointConnectionListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.PrivateEndpointConnectionListResultIterator, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*containerregistry.PrivateEndpointConnectionsClient)(nil) + +// ReplicationsClientAPI contains the set of methods on the ReplicationsClient type. +type ReplicationsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication containerregistry.Replication) (result containerregistry.ReplicationsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result containerregistry.ReplicationsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result containerregistry.Replication, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ReplicationListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.ReplicationListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters containerregistry.ReplicationUpdateParameters) (result containerregistry.ReplicationsUpdateFuture, err error) +} + +var _ ReplicationsClientAPI = (*containerregistry.ReplicationsClient)(nil) + +// WebhooksClientAPI contains the set of methods on the WebhooksClient type. +type WebhooksClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters containerregistry.WebhookCreateParameters) (result containerregistry.WebhooksCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.WebhooksDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.Webhook, err error) + GetCallbackConfig(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.CallbackConfig, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.WebhookListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.WebhookListResultIterator, err error) + ListEvents(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.EventListResultPage, err error) + ListEventsComplete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.EventListResultIterator, err error) + Ping(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result containerregistry.EventInfo, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters containerregistry.WebhookUpdateParameters) (result containerregistry.WebhooksUpdateFuture, err error) +} + +var _ WebhooksClientAPI = (*containerregistry.WebhooksClient)(nil) + +// AgentPoolsClientAPI contains the set of methods on the AgentPoolsClient type. +type AgentPoolsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, agentPool containerregistry.AgentPool) (result containerregistry.AgentPoolsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (result containerregistry.AgentPoolsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (result containerregistry.AgentPool, err error) + GetQueueStatus(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string) (result containerregistry.AgentPoolQueueStatus, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.AgentPoolListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.AgentPoolListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, agentPoolName string, updateParameters containerregistry.AgentPoolUpdateParameters) (result containerregistry.AgentPoolsUpdateFuture, err error) +} + +var _ AgentPoolsClientAPI = (*containerregistry.AgentPoolsClient)(nil) + +// RunsClientAPI contains the set of methods on the RunsClient type. +type RunsClientAPI interface { + Cancel(ctx context.Context, resourceGroupName string, registryName string, runID string) (result containerregistry.RunsCancelFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, runID string) (result containerregistry.Run, err error) + GetLogSasURL(ctx context.Context, resourceGroupName string, registryName string, runID string) (result containerregistry.RunGetLogResult, err error) + List(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (result containerregistry.RunListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (result containerregistry.RunListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters containerregistry.RunUpdateParameters) (result containerregistry.RunsUpdateFuture, err error) +} + +var _ RunsClientAPI = (*containerregistry.RunsClient)(nil) + +// TaskRunsClientAPI contains the set of methods on the TaskRunsClient type. +type TaskRunsClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun containerregistry.TaskRun) (result containerregistry.TaskRunsCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (result containerregistry.TaskRunsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (result containerregistry.TaskRun, err error) + GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (result containerregistry.TaskRun, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.TaskRunListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.TaskRunListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters containerregistry.TaskRunUpdateParameters) (result containerregistry.TaskRunsUpdateFuture, err error) +} + +var _ TaskRunsClientAPI = (*containerregistry.TaskRunsClient)(nil) + +// TasksClientAPI contains the set of methods on the TasksClient type. +type TasksClientAPI interface { + Create(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters containerregistry.Task) (result containerregistry.TasksCreateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, registryName string, taskName string) (result containerregistry.TasksDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, registryName string, taskName string) (result containerregistry.Task, err error) + GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskName string) (result containerregistry.Task, err error) + List(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.TaskListResultPage, err error) + ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result containerregistry.TaskListResultIterator, err error) + Update(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters containerregistry.TaskUpdateParameters) (result containerregistry.TasksUpdateFuture, err error) +} + +var _ TasksClientAPI = (*containerregistry.TasksClient)(nil) diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/enums.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/enums.go new file mode 100644 index 000000000000..52aef98384d4 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/enums.go @@ -0,0 +1,679 @@ +package containerregistry + +// 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. + +// Action enumerates the values for action. +type Action string + +const ( + // ActionAllow ... + ActionAllow Action = "Allow" +) + +// PossibleActionValues returns an array of possible values for the Action const type. +func PossibleActionValues() []Action { + return []Action{ActionAllow} +} + +// ActionsRequired enumerates the values for actions required. +type ActionsRequired string + +const ( + // ActionsRequiredNone ... + ActionsRequiredNone ActionsRequired = "None" + // ActionsRequiredRecreate ... + ActionsRequiredRecreate ActionsRequired = "Recreate" +) + +// PossibleActionsRequiredValues returns an array of possible values for the ActionsRequired const type. +func PossibleActionsRequiredValues() []ActionsRequired { + return []ActionsRequired{ActionsRequiredNone, ActionsRequiredRecreate} +} + +// Architecture enumerates the values for architecture. +type Architecture string + +const ( + // ArchitectureAmd64 ... + ArchitectureAmd64 Architecture = "amd64" + // ArchitectureArm ... + ArchitectureArm Architecture = "arm" + // ArchitectureArm64 ... + ArchitectureArm64 Architecture = "arm64" + // ArchitectureThreeEightSix ... + ArchitectureThreeEightSix Architecture = "386" + // ArchitectureX86 ... + ArchitectureX86 Architecture = "x86" +) + +// PossibleArchitectureValues returns an array of possible values for the Architecture const type. +func PossibleArchitectureValues() []Architecture { + return []Architecture{ArchitectureAmd64, ArchitectureArm, ArchitectureArm64, ArchitectureThreeEightSix, ArchitectureX86} +} + +// BaseImageDependencyType enumerates the values for base image dependency type. +type BaseImageDependencyType string + +const ( + // BaseImageDependencyTypeBuildTime ... + BaseImageDependencyTypeBuildTime BaseImageDependencyType = "BuildTime" + // BaseImageDependencyTypeRunTime ... + BaseImageDependencyTypeRunTime BaseImageDependencyType = "RunTime" +) + +// PossibleBaseImageDependencyTypeValues returns an array of possible values for the BaseImageDependencyType const type. +func PossibleBaseImageDependencyTypeValues() []BaseImageDependencyType { + return []BaseImageDependencyType{BaseImageDependencyTypeBuildTime, BaseImageDependencyTypeRunTime} +} + +// BaseImageTriggerType enumerates the values for base image trigger type. +type BaseImageTriggerType string + +const ( + // BaseImageTriggerTypeAll ... + BaseImageTriggerTypeAll BaseImageTriggerType = "All" + // BaseImageTriggerTypeRuntime ... + BaseImageTriggerTypeRuntime BaseImageTriggerType = "Runtime" +) + +// PossibleBaseImageTriggerTypeValues returns an array of possible values for the BaseImageTriggerType const type. +func PossibleBaseImageTriggerTypeValues() []BaseImageTriggerType { + return []BaseImageTriggerType{BaseImageTriggerTypeAll, BaseImageTriggerTypeRuntime} +} + +// ConnectionStatus enumerates the values for connection status. +type ConnectionStatus string + +const ( + // ConnectionStatusApproved ... + ConnectionStatusApproved ConnectionStatus = "Approved" + // ConnectionStatusDisconnected ... + ConnectionStatusDisconnected ConnectionStatus = "Disconnected" + // ConnectionStatusPending ... + ConnectionStatusPending ConnectionStatus = "Pending" + // ConnectionStatusRejected ... + ConnectionStatusRejected ConnectionStatus = "Rejected" +) + +// PossibleConnectionStatusValues returns an array of possible values for the ConnectionStatus const type. +func PossibleConnectionStatusValues() []ConnectionStatus { + return []ConnectionStatus{ConnectionStatusApproved, ConnectionStatusDisconnected, ConnectionStatusPending, ConnectionStatusRejected} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow ... + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny ... + DefaultActionDeny DefaultAction = "Deny" +) + +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + +// EncryptionStatus enumerates the values for encryption status. +type EncryptionStatus string + +const ( + // EncryptionStatusDisabled ... + EncryptionStatusDisabled EncryptionStatus = "disabled" + // EncryptionStatusEnabled ... + EncryptionStatusEnabled EncryptionStatus = "enabled" +) + +// PossibleEncryptionStatusValues returns an array of possible values for the EncryptionStatus const type. +func PossibleEncryptionStatusValues() []EncryptionStatus { + return []EncryptionStatus{EncryptionStatusDisabled, EncryptionStatusEnabled} +} + +// ExportPolicyStatus enumerates the values for export policy status. +type ExportPolicyStatus string + +const ( + // ExportPolicyStatusDisabled ... + ExportPolicyStatusDisabled ExportPolicyStatus = "disabled" + // ExportPolicyStatusEnabled ... + ExportPolicyStatusEnabled ExportPolicyStatus = "enabled" +) + +// PossibleExportPolicyStatusValues returns an array of possible values for the ExportPolicyStatus const type. +func PossibleExportPolicyStatusValues() []ExportPolicyStatus { + return []ExportPolicyStatus{ExportPolicyStatusDisabled, ExportPolicyStatusEnabled} +} + +// ImportMode enumerates the values for import mode. +type ImportMode string + +const ( + // ImportModeForce ... + ImportModeForce ImportMode = "Force" + // ImportModeNoForce ... + ImportModeNoForce ImportMode = "NoForce" +) + +// PossibleImportModeValues returns an array of possible values for the ImportMode const type. +func PossibleImportModeValues() []ImportMode { + return []ImportMode{ImportModeForce, ImportModeNoForce} +} + +// LastModifiedByType enumerates the values for last modified by type. +type LastModifiedByType string + +const ( + // LastModifiedByTypeApplication ... + LastModifiedByTypeApplication LastModifiedByType = "Application" + // LastModifiedByTypeKey ... + LastModifiedByTypeKey LastModifiedByType = "Key" + // LastModifiedByTypeManagedIdentity ... + LastModifiedByTypeManagedIdentity LastModifiedByType = "ManagedIdentity" + // LastModifiedByTypeUser ... + LastModifiedByTypeUser LastModifiedByType = "User" +) + +// PossibleLastModifiedByTypeValues returns an array of possible values for the LastModifiedByType const type. +func PossibleLastModifiedByTypeValues() []LastModifiedByType { + return []LastModifiedByType{LastModifiedByTypeApplication, LastModifiedByTypeKey, LastModifiedByTypeManagedIdentity, LastModifiedByTypeUser} +} + +// NetworkRuleBypassOptions enumerates the values for network rule bypass options. +type NetworkRuleBypassOptions string + +const ( + // NetworkRuleBypassOptionsAzureServices ... + NetworkRuleBypassOptionsAzureServices NetworkRuleBypassOptions = "AzureServices" + // NetworkRuleBypassOptionsNone ... + NetworkRuleBypassOptionsNone NetworkRuleBypassOptions = "None" +) + +// PossibleNetworkRuleBypassOptionsValues returns an array of possible values for the NetworkRuleBypassOptions const type. +func PossibleNetworkRuleBypassOptionsValues() []NetworkRuleBypassOptions { + return []NetworkRuleBypassOptions{NetworkRuleBypassOptionsAzureServices, NetworkRuleBypassOptionsNone} +} + +// OS enumerates the values for os. +type OS string + +const ( + // OSLinux ... + OSLinux OS = "Linux" + // OSWindows ... + OSWindows OS = "Windows" +) + +// PossibleOSValues returns an array of possible values for the OS const type. +func PossibleOSValues() []OS { + return []OS{OSLinux, OSWindows} +} + +// PasswordName enumerates the values for password name. +type PasswordName string + +const ( + // PasswordNamePassword ... + PasswordNamePassword PasswordName = "password" + // PasswordNamePassword2 ... + PasswordNamePassword2 PasswordName = "password2" +) + +// PossiblePasswordNameValues returns an array of possible values for the PasswordName const type. +func PossiblePasswordNameValues() []PasswordName { + return []PasswordName{PasswordNamePassword, PasswordNamePassword2} +} + +// PolicyStatus enumerates the values for policy status. +type PolicyStatus string + +const ( + // PolicyStatusDisabled ... + PolicyStatusDisabled PolicyStatus = "disabled" + // PolicyStatusEnabled ... + PolicyStatusEnabled PolicyStatus = "enabled" +) + +// PossiblePolicyStatusValues returns an array of possible values for the PolicyStatus const type. +func PossiblePolicyStatusValues() []PolicyStatus { + return []PolicyStatus{PolicyStatusDisabled, PolicyStatusEnabled} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCanceled ... + ProvisioningStateCanceled ProvisioningState = "Canceled" + // ProvisioningStateCreating ... + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting ... + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed ... + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateSucceeded ... + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating ... + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCanceled, ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled ... + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled ... + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} +} + +// RegistryUsageUnit enumerates the values for registry usage unit. +type RegistryUsageUnit string + +const ( + // RegistryUsageUnitBytes ... + RegistryUsageUnitBytes RegistryUsageUnit = "Bytes" + // RegistryUsageUnitCount ... + RegistryUsageUnitCount RegistryUsageUnit = "Count" +) + +// PossibleRegistryUsageUnitValues returns an array of possible values for the RegistryUsageUnit const type. +func PossibleRegistryUsageUnitValues() []RegistryUsageUnit { + return []RegistryUsageUnit{RegistryUsageUnitBytes, RegistryUsageUnitCount} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RunStatus enumerates the values for run status. +type RunStatus string + +const ( + // RunStatusCanceled ... + RunStatusCanceled RunStatus = "Canceled" + // RunStatusError ... + RunStatusError RunStatus = "Error" + // RunStatusFailed ... + RunStatusFailed RunStatus = "Failed" + // RunStatusQueued ... + RunStatusQueued RunStatus = "Queued" + // RunStatusRunning ... + RunStatusRunning RunStatus = "Running" + // RunStatusStarted ... + RunStatusStarted RunStatus = "Started" + // RunStatusSucceeded ... + RunStatusSucceeded RunStatus = "Succeeded" + // RunStatusTimeout ... + RunStatusTimeout RunStatus = "Timeout" +) + +// PossibleRunStatusValues returns an array of possible values for the RunStatus const type. +func PossibleRunStatusValues() []RunStatus { + return []RunStatus{RunStatusCanceled, RunStatusError, RunStatusFailed, RunStatusQueued, RunStatusRunning, RunStatusStarted, RunStatusSucceeded, RunStatusTimeout} +} + +// RunType enumerates the values for run type. +type RunType string + +const ( + // RunTypeAutoBuild ... + RunTypeAutoBuild RunType = "AutoBuild" + // RunTypeAutoRun ... + RunTypeAutoRun RunType = "AutoRun" + // RunTypeQuickBuild ... + RunTypeQuickBuild RunType = "QuickBuild" + // RunTypeQuickRun ... + RunTypeQuickRun RunType = "QuickRun" +) + +// PossibleRunTypeValues returns an array of possible values for the RunType const type. +func PossibleRunTypeValues() []RunType { + return []RunType{RunTypeAutoBuild, RunTypeAutoRun, RunTypeQuickBuild, RunTypeQuickRun} +} + +// SecretObjectType enumerates the values for secret object type. +type SecretObjectType string + +const ( + // SecretObjectTypeOpaque ... + SecretObjectTypeOpaque SecretObjectType = "Opaque" + // SecretObjectTypeVaultsecret ... + SecretObjectTypeVaultsecret SecretObjectType = "Vaultsecret" +) + +// PossibleSecretObjectTypeValues returns an array of possible values for the SecretObjectType const type. +func PossibleSecretObjectTypeValues() []SecretObjectType { + return []SecretObjectType{SecretObjectTypeOpaque, SecretObjectTypeVaultsecret} +} + +// SkuName enumerates the values for sku name. +type SkuName string + +const ( + // SkuNameBasic ... + SkuNameBasic SkuName = "Basic" + // SkuNameClassic ... + SkuNameClassic SkuName = "Classic" + // SkuNamePremium ... + SkuNamePremium SkuName = "Premium" + // SkuNameStandard ... + SkuNameStandard SkuName = "Standard" +) + +// PossibleSkuNameValues returns an array of possible values for the SkuName const type. +func PossibleSkuNameValues() []SkuName { + return []SkuName{SkuNameBasic, SkuNameClassic, SkuNamePremium, SkuNameStandard} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierClassic ... + SkuTierClassic SkuTier = "Classic" + // SkuTierPremium ... + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierClassic, SkuTierPremium, SkuTierStandard} +} + +// SourceControlType enumerates the values for source control type. +type SourceControlType string + +const ( + // SourceControlTypeGithub ... + SourceControlTypeGithub SourceControlType = "Github" + // SourceControlTypeVisualStudioTeamService ... + SourceControlTypeVisualStudioTeamService SourceControlType = "VisualStudioTeamService" +) + +// PossibleSourceControlTypeValues returns an array of possible values for the SourceControlType const type. +func PossibleSourceControlTypeValues() []SourceControlType { + return []SourceControlType{SourceControlTypeGithub, SourceControlTypeVisualStudioTeamService} +} + +// SourceRegistryLoginMode enumerates the values for source registry login mode. +type SourceRegistryLoginMode string + +const ( + // SourceRegistryLoginModeDefault ... + SourceRegistryLoginModeDefault SourceRegistryLoginMode = "Default" + // SourceRegistryLoginModeNone ... + SourceRegistryLoginModeNone SourceRegistryLoginMode = "None" +) + +// PossibleSourceRegistryLoginModeValues returns an array of possible values for the SourceRegistryLoginMode const type. +func PossibleSourceRegistryLoginModeValues() []SourceRegistryLoginMode { + return []SourceRegistryLoginMode{SourceRegistryLoginModeDefault, SourceRegistryLoginModeNone} +} + +// SourceTriggerEvent enumerates the values for source trigger event. +type SourceTriggerEvent string + +const ( + // SourceTriggerEventCommit ... + SourceTriggerEventCommit SourceTriggerEvent = "commit" + // SourceTriggerEventPullrequest ... + SourceTriggerEventPullrequest SourceTriggerEvent = "pullrequest" +) + +// PossibleSourceTriggerEventValues returns an array of possible values for the SourceTriggerEvent const type. +func PossibleSourceTriggerEventValues() []SourceTriggerEvent { + return []SourceTriggerEvent{SourceTriggerEventCommit, SourceTriggerEventPullrequest} +} + +// TaskStatus enumerates the values for task status. +type TaskStatus string + +const ( + // TaskStatusDisabled ... + TaskStatusDisabled TaskStatus = "Disabled" + // TaskStatusEnabled ... + TaskStatusEnabled TaskStatus = "Enabled" +) + +// PossibleTaskStatusValues returns an array of possible values for the TaskStatus const type. +func PossibleTaskStatusValues() []TaskStatus { + return []TaskStatus{TaskStatusDisabled, TaskStatusEnabled} +} + +// TokenType enumerates the values for token type. +type TokenType string + +const ( + // TokenTypeOAuth ... + TokenTypeOAuth TokenType = "OAuth" + // TokenTypePAT ... + TokenTypePAT TokenType = "PAT" +) + +// PossibleTokenTypeValues returns an array of possible values for the TokenType const type. +func PossibleTokenTypeValues() []TokenType { + return []TokenType{TokenTypeOAuth, TokenTypePAT} +} + +// TriggerStatus enumerates the values for trigger status. +type TriggerStatus string + +const ( + // TriggerStatusDisabled ... + TriggerStatusDisabled TriggerStatus = "Disabled" + // TriggerStatusEnabled ... + TriggerStatusEnabled TriggerStatus = "Enabled" +) + +// PossibleTriggerStatusValues returns an array of possible values for the TriggerStatus const type. +func PossibleTriggerStatusValues() []TriggerStatus { + return []TriggerStatus{TriggerStatusDisabled, TriggerStatusEnabled} +} + +// TrustPolicyType enumerates the values for trust policy type. +type TrustPolicyType string + +const ( + // TrustPolicyTypeNotary ... + TrustPolicyTypeNotary TrustPolicyType = "Notary" +) + +// PossibleTrustPolicyTypeValues returns an array of possible values for the TrustPolicyType const type. +func PossibleTrustPolicyTypeValues() []TrustPolicyType { + return []TrustPolicyType{TrustPolicyTypeNotary} +} + +// Type enumerates the values for type. +type Type string + +const ( + // TypeDockerBuildRequest ... + TypeDockerBuildRequest Type = "DockerBuildRequest" + // TypeEncodedTaskRunRequest ... + TypeEncodedTaskRunRequest Type = "EncodedTaskRunRequest" + // TypeFileTaskRunRequest ... + TypeFileTaskRunRequest Type = "FileTaskRunRequest" + // TypeRunRequest ... + TypeRunRequest Type = "RunRequest" + // TypeTaskRunRequest ... + TypeTaskRunRequest Type = "TaskRunRequest" +) + +// PossibleTypeValues returns an array of possible values for the Type const type. +func PossibleTypeValues() []Type { + return []Type{TypeDockerBuildRequest, TypeEncodedTaskRunRequest, TypeFileTaskRunRequest, TypeRunRequest, TypeTaskRunRequest} +} + +// TypeBasicTaskStepProperties enumerates the values for type basic task step properties. +type TypeBasicTaskStepProperties string + +const ( + // TypeBasicTaskStepPropertiesTypeDocker ... + TypeBasicTaskStepPropertiesTypeDocker TypeBasicTaskStepProperties = "Docker" + // TypeBasicTaskStepPropertiesTypeEncodedTask ... + TypeBasicTaskStepPropertiesTypeEncodedTask TypeBasicTaskStepProperties = "EncodedTask" + // TypeBasicTaskStepPropertiesTypeFileTask ... + TypeBasicTaskStepPropertiesTypeFileTask TypeBasicTaskStepProperties = "FileTask" + // TypeBasicTaskStepPropertiesTypeTaskStepProperties ... + TypeBasicTaskStepPropertiesTypeTaskStepProperties TypeBasicTaskStepProperties = "TaskStepProperties" +) + +// PossibleTypeBasicTaskStepPropertiesValues returns an array of possible values for the TypeBasicTaskStepProperties const type. +func PossibleTypeBasicTaskStepPropertiesValues() []TypeBasicTaskStepProperties { + return []TypeBasicTaskStepProperties{TypeBasicTaskStepPropertiesTypeDocker, TypeBasicTaskStepPropertiesTypeEncodedTask, TypeBasicTaskStepPropertiesTypeFileTask, TypeBasicTaskStepPropertiesTypeTaskStepProperties} +} + +// TypeBasicTaskStepUpdateParameters enumerates the values for type basic task step update parameters. +type TypeBasicTaskStepUpdateParameters string + +const ( + // TypeBasicTaskStepUpdateParametersTypeDocker ... + TypeBasicTaskStepUpdateParametersTypeDocker TypeBasicTaskStepUpdateParameters = "Docker" + // TypeBasicTaskStepUpdateParametersTypeEncodedTask ... + TypeBasicTaskStepUpdateParametersTypeEncodedTask TypeBasicTaskStepUpdateParameters = "EncodedTask" + // TypeBasicTaskStepUpdateParametersTypeFileTask ... + TypeBasicTaskStepUpdateParametersTypeFileTask TypeBasicTaskStepUpdateParameters = "FileTask" + // TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters ... + TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters TypeBasicTaskStepUpdateParameters = "TaskStepUpdateParameters" +) + +// PossibleTypeBasicTaskStepUpdateParametersValues returns an array of possible values for the TypeBasicTaskStepUpdateParameters const type. +func PossibleTypeBasicTaskStepUpdateParametersValues() []TypeBasicTaskStepUpdateParameters { + return []TypeBasicTaskStepUpdateParameters{TypeBasicTaskStepUpdateParametersTypeDocker, TypeBasicTaskStepUpdateParametersTypeEncodedTask, TypeBasicTaskStepUpdateParametersTypeFileTask, TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters} +} + +// UpdateTriggerPayloadType enumerates the values for update trigger payload type. +type UpdateTriggerPayloadType string + +const ( + // UpdateTriggerPayloadTypeDefault ... + UpdateTriggerPayloadTypeDefault UpdateTriggerPayloadType = "Default" + // UpdateTriggerPayloadTypeToken ... + UpdateTriggerPayloadTypeToken UpdateTriggerPayloadType = "Token" +) + +// PossibleUpdateTriggerPayloadTypeValues returns an array of possible values for the UpdateTriggerPayloadType const type. +func PossibleUpdateTriggerPayloadTypeValues() []UpdateTriggerPayloadType { + return []UpdateTriggerPayloadType{UpdateTriggerPayloadTypeDefault, UpdateTriggerPayloadTypeToken} +} + +// Variant enumerates the values for variant. +type Variant string + +const ( + // VariantV6 ... + VariantV6 Variant = "v6" + // VariantV7 ... + VariantV7 Variant = "v7" + // VariantV8 ... + VariantV8 Variant = "v8" +) + +// PossibleVariantValues returns an array of possible values for the Variant const type. +func PossibleVariantValues() []Variant { + return []Variant{VariantV6, VariantV7, VariantV8} +} + +// WebhookAction enumerates the values for webhook action. +type WebhookAction string + +const ( + // WebhookActionChartDelete ... + WebhookActionChartDelete WebhookAction = "chart_delete" + // WebhookActionChartPush ... + WebhookActionChartPush WebhookAction = "chart_push" + // WebhookActionDelete ... + WebhookActionDelete WebhookAction = "delete" + // WebhookActionPush ... + WebhookActionPush WebhookAction = "push" + // WebhookActionQuarantine ... + WebhookActionQuarantine WebhookAction = "quarantine" +) + +// PossibleWebhookActionValues returns an array of possible values for the WebhookAction const type. +func PossibleWebhookActionValues() []WebhookAction { + return []WebhookAction{WebhookActionChartDelete, WebhookActionChartPush, WebhookActionDelete, WebhookActionPush, WebhookActionQuarantine} +} + +// WebhookStatus enumerates the values for webhook status. +type WebhookStatus string + +const ( + // WebhookStatusDisabled ... + WebhookStatusDisabled WebhookStatus = "disabled" + // WebhookStatusEnabled ... + WebhookStatusEnabled WebhookStatus = "enabled" +) + +// PossibleWebhookStatusValues returns an array of possible values for the WebhookStatus const type. +func PossibleWebhookStatusValues() []WebhookStatus { + return []WebhookStatus{WebhookStatusDisabled, WebhookStatusEnabled} +} + +// ZoneRedundancy enumerates the values for zone redundancy. +type ZoneRedundancy string + +const ( + // ZoneRedundancyDisabled ... + ZoneRedundancyDisabled ZoneRedundancy = "Disabled" + // ZoneRedundancyEnabled ... + ZoneRedundancyEnabled ZoneRedundancy = "Enabled" +) + +// PossibleZoneRedundancyValues returns an array of possible values for the ZoneRedundancy const type. +func PossibleZoneRedundancyValues() []ZoneRedundancy { + return []ZoneRedundancy{ZoneRedundancyDisabled, ZoneRedundancyEnabled} +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/models.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/models.go new file mode 100644 index 000000000000..beb6f400d613 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/models.go @@ -0,0 +1,7237 @@ +package containerregistry + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-09-01/containerregistry" + +// Actor the agent that initiated the event. For most situations, this could be from the authorization +// context of the request. +type Actor struct { + // Name - The subject or username associated with the request context that generated the event. + Name *string `json:"name,omitempty"` +} + +// AgentPool the agentpool that has the ARM resource and properties. +// The agentpool will have all information to create an agent pool. +type AgentPool struct { + autorest.Response `json:"-"` + // AgentPoolProperties - The properties associated with the agent pool + *AgentPoolProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPool. +func (ap AgentPool) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ap.AgentPoolProperties != nil { + objectMap["properties"] = ap.AgentPoolProperties + } + if ap.Location != nil { + objectMap["location"] = ap.Location + } + if ap.Tags != nil { + objectMap["tags"] = ap.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPool struct. +func (ap *AgentPool) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var agentPoolProperties AgentPoolProperties + err = json.Unmarshal(*v, &agentPoolProperties) + if err != nil { + return err + } + ap.AgentPoolProperties = &agentPoolProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + ap.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + ap.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + ap.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + ap.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + ap.Tags = tags + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + ap.SystemData = &systemData + } + } + } + + return nil +} + +// AgentPoolListResult the collection of agent pools. +type AgentPoolListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]AgentPool `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// AgentPoolListResultIterator provides access to a complete listing of AgentPool values. +type AgentPoolListResultIterator struct { + i int + page AgentPoolListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *AgentPoolListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *AgentPoolListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter AgentPoolListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter AgentPoolListResultIterator) Response() AgentPoolListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter AgentPoolListResultIterator) Value() AgentPool { + if !iter.page.NotDone() { + return AgentPool{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the AgentPoolListResultIterator type. +func NewAgentPoolListResultIterator(page AgentPoolListResultPage) AgentPoolListResultIterator { + return AgentPoolListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (aplr AgentPoolListResult) IsEmpty() bool { + return aplr.Value == nil || len(*aplr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (aplr AgentPoolListResult) hasNextLink() bool { + return aplr.NextLink != nil && len(*aplr.NextLink) != 0 +} + +// agentPoolListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (aplr AgentPoolListResult) agentPoolListResultPreparer(ctx context.Context) (*http.Request, error) { + if !aplr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(aplr.NextLink))) +} + +// AgentPoolListResultPage contains a page of AgentPool values. +type AgentPoolListResultPage struct { + fn func(context.Context, AgentPoolListResult) (AgentPoolListResult, error) + aplr AgentPoolListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *AgentPoolListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/AgentPoolListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.aplr) + if err != nil { + return err + } + page.aplr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *AgentPoolListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page AgentPoolListResultPage) NotDone() bool { + return !page.aplr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page AgentPoolListResultPage) Response() AgentPoolListResult { + return page.aplr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page AgentPoolListResultPage) Values() []AgentPool { + if page.aplr.IsEmpty() { + return nil + } + return *page.aplr.Value +} + +// Creates a new instance of the AgentPoolListResultPage type. +func NewAgentPoolListResultPage(cur AgentPoolListResult, getNextPage func(context.Context, AgentPoolListResult) (AgentPoolListResult, error)) AgentPoolListResultPage { + return AgentPoolListResultPage{ + fn: getNextPage, + aplr: cur, + } +} + +// AgentPoolProperties the properties of agent pool. +type AgentPoolProperties struct { + // Count - The count of agent machine + Count *int32 `json:"count,omitempty"` + // Tier - The Tier of agent machine + Tier *string `json:"tier,omitempty"` + // Os - The OS of agent machine. Possible values include: 'OSWindows', 'OSLinux' + Os OS `json:"os,omitempty"` + // VirtualNetworkSubnetResourceID - The Virtual Network Subnet Resource Id of the agent machine + VirtualNetworkSubnetResourceID *string `json:"virtualNetworkSubnetResourceId,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of this agent pool. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for AgentPoolProperties. +func (app AgentPoolProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if app.Count != nil { + objectMap["count"] = app.Count + } + if app.Tier != nil { + objectMap["tier"] = app.Tier + } + if app.Os != "" { + objectMap["os"] = app.Os + } + if app.VirtualNetworkSubnetResourceID != nil { + objectMap["virtualNetworkSubnetResourceId"] = app.VirtualNetworkSubnetResourceID + } + return json.Marshal(objectMap) +} + +// AgentPoolPropertiesUpdateParameters ... +type AgentPoolPropertiesUpdateParameters struct { + // Count - The count of agent machine + Count *int32 `json:"count,omitempty"` +} + +// AgentPoolQueueStatus the QueueStatus of Agent Pool +type AgentPoolQueueStatus struct { + autorest.Response `json:"-"` + // Count - The number of pending runs in the queue + Count *int32 `json:"count,omitempty"` +} + +// AgentPoolsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AgentPoolsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (AgentPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsCreateFuture.Result. +func (future *AgentPoolsCreateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ap.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.AgentPoolsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent { + ap, err = client.CreateResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsCreateFuture", "Result", ap.Response.Response, "Failure responding to request") + } + } + return +} + +// AgentPoolsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AgentPoolsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsDeleteFuture.Result. +func (future *AgentPoolsDeleteFuture) result(client AgentPoolsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.AgentPoolsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// AgentPoolsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type AgentPoolsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(AgentPoolsClient) (AgentPool, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *AgentPoolsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for AgentPoolsUpdateFuture.Result. +func (future *AgentPoolsUpdateFuture) result(client AgentPoolsClient) (ap AgentPool, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ap.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.AgentPoolsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ap.Response.Response, err = future.GetResult(sender); err == nil && ap.Response.Response.StatusCode != http.StatusNoContent { + ap, err = client.UpdateResponder(ap.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.AgentPoolsUpdateFuture", "Result", ap.Response.Response, "Failure responding to request") + } + } + return +} + +// AgentPoolUpdateParameters the parameters for updating an agent pool. +type AgentPoolUpdateParameters struct { + // AgentPoolPropertiesUpdateParameters - The properties associated with the agent pool + *AgentPoolPropertiesUpdateParameters `json:"properties,omitempty"` + // Tags - The ARM resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for AgentPoolUpdateParameters. +func (apup AgentPoolUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if apup.AgentPoolPropertiesUpdateParameters != nil { + objectMap["properties"] = apup.AgentPoolPropertiesUpdateParameters + } + if apup.Tags != nil { + objectMap["tags"] = apup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for AgentPoolUpdateParameters struct. +func (apup *AgentPoolUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var agentPoolPropertiesUpdateParameters AgentPoolPropertiesUpdateParameters + err = json.Unmarshal(*v, &agentPoolPropertiesUpdateParameters) + if err != nil { + return err + } + apup.AgentPoolPropertiesUpdateParameters = &agentPoolPropertiesUpdateParameters + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + apup.Tags = tags + } + } + } + + return nil +} + +// AgentProperties the properties that determine the run agent configuration. +type AgentProperties struct { + // CPU - The CPU configuration in terms of number of cores required for the run. + CPU *int32 `json:"cpu,omitempty"` +} + +// Argument the properties of a run argument. +type Argument struct { + // Name - The name of the argument. + Name *string `json:"name,omitempty"` + // Value - The value of the argument. + Value *string `json:"value,omitempty"` + // IsSecret - Flag to indicate whether the argument represents a secret and want to be removed from build logs. + IsSecret *bool `json:"isSecret,omitempty"` +} + +// AuthInfo the authorization properties for accessing the source code repository. +type AuthInfo struct { + // TokenType - The type of Auth token. Possible values include: 'TokenTypePAT', 'TokenTypeOAuth' + TokenType TokenType `json:"tokenType,omitempty"` + // Token - The access token used to access the source control provider. + Token *string `json:"token,omitempty"` + // RefreshToken - The refresh token used to refresh the access token. + RefreshToken *string `json:"refreshToken,omitempty"` + // Scope - The scope of the access token. + Scope *string `json:"scope,omitempty"` + // ExpiresIn - Time in seconds that the token remains valid + ExpiresIn *int32 `json:"expiresIn,omitempty"` +} + +// AuthInfoUpdateParameters the authorization properties for accessing the source code repository. +type AuthInfoUpdateParameters struct { + // TokenType - The type of Auth token. Possible values include: 'TokenTypePAT', 'TokenTypeOAuth' + TokenType TokenType `json:"tokenType,omitempty"` + // Token - The access token used to access the source control provider. + Token *string `json:"token,omitempty"` + // RefreshToken - The refresh token used to refresh the access token. + RefreshToken *string `json:"refreshToken,omitempty"` + // Scope - The scope of the access token. + Scope *string `json:"scope,omitempty"` + // ExpiresIn - Time in seconds that the token remains valid + ExpiresIn *int32 `json:"expiresIn,omitempty"` +} + +// BaseImageDependency properties that describe a base image dependency. +type BaseImageDependency struct { + // Type - The type of the base image dependency. Possible values include: 'BaseImageDependencyTypeBuildTime', 'BaseImageDependencyTypeRunTime' + Type BaseImageDependencyType `json:"type,omitempty"` + // Registry - The registry login server. + Registry *string `json:"registry,omitempty"` + // Repository - The repository name. + Repository *string `json:"repository,omitempty"` + // Tag - The tag name. + Tag *string `json:"tag,omitempty"` + // Digest - The sha256-based digest of the image manifest. + Digest *string `json:"digest,omitempty"` +} + +// BaseImageTrigger the trigger based on base image dependency. +type BaseImageTrigger struct { + // BaseImageTriggerType - The type of the auto trigger for base image dependency updates. Possible values include: 'BaseImageTriggerTypeAll', 'BaseImageTriggerTypeRuntime' + BaseImageTriggerType BaseImageTriggerType `json:"baseImageTriggerType,omitempty"` + // UpdateTriggerEndpoint - The endpoint URL for receiving update triggers. + UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"` + // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'UpdateTriggerPayloadTypeDefault', 'UpdateTriggerPayloadTypeToken' + UpdateTriggerPayloadType UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// BaseImageTriggerUpdateParameters the properties for updating base image dependency trigger. +type BaseImageTriggerUpdateParameters struct { + // BaseImageTriggerType - The type of the auto trigger for base image dependency updates. Possible values include: 'BaseImageTriggerTypeAll', 'BaseImageTriggerTypeRuntime' + BaseImageTriggerType BaseImageTriggerType `json:"baseImageTriggerType,omitempty"` + // UpdateTriggerEndpoint - The endpoint URL for receiving update triggers. + UpdateTriggerEndpoint *string `json:"updateTriggerEndpoint,omitempty"` + // UpdateTriggerPayloadType - Type of Payload body for Base image update triggers. Possible values include: 'UpdateTriggerPayloadTypeDefault', 'UpdateTriggerPayloadTypeToken' + UpdateTriggerPayloadType UpdateTriggerPayloadType `json:"updateTriggerPayloadType,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// CallbackConfig the configuration of service URI and custom headers for the webhook. +type CallbackConfig struct { + autorest.Response `json:"-"` + // ServiceURI - The service URI for the webhook to post notifications. + ServiceURI *string `json:"serviceUri,omitempty"` + // CustomHeaders - Custom headers that will be added to the webhook notifications. + CustomHeaders map[string]*string `json:"customHeaders"` +} + +// MarshalJSON is the custom marshaler for CallbackConfig. +func (cc CallbackConfig) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cc.ServiceURI != nil { + objectMap["serviceUri"] = cc.ServiceURI + } + if cc.CustomHeaders != nil { + objectMap["customHeaders"] = cc.CustomHeaders + } + return json.Marshal(objectMap) +} + +// Credentials the parameters that describes a set of credentials that will be used when a run is invoked. +type Credentials struct { + // SourceRegistry - Describes the credential parameters for accessing the source registry. + SourceRegistry *SourceRegistryCredentials `json:"sourceRegistry,omitempty"` + // CustomRegistries - Describes the credential parameters for accessing other custom registries. The key + // for the dictionary item will be the registry login server (myregistry.azurecr.io) and + // the value of the item will be the registry credentials for accessing the registry. + CustomRegistries map[string]*CustomRegistryCredentials `json:"customRegistries"` +} + +// MarshalJSON is the custom marshaler for Credentials. +func (c Credentials) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if c.SourceRegistry != nil { + objectMap["sourceRegistry"] = c.SourceRegistry + } + if c.CustomRegistries != nil { + objectMap["customRegistries"] = c.CustomRegistries + } + return json.Marshal(objectMap) +} + +// CustomRegistryCredentials describes the credentials that will be used to access a custom registry during +// a run. +type CustomRegistryCredentials struct { + // UserName - The username for logging into the custom registry. + UserName *SecretObject `json:"userName,omitempty"` + // Password - The password for logging into the custom registry. The password is a secret + // object that allows multiple ways of providing the value for it. + Password *SecretObject `json:"password,omitempty"` + // Identity - Indicates the managed identity assigned to the custom credential. If a user-assigned identity + // this value is the Client ID. If a system-assigned identity, the value will be `system`. In + // the case of a system-assigned identity, the Client ID will be determined by the runner. This + // identity may be used to authenticate to key vault to retrieve credentials or it may be the only + // source of authentication used for accessing the registry. + Identity *string `json:"identity,omitempty"` +} + +// DockerBuildRequest the parameters for a docker quick build. +type DockerBuildRequest struct { + // ImageNames - The fully qualified image names including the repository and tag. + ImageNames *[]string `json:"imageNames,omitempty"` + // IsPushEnabled - The value of this property indicates whether the image built should be pushed to the registry or not. + IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + // NoCache - The value of this property indicates whether the image cache is enabled or not. + NoCache *bool `json:"noCache,omitempty"` + // DockerFilePath - The Docker file path relative to the source location. + DockerFilePath *string `json:"dockerFilePath,omitempty"` + // Target - The name of the target build stage for the docker build. + Target *string `json:"target,omitempty"` + // Arguments - The collection of override arguments to be used when executing the run. + Arguments *[]Argument `json:"arguments,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformProperties `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // SourceLocation - The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + // If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + SourceLocation *string `json:"sourceLocation,omitempty"` + // Credentials - The properties that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // AgentPoolName - The dedicated agent pool for the run. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` + // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DockerBuildRequest. +func (dbr DockerBuildRequest) MarshalJSON() ([]byte, error) { + dbr.Type = TypeDockerBuildRequest + objectMap := make(map[string]interface{}) + if dbr.ImageNames != nil { + objectMap["imageNames"] = dbr.ImageNames + } + if dbr.IsPushEnabled != nil { + objectMap["isPushEnabled"] = dbr.IsPushEnabled + } + if dbr.NoCache != nil { + objectMap["noCache"] = dbr.NoCache + } + if dbr.DockerFilePath != nil { + objectMap["dockerFilePath"] = dbr.DockerFilePath + } + if dbr.Target != nil { + objectMap["target"] = dbr.Target + } + if dbr.Arguments != nil { + objectMap["arguments"] = dbr.Arguments + } + if dbr.Timeout != nil { + objectMap["timeout"] = dbr.Timeout + } + if dbr.Platform != nil { + objectMap["platform"] = dbr.Platform + } + if dbr.AgentConfiguration != nil { + objectMap["agentConfiguration"] = dbr.AgentConfiguration + } + if dbr.SourceLocation != nil { + objectMap["sourceLocation"] = dbr.SourceLocation + } + if dbr.Credentials != nil { + objectMap["credentials"] = dbr.Credentials + } + if dbr.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = dbr.IsArchiveEnabled + } + if dbr.AgentPoolName != nil { + objectMap["agentPoolName"] = dbr.AgentPoolName + } + if dbr.LogTemplate != nil { + objectMap["logTemplate"] = dbr.LogTemplate + } + if dbr.Type != "" { + objectMap["type"] = dbr.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildRequest is the BasicRunRequest implementation for DockerBuildRequest. +func (dbr DockerBuildRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { + return &dbr, true +} + +// AsFileTaskRunRequest is the BasicRunRequest implementation for DockerBuildRequest. +func (dbr DockerBuildRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { + return nil, false +} + +// AsTaskRunRequest is the BasicRunRequest implementation for DockerBuildRequest. +func (dbr DockerBuildRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { + return nil, false +} + +// AsEncodedTaskRunRequest is the BasicRunRequest implementation for DockerBuildRequest. +func (dbr DockerBuildRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { + return nil, false +} + +// AsRunRequest is the BasicRunRequest implementation for DockerBuildRequest. +func (dbr DockerBuildRequest) AsRunRequest() (*RunRequest, bool) { + return nil, false +} + +// AsBasicRunRequest is the BasicRunRequest implementation for DockerBuildRequest. +func (dbr DockerBuildRequest) AsBasicRunRequest() (BasicRunRequest, bool) { + return &dbr, true +} + +// DockerBuildStep the Docker build step. +type DockerBuildStep struct { + // ImageNames - The fully qualified image names including the repository and tag. + ImageNames *[]string `json:"imageNames,omitempty"` + // IsPushEnabled - The value of this property indicates whether the image built should be pushed to the registry or not. + IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + // NoCache - The value of this property indicates whether the image cache is enabled or not. + NoCache *bool `json:"noCache,omitempty"` + // DockerFilePath - The Docker file path relative to the source context. + DockerFilePath *string `json:"dockerFilePath,omitempty"` + // Target - The name of the target build stage for the docker build. + Target *string `json:"target,omitempty"` + // Arguments - The collection of override arguments to be used when executing this build step. + Arguments *[]Argument `json:"arguments,omitempty"` + // BaseImageDependencies - READ-ONLY; List of base image dependencies for a step. + BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepPropertiesTypeTaskStepProperties', 'TypeBasicTaskStepPropertiesTypeDocker', 'TypeBasicTaskStepPropertiesTypeFileTask', 'TypeBasicTaskStepPropertiesTypeEncodedTask' + Type TypeBasicTaskStepProperties `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DockerBuildStep. +func (dbs DockerBuildStep) MarshalJSON() ([]byte, error) { + dbs.Type = TypeBasicTaskStepPropertiesTypeDocker + objectMap := make(map[string]interface{}) + if dbs.ImageNames != nil { + objectMap["imageNames"] = dbs.ImageNames + } + if dbs.IsPushEnabled != nil { + objectMap["isPushEnabled"] = dbs.IsPushEnabled + } + if dbs.NoCache != nil { + objectMap["noCache"] = dbs.NoCache + } + if dbs.DockerFilePath != nil { + objectMap["dockerFilePath"] = dbs.DockerFilePath + } + if dbs.Target != nil { + objectMap["target"] = dbs.Target + } + if dbs.Arguments != nil { + objectMap["arguments"] = dbs.Arguments + } + if dbs.ContextPath != nil { + objectMap["contextPath"] = dbs.ContextPath + } + if dbs.ContextAccessToken != nil { + objectMap["contextAccessToken"] = dbs.ContextAccessToken + } + if dbs.Type != "" { + objectMap["type"] = dbs.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStep is the BasicTaskStepProperties implementation for DockerBuildStep. +func (dbs DockerBuildStep) AsDockerBuildStep() (*DockerBuildStep, bool) { + return &dbs, true +} + +// AsFileTaskStep is the BasicTaskStepProperties implementation for DockerBuildStep. +func (dbs DockerBuildStep) AsFileTaskStep() (*FileTaskStep, bool) { + return nil, false +} + +// AsEncodedTaskStep is the BasicTaskStepProperties implementation for DockerBuildStep. +func (dbs DockerBuildStep) AsEncodedTaskStep() (*EncodedTaskStep, bool) { + return nil, false +} + +// AsTaskStepProperties is the BasicTaskStepProperties implementation for DockerBuildStep. +func (dbs DockerBuildStep) AsTaskStepProperties() (*TaskStepProperties, bool) { + return nil, false +} + +// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for DockerBuildStep. +func (dbs DockerBuildStep) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) { + return &dbs, true +} + +// DockerBuildStepUpdateParameters the properties for updating a docker build step. +type DockerBuildStepUpdateParameters struct { + // ImageNames - The fully qualified image names including the repository and tag. + ImageNames *[]string `json:"imageNames,omitempty"` + // IsPushEnabled - The value of this property indicates whether the image built should be pushed to the registry or not. + IsPushEnabled *bool `json:"isPushEnabled,omitempty"` + // NoCache - The value of this property indicates whether the image cache is enabled or not. + NoCache *bool `json:"noCache,omitempty"` + // DockerFilePath - The Docker file path relative to the source context. + DockerFilePath *string `json:"dockerFilePath,omitempty"` + // Arguments - The collection of override arguments to be used when executing this build step. + Arguments *[]Argument `json:"arguments,omitempty"` + // Target - The name of the target build stage for the docker build. + Target *string `json:"target,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask' + Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for DockerBuildStepUpdateParameters. +func (dbsup DockerBuildStepUpdateParameters) MarshalJSON() ([]byte, error) { + dbsup.Type = TypeBasicTaskStepUpdateParametersTypeDocker + objectMap := make(map[string]interface{}) + if dbsup.ImageNames != nil { + objectMap["imageNames"] = dbsup.ImageNames + } + if dbsup.IsPushEnabled != nil { + objectMap["isPushEnabled"] = dbsup.IsPushEnabled + } + if dbsup.NoCache != nil { + objectMap["noCache"] = dbsup.NoCache + } + if dbsup.DockerFilePath != nil { + objectMap["dockerFilePath"] = dbsup.DockerFilePath + } + if dbsup.Arguments != nil { + objectMap["arguments"] = dbsup.Arguments + } + if dbsup.Target != nil { + objectMap["target"] = dbsup.Target + } + if dbsup.ContextPath != nil { + objectMap["contextPath"] = dbsup.ContextPath + } + if dbsup.ContextAccessToken != nil { + objectMap["contextAccessToken"] = dbsup.ContextAccessToken + } + if dbsup.Type != "" { + objectMap["type"] = dbsup.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters. +func (dbsup DockerBuildStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) { + return &dbsup, true +} + +// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters. +func (dbsup DockerBuildStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) { + return nil, false +} + +// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters. +func (dbsup DockerBuildStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) { + return nil, false +} + +// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters. +func (dbsup DockerBuildStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) { + return nil, false +} + +// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for DockerBuildStepUpdateParameters. +func (dbsup DockerBuildStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) { + return &dbsup, true +} + +// EncodedTaskRunRequest the parameters for a quick task run request. +type EncodedTaskRunRequest struct { + // EncodedTaskContent - Base64 encoded value of the template/definition file content. + EncodedTaskContent *string `json:"encodedTaskContent,omitempty"` + // EncodedValuesContent - Base64 encoded value of the parameters/values file content. + EncodedValuesContent *string `json:"encodedValuesContent,omitempty"` + // Values - The collection of overridable values that can be passed when running a task. + Values *[]SetValue `json:"values,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformProperties `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // SourceLocation - The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + // If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + SourceLocation *string `json:"sourceLocation,omitempty"` + // Credentials - The properties that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // AgentPoolName - The dedicated agent pool for the run. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` + // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) MarshalJSON() ([]byte, error) { + etrr.Type = TypeEncodedTaskRunRequest + objectMap := make(map[string]interface{}) + if etrr.EncodedTaskContent != nil { + objectMap["encodedTaskContent"] = etrr.EncodedTaskContent + } + if etrr.EncodedValuesContent != nil { + objectMap["encodedValuesContent"] = etrr.EncodedValuesContent + } + if etrr.Values != nil { + objectMap["values"] = etrr.Values + } + if etrr.Timeout != nil { + objectMap["timeout"] = etrr.Timeout + } + if etrr.Platform != nil { + objectMap["platform"] = etrr.Platform + } + if etrr.AgentConfiguration != nil { + objectMap["agentConfiguration"] = etrr.AgentConfiguration + } + if etrr.SourceLocation != nil { + objectMap["sourceLocation"] = etrr.SourceLocation + } + if etrr.Credentials != nil { + objectMap["credentials"] = etrr.Credentials + } + if etrr.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = etrr.IsArchiveEnabled + } + if etrr.AgentPoolName != nil { + objectMap["agentPoolName"] = etrr.AgentPoolName + } + if etrr.LogTemplate != nil { + objectMap["logTemplate"] = etrr.LogTemplate + } + if etrr.Type != "" { + objectMap["type"] = etrr.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildRequest is the BasicRunRequest implementation for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { + return nil, false +} + +// AsFileTaskRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { + return nil, false +} + +// AsTaskRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { + return nil, false +} + +// AsEncodedTaskRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { + return &etrr, true +} + +// AsRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) AsRunRequest() (*RunRequest, bool) { + return nil, false +} + +// AsBasicRunRequest is the BasicRunRequest implementation for EncodedTaskRunRequest. +func (etrr EncodedTaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { + return &etrr, true +} + +// EncodedTaskStep the properties of a encoded task step. +type EncodedTaskStep struct { + // EncodedTaskContent - Base64 encoded value of the template/definition file content. + EncodedTaskContent *string `json:"encodedTaskContent,omitempty"` + // EncodedValuesContent - Base64 encoded value of the parameters/values file content. + EncodedValuesContent *string `json:"encodedValuesContent,omitempty"` + // Values - The collection of overridable values that can be passed when running a task. + Values *[]SetValue `json:"values,omitempty"` + // BaseImageDependencies - READ-ONLY; List of base image dependencies for a step. + BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepPropertiesTypeTaskStepProperties', 'TypeBasicTaskStepPropertiesTypeDocker', 'TypeBasicTaskStepPropertiesTypeFileTask', 'TypeBasicTaskStepPropertiesTypeEncodedTask' + Type TypeBasicTaskStepProperties `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EncodedTaskStep. +func (ets EncodedTaskStep) MarshalJSON() ([]byte, error) { + ets.Type = TypeBasicTaskStepPropertiesTypeEncodedTask + objectMap := make(map[string]interface{}) + if ets.EncodedTaskContent != nil { + objectMap["encodedTaskContent"] = ets.EncodedTaskContent + } + if ets.EncodedValuesContent != nil { + objectMap["encodedValuesContent"] = ets.EncodedValuesContent + } + if ets.Values != nil { + objectMap["values"] = ets.Values + } + if ets.ContextPath != nil { + objectMap["contextPath"] = ets.ContextPath + } + if ets.ContextAccessToken != nil { + objectMap["contextAccessToken"] = ets.ContextAccessToken + } + if ets.Type != "" { + objectMap["type"] = ets.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStep is the BasicTaskStepProperties implementation for EncodedTaskStep. +func (ets EncodedTaskStep) AsDockerBuildStep() (*DockerBuildStep, bool) { + return nil, false +} + +// AsFileTaskStep is the BasicTaskStepProperties implementation for EncodedTaskStep. +func (ets EncodedTaskStep) AsFileTaskStep() (*FileTaskStep, bool) { + return nil, false +} + +// AsEncodedTaskStep is the BasicTaskStepProperties implementation for EncodedTaskStep. +func (ets EncodedTaskStep) AsEncodedTaskStep() (*EncodedTaskStep, bool) { + return &ets, true +} + +// AsTaskStepProperties is the BasicTaskStepProperties implementation for EncodedTaskStep. +func (ets EncodedTaskStep) AsTaskStepProperties() (*TaskStepProperties, bool) { + return nil, false +} + +// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for EncodedTaskStep. +func (ets EncodedTaskStep) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) { + return &ets, true +} + +// EncodedTaskStepUpdateParameters the properties for updating encoded task step. +type EncodedTaskStepUpdateParameters struct { + // EncodedTaskContent - Base64 encoded value of the template/definition file content. + EncodedTaskContent *string `json:"encodedTaskContent,omitempty"` + // EncodedValuesContent - Base64 encoded value of the parameters/values file content. + EncodedValuesContent *string `json:"encodedValuesContent,omitempty"` + // Values - The collection of overridable values that can be passed when running a task. + Values *[]SetValue `json:"values,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask' + Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for EncodedTaskStepUpdateParameters. +func (etsup EncodedTaskStepUpdateParameters) MarshalJSON() ([]byte, error) { + etsup.Type = TypeBasicTaskStepUpdateParametersTypeEncodedTask + objectMap := make(map[string]interface{}) + if etsup.EncodedTaskContent != nil { + objectMap["encodedTaskContent"] = etsup.EncodedTaskContent + } + if etsup.EncodedValuesContent != nil { + objectMap["encodedValuesContent"] = etsup.EncodedValuesContent + } + if etsup.Values != nil { + objectMap["values"] = etsup.Values + } + if etsup.ContextPath != nil { + objectMap["contextPath"] = etsup.ContextPath + } + if etsup.ContextAccessToken != nil { + objectMap["contextAccessToken"] = etsup.ContextAccessToken + } + if etsup.Type != "" { + objectMap["type"] = etsup.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters. +func (etsup EncodedTaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) { + return nil, false +} + +// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters. +func (etsup EncodedTaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) { + return nil, false +} + +// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters. +func (etsup EncodedTaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) { + return &etsup, true +} + +// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters. +func (etsup EncodedTaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) { + return nil, false +} + +// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for EncodedTaskStepUpdateParameters. +func (etsup EncodedTaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) { + return &etsup, true +} + +// EncryptionProperty ... +type EncryptionProperty struct { + // Status - Indicates whether or not the encryption is enabled for container registry. Possible values include: 'EncryptionStatusEnabled', 'EncryptionStatusDisabled' + Status EncryptionStatus `json:"status,omitempty"` + // KeyVaultProperties - Key vault properties. + KeyVaultProperties *KeyVaultProperties `json:"keyVaultProperties,omitempty"` +} + +// ErrorResponse an error response from the Azure Container Registry service. +type ErrorResponse struct { + // Error - Azure container registry build API error body. + Error *ErrorResponseBody `json:"error,omitempty"` +} + +// ErrorResponseBody an error response from the Azure Container Registry service. +type ErrorResponseBody struct { + // Code - error code. + Code *string `json:"code,omitempty"` + // Message - error message. + Message *string `json:"message,omitempty"` + // Target - target of the particular error. + Target *string `json:"target,omitempty"` + // Details - an array of additional nested error response info objects, as described by this contract. + Details *[]InnerErrorDescription `json:"details,omitempty"` +} + +// Event the event for a webhook. +type Event struct { + // EventRequestMessage - The event request message sent to the service URI. + EventRequestMessage *EventRequestMessage `json:"eventRequestMessage,omitempty"` + // EventResponseMessage - The event response message received from the service URI. + EventResponseMessage *EventResponseMessage `json:"eventResponseMessage,omitempty"` + // ID - The event ID. + ID *string `json:"id,omitempty"` +} + +// EventContent the content of the event request message. +type EventContent struct { + // ID - The event ID. + ID *string `json:"id,omitempty"` + // Timestamp - The time at which the event occurred. + Timestamp *date.Time `json:"timestamp,omitempty"` + // Action - The action that encompasses the provided event. + Action *string `json:"action,omitempty"` + // Target - The target of the event. + Target *Target `json:"target,omitempty"` + // Request - The request that generated the event. + Request *Request `json:"request,omitempty"` + // Actor - The agent that initiated the event. For most situations, this could be from the authorization context of the request. + Actor *Actor `json:"actor,omitempty"` + // Source - The registry node that generated the event. Put differently, while the actor initiates the event, the source generates it. + Source *Source `json:"source,omitempty"` +} + +// EventInfo the basic information of an event. +type EventInfo struct { + autorest.Response `json:"-"` + // ID - The event ID. + ID *string `json:"id,omitempty"` +} + +// EventListResult the result of a request to list events for a webhook. +type EventListResult struct { + autorest.Response `json:"-"` + // Value - The list of events. Since this list may be incomplete, the nextLink field should be used to request the next list of events. + Value *[]Event `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of events. + NextLink *string `json:"nextLink,omitempty"` +} + +// EventListResultIterator provides access to a complete listing of Event values. +type EventListResultIterator struct { + i int + page EventListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventListResultIterator) Response() EventListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventListResultIterator) Value() Event { + if !iter.page.NotDone() { + return Event{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventListResultIterator type. +func NewEventListResultIterator(page EventListResultPage) EventListResultIterator { + return EventListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (elr EventListResult) IsEmpty() bool { + return elr.Value == nil || len(*elr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (elr EventListResult) hasNextLink() bool { + return elr.NextLink != nil && len(*elr.NextLink) != 0 +} + +// eventListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (elr EventListResult) eventListResultPreparer(ctx context.Context) (*http.Request, error) { + if !elr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(elr.NextLink))) +} + +// EventListResultPage contains a page of Event values. +type EventListResultPage struct { + fn func(context.Context, EventListResult) (EventListResult, error) + elr EventListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.elr) + if err != nil { + return err + } + page.elr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventListResultPage) NotDone() bool { + return !page.elr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventListResultPage) Response() EventListResult { + return page.elr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventListResultPage) Values() []Event { + if page.elr.IsEmpty() { + return nil + } + return *page.elr.Value +} + +// Creates a new instance of the EventListResultPage type. +func NewEventListResultPage(cur EventListResult, getNextPage func(context.Context, EventListResult) (EventListResult, error)) EventListResultPage { + return EventListResultPage{ + fn: getNextPage, + elr: cur, + } +} + +// EventRequestMessage the event request message sent to the service URI. +type EventRequestMessage struct { + // Content - The content of the event request message. + Content *EventContent `json:"content,omitempty"` + // Headers - The headers of the event request message. + Headers map[string]*string `json:"headers"` + // Method - The HTTP method used to send the event request message. + Method *string `json:"method,omitempty"` + // RequestURI - The URI used to send the event request message. + RequestURI *string `json:"requestUri,omitempty"` + // Version - The HTTP message version. + Version *string `json:"version,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventRequestMessage. +func (erm EventRequestMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erm.Content != nil { + objectMap["content"] = erm.Content + } + if erm.Headers != nil { + objectMap["headers"] = erm.Headers + } + if erm.Method != nil { + objectMap["method"] = erm.Method + } + if erm.RequestURI != nil { + objectMap["requestUri"] = erm.RequestURI + } + if erm.Version != nil { + objectMap["version"] = erm.Version + } + return json.Marshal(objectMap) +} + +// EventResponseMessage the event response message received from the service URI. +type EventResponseMessage struct { + // Content - The content of the event response message. + Content *string `json:"content,omitempty"` + // Headers - The headers of the event response message. + Headers map[string]*string `json:"headers"` + // ReasonPhrase - The reason phrase of the event response message. + ReasonPhrase *string `json:"reasonPhrase,omitempty"` + // StatusCode - The status code of the event response message. + StatusCode *string `json:"statusCode,omitempty"` + // Version - The HTTP message version. + Version *string `json:"version,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventResponseMessage. +func (erm EventResponseMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if erm.Content != nil { + objectMap["content"] = erm.Content + } + if erm.Headers != nil { + objectMap["headers"] = erm.Headers + } + if erm.ReasonPhrase != nil { + objectMap["reasonPhrase"] = erm.ReasonPhrase + } + if erm.StatusCode != nil { + objectMap["statusCode"] = erm.StatusCode + } + if erm.Version != nil { + objectMap["version"] = erm.Version + } + return json.Marshal(objectMap) +} + +// ExportPolicy the export policy for a container registry. +type ExportPolicy struct { + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'ExportPolicyStatusEnabled', 'ExportPolicyStatusDisabled' + Status ExportPolicyStatus `json:"status,omitempty"` +} + +// FileTaskRunRequest the request parameters for a scheduling run against a task file. +type FileTaskRunRequest struct { + // TaskFilePath - The template/definition file path relative to the source. + TaskFilePath *string `json:"taskFilePath,omitempty"` + // ValuesFilePath - The values/parameters file path relative to the source. + ValuesFilePath *string `json:"valuesFilePath,omitempty"` + // Values - The collection of overridable values that can be passed when running a task. + Values *[]SetValue `json:"values,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformProperties `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // SourceLocation - The URL(absolute or relative) of the source context. It can be an URL to a tar or git repository. + // If it is relative URL, the relative path should be obtained from calling listBuildSourceUploadUrl API. + SourceLocation *string `json:"sourceLocation,omitempty"` + // Credentials - The properties that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // AgentPoolName - The dedicated agent pool for the run. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` + // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) MarshalJSON() ([]byte, error) { + ftrr.Type = TypeFileTaskRunRequest + objectMap := make(map[string]interface{}) + if ftrr.TaskFilePath != nil { + objectMap["taskFilePath"] = ftrr.TaskFilePath + } + if ftrr.ValuesFilePath != nil { + objectMap["valuesFilePath"] = ftrr.ValuesFilePath + } + if ftrr.Values != nil { + objectMap["values"] = ftrr.Values + } + if ftrr.Timeout != nil { + objectMap["timeout"] = ftrr.Timeout + } + if ftrr.Platform != nil { + objectMap["platform"] = ftrr.Platform + } + if ftrr.AgentConfiguration != nil { + objectMap["agentConfiguration"] = ftrr.AgentConfiguration + } + if ftrr.SourceLocation != nil { + objectMap["sourceLocation"] = ftrr.SourceLocation + } + if ftrr.Credentials != nil { + objectMap["credentials"] = ftrr.Credentials + } + if ftrr.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = ftrr.IsArchiveEnabled + } + if ftrr.AgentPoolName != nil { + objectMap["agentPoolName"] = ftrr.AgentPoolName + } + if ftrr.LogTemplate != nil { + objectMap["logTemplate"] = ftrr.LogTemplate + } + if ftrr.Type != "" { + objectMap["type"] = ftrr.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildRequest is the BasicRunRequest implementation for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { + return nil, false +} + +// AsFileTaskRunRequest is the BasicRunRequest implementation for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { + return &ftrr, true +} + +// AsTaskRunRequest is the BasicRunRequest implementation for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { + return nil, false +} + +// AsEncodedTaskRunRequest is the BasicRunRequest implementation for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { + return nil, false +} + +// AsRunRequest is the BasicRunRequest implementation for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) AsRunRequest() (*RunRequest, bool) { + return nil, false +} + +// AsBasicRunRequest is the BasicRunRequest implementation for FileTaskRunRequest. +func (ftrr FileTaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { + return &ftrr, true +} + +// FileTaskStep the properties of a task step. +type FileTaskStep struct { + // TaskFilePath - The task template/definition file path relative to the source context. + TaskFilePath *string `json:"taskFilePath,omitempty"` + // ValuesFilePath - The task values/parameters file path relative to the source context. + ValuesFilePath *string `json:"valuesFilePath,omitempty"` + // Values - The collection of overridable values that can be passed when running a task. + Values *[]SetValue `json:"values,omitempty"` + // BaseImageDependencies - READ-ONLY; List of base image dependencies for a step. + BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepPropertiesTypeTaskStepProperties', 'TypeBasicTaskStepPropertiesTypeDocker', 'TypeBasicTaskStepPropertiesTypeFileTask', 'TypeBasicTaskStepPropertiesTypeEncodedTask' + Type TypeBasicTaskStepProperties `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileTaskStep. +func (fts FileTaskStep) MarshalJSON() ([]byte, error) { + fts.Type = TypeBasicTaskStepPropertiesTypeFileTask + objectMap := make(map[string]interface{}) + if fts.TaskFilePath != nil { + objectMap["taskFilePath"] = fts.TaskFilePath + } + if fts.ValuesFilePath != nil { + objectMap["valuesFilePath"] = fts.ValuesFilePath + } + if fts.Values != nil { + objectMap["values"] = fts.Values + } + if fts.ContextPath != nil { + objectMap["contextPath"] = fts.ContextPath + } + if fts.ContextAccessToken != nil { + objectMap["contextAccessToken"] = fts.ContextAccessToken + } + if fts.Type != "" { + objectMap["type"] = fts.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStep is the BasicTaskStepProperties implementation for FileTaskStep. +func (fts FileTaskStep) AsDockerBuildStep() (*DockerBuildStep, bool) { + return nil, false +} + +// AsFileTaskStep is the BasicTaskStepProperties implementation for FileTaskStep. +func (fts FileTaskStep) AsFileTaskStep() (*FileTaskStep, bool) { + return &fts, true +} + +// AsEncodedTaskStep is the BasicTaskStepProperties implementation for FileTaskStep. +func (fts FileTaskStep) AsEncodedTaskStep() (*EncodedTaskStep, bool) { + return nil, false +} + +// AsTaskStepProperties is the BasicTaskStepProperties implementation for FileTaskStep. +func (fts FileTaskStep) AsTaskStepProperties() (*TaskStepProperties, bool) { + return nil, false +} + +// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for FileTaskStep. +func (fts FileTaskStep) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) { + return &fts, true +} + +// FileTaskStepUpdateParameters the properties of updating a task step. +type FileTaskStepUpdateParameters struct { + // TaskFilePath - The task template/definition file path relative to the source context. + TaskFilePath *string `json:"taskFilePath,omitempty"` + // ValuesFilePath - The values/parameters file path relative to the source context. + ValuesFilePath *string `json:"valuesFilePath,omitempty"` + // Values - The collection of overridable values that can be passed when running a task. + Values *[]SetValue `json:"values,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask' + Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FileTaskStepUpdateParameters. +func (ftsup FileTaskStepUpdateParameters) MarshalJSON() ([]byte, error) { + ftsup.Type = TypeBasicTaskStepUpdateParametersTypeFileTask + objectMap := make(map[string]interface{}) + if ftsup.TaskFilePath != nil { + objectMap["taskFilePath"] = ftsup.TaskFilePath + } + if ftsup.ValuesFilePath != nil { + objectMap["valuesFilePath"] = ftsup.ValuesFilePath + } + if ftsup.Values != nil { + objectMap["values"] = ftsup.Values + } + if ftsup.ContextPath != nil { + objectMap["contextPath"] = ftsup.ContextPath + } + if ftsup.ContextAccessToken != nil { + objectMap["contextAccessToken"] = ftsup.ContextAccessToken + } + if ftsup.Type != "" { + objectMap["type"] = ftsup.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters. +func (ftsup FileTaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) { + return nil, false +} + +// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters. +func (ftsup FileTaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) { + return &ftsup, true +} + +// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters. +func (ftsup FileTaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) { + return nil, false +} + +// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters. +func (ftsup FileTaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) { + return nil, false +} + +// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for FileTaskStepUpdateParameters. +func (ftsup FileTaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) { + return &ftsup, true +} + +// IdentityProperties managed identity for the resource. +type IdentityProperties struct { + // PrincipalID - The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + // UserAssignedIdentities - The list of user identities associated with the resource. The user identity + // dictionary key references will be ARM resource ids in the form: + // '/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/ + // providers/Microsoft.ManagedIdentity/userAssignedIdentities/{identityName}'. + UserAssignedIdentities map[string]*UserIdentityProperties `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for IdentityProperties. +func (IP IdentityProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.PrincipalID != nil { + objectMap["principalId"] = IP.PrincipalID + } + if IP.TenantID != nil { + objectMap["tenantId"] = IP.TenantID + } + if IP.Type != "" { + objectMap["type"] = IP.Type + } + if IP.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = IP.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ImageDescriptor properties for a registry image. +type ImageDescriptor struct { + // Registry - The registry login server. + Registry *string `json:"registry,omitempty"` + // Repository - The repository name. + Repository *string `json:"repository,omitempty"` + // Tag - The tag name. + Tag *string `json:"tag,omitempty"` + // Digest - The sha256-based digest of the image manifest. + Digest *string `json:"digest,omitempty"` +} + +// ImageUpdateTrigger the image update trigger that caused a build. +type ImageUpdateTrigger struct { + // ID - The unique ID of the trigger. + ID *string `json:"id,omitempty"` + // Timestamp - The timestamp when the image update happened. + Timestamp *date.Time `json:"timestamp,omitempty"` + // Images - The list of image updates that caused the build. + Images *[]ImageDescriptor `json:"images,omitempty"` +} + +// ImportImageParameters ... +type ImportImageParameters struct { + // Source - The source of the image. + Source *ImportSource `json:"source,omitempty"` + // TargetTags - List of strings of the form repo[:tag]. When tag is omitted the source will be used (or 'latest' if source tag is also omitted). + TargetTags *[]string `json:"targetTags,omitempty"` + // UntaggedTargetRepositories - List of strings of repository names to do a manifest only copy. No tag will be created. + UntaggedTargetRepositories *[]string `json:"untaggedTargetRepositories,omitempty"` + // Mode - When Force, any existing target tags will be overwritten. When NoForce, any existing target tags will fail the operation before any copying begins. Possible values include: 'ImportModeNoForce', 'ImportModeForce' + Mode ImportMode `json:"mode,omitempty"` +} + +// ImportSource ... +type ImportSource struct { + // ResourceID - The resource identifier of the source Azure Container Registry. + ResourceID *string `json:"resourceId,omitempty"` + // RegistryURI - The address of the source registry (e.g. 'mcr.microsoft.com'). + RegistryURI *string `json:"registryUri,omitempty"` + // Credentials - Credentials used when importing from a registry uri. + Credentials *ImportSourceCredentials `json:"credentials,omitempty"` + // SourceImage - Repository name of the source image. + // Specify an image by repository ('hello-world'). This will use the 'latest' tag. + // Specify an image by tag ('hello-world:latest'). + // Specify an image by sha256-based manifest digest ('hello-world@sha256:abc123'). + SourceImage *string `json:"sourceImage,omitempty"` +} + +// ImportSourceCredentials ... +type ImportSourceCredentials struct { + // Username - The username to authenticate with the source registry. + Username *string `json:"username,omitempty"` + // Password - The password used to authenticate with the source registry. + Password *string `json:"password,omitempty"` +} + +// InnerErrorDescription inner error. +type InnerErrorDescription struct { + // Code - error code. + Code *string `json:"code,omitempty"` + // Message - error message. + Message *string `json:"message,omitempty"` + // Target - target of the particular error. + Target *string `json:"target,omitempty"` +} + +// IPRule IP rule with specific IP or IP range in CIDR format. +type IPRule struct { + // Action - The action of IP ACL rule. Possible values include: 'ActionAllow' + Action Action `json:"action,omitempty"` + // IPAddressOrRange - Specifies the IP or IP range in CIDR format. Only IPV4 address is allowed. + IPAddressOrRange *string `json:"value,omitempty"` +} + +// KeyVaultProperties ... +type KeyVaultProperties struct { + // KeyIdentifier - Key vault uri to access the encryption key. + KeyIdentifier *string `json:"keyIdentifier,omitempty"` + // VersionedKeyIdentifier - READ-ONLY; The fully qualified key identifier that includes the version of the key that is actually used for encryption. + VersionedKeyIdentifier *string `json:"versionedKeyIdentifier,omitempty"` + // Identity - The client id of the identity which will be used to access key vault. + Identity *string `json:"identity,omitempty"` + // KeyRotationEnabled - READ-ONLY; Auto key rotation status for a CMK enabled registry. + KeyRotationEnabled *bool `json:"keyRotationEnabled,omitempty"` + // LastKeyRotationTimestamp - READ-ONLY; Timestamp of the last successful key rotation. + LastKeyRotationTimestamp *date.Time `json:"lastKeyRotationTimestamp,omitempty"` +} + +// MarshalJSON is the custom marshaler for KeyVaultProperties. +func (kvp KeyVaultProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if kvp.KeyIdentifier != nil { + objectMap["keyIdentifier"] = kvp.KeyIdentifier + } + if kvp.Identity != nil { + objectMap["identity"] = kvp.Identity + } + return json.Marshal(objectMap) +} + +// NetworkRuleSet the network rule set for a container registry. +type NetworkRuleSet struct { + // DefaultAction - The default action of allow or deny when no other rules match. Possible values include: 'DefaultActionAllow', 'DefaultActionDeny' + DefaultAction DefaultAction `json:"defaultAction,omitempty"` + // IPRules - The IP ACL rules. + IPRules *[]IPRule `json:"ipRules,omitempty"` +} + +// OperationDefinition the definition of a container registry operation. +type OperationDefinition struct { + // Origin - The origin information of the container registry operation. + Origin *string `json:"origin,omitempty"` + // Name - Operation name: {provider}/{resource}/{operation}. + Name *string `json:"name,omitempty"` + // Display - The display information for the container registry operation. + Display *OperationDisplayDefinition `json:"display,omitempty"` + // OperationPropertiesDefinition - The properties information for the container registry operation. + *OperationPropertiesDefinition `json:"properties,omitempty"` + // IsDataAction - This property indicates if the operation is an action or a data action + // ref: https://docs.microsoft.com/en-us/azure/role-based-access-control/role-definitions#management-and-data-operations + IsDataAction *bool `json:"isDataAction,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDefinition. +func (od OperationDefinition) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if od.Origin != nil { + objectMap["origin"] = od.Origin + } + if od.Name != nil { + objectMap["name"] = od.Name + } + if od.Display != nil { + objectMap["display"] = od.Display + } + if od.OperationPropertiesDefinition != nil { + objectMap["properties"] = od.OperationPropertiesDefinition + } + if od.IsDataAction != nil { + objectMap["isDataAction"] = od.IsDataAction + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for OperationDefinition struct. +func (od *OperationDefinition) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "origin": + if v != nil { + var origin string + err = json.Unmarshal(*v, &origin) + if err != nil { + return err + } + od.Origin = &origin + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + od.Name = &name + } + case "display": + if v != nil { + var display OperationDisplayDefinition + err = json.Unmarshal(*v, &display) + if err != nil { + return err + } + od.Display = &display + } + case "properties": + if v != nil { + var operationPropertiesDefinition OperationPropertiesDefinition + err = json.Unmarshal(*v, &operationPropertiesDefinition) + if err != nil { + return err + } + od.OperationPropertiesDefinition = &operationPropertiesDefinition + } + case "isDataAction": + if v != nil { + var isDataAction bool + err = json.Unmarshal(*v, &isDataAction) + if err != nil { + return err + } + od.IsDataAction = &isDataAction + } + } + } + + return nil +} + +// OperationDisplayDefinition the display information for a container registry operation. +type OperationDisplayDefinition struct { + // Provider - The resource provider name: Microsoft.ContainerRegistry. + Provider *string `json:"provider,omitempty"` + // Resource - The resource on which the operation is performed. + Resource *string `json:"resource,omitempty"` + // Operation - The operation that users can perform. + Operation *string `json:"operation,omitempty"` + // Description - The description for the operation. + Description *string `json:"description,omitempty"` +} + +// OperationListResult the result of a request to list container registry operations. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - The list of container registry operations. Since this list may be incomplete, the nextLink field should be used to request the next list of operations. + Value *[]OperationDefinition `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of container registry operations. + NextLink *string `json:"nextLink,omitempty"` +} + +// OperationListResultIterator provides access to a complete listing of OperationDefinition values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() OperationDefinition { + if !iter.page.NotDone() { + return OperationDefinition{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of OperationDefinition values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []OperationDefinition { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// OperationLogSpecificationDefinition the definition of Azure Monitoring log. +type OperationLogSpecificationDefinition struct { + // Name - Log name. + Name *string `json:"name,omitempty"` + // DisplayName - Log display name. + DisplayName *string `json:"displayName,omitempty"` + // BlobDuration - Log blob duration. + BlobDuration *string `json:"blobDuration,omitempty"` +} + +// OperationMetricSpecificationDefinition the definition of Azure Monitoring metric. +type OperationMetricSpecificationDefinition struct { + // Name - Metric name. + Name *string `json:"name,omitempty"` + // DisplayName - Metric display name. + DisplayName *string `json:"displayName,omitempty"` + // DisplayDescription - Metric description. + DisplayDescription *string `json:"displayDescription,omitempty"` + // Unit - Metric unit. + Unit *string `json:"unit,omitempty"` + // AggregationType - Metric aggregation type. + AggregationType *string `json:"aggregationType,omitempty"` + // InternalMetricName - Internal metric name. + InternalMetricName *string `json:"internalMetricName,omitempty"` +} + +// OperationPropertiesDefinition the definition of Azure Monitoring properties. +type OperationPropertiesDefinition struct { + // ServiceSpecification - The definition of Azure Monitoring service. + ServiceSpecification *OperationServiceSpecificationDefinition `json:"serviceSpecification,omitempty"` +} + +// OperationServiceSpecificationDefinition the definition of Azure Monitoring list. +type OperationServiceSpecificationDefinition struct { + // MetricSpecifications - A list of Azure Monitoring metrics definition. + MetricSpecifications *[]OperationMetricSpecificationDefinition `json:"metricSpecifications,omitempty"` + // LogSpecifications - A list of Azure Monitoring log definitions. + LogSpecifications *[]OperationLogSpecificationDefinition `json:"logSpecifications,omitempty"` +} + +// OverrideTaskStepProperties ... +type OverrideTaskStepProperties struct { + // ContextPath - The source context against which run has to be queued. + ContextPath *string `json:"contextPath,omitempty"` + // File - The file against which run has to be queued. + File *string `json:"file,omitempty"` + // Arguments - Gets or sets the collection of override arguments to be used when + // executing a build step. + Arguments *[]Argument `json:"arguments,omitempty"` + // Target - The name of the target build stage for the docker build. + Target *string `json:"target,omitempty"` + // Values - The collection of overridable values that can be passed when running a Task. + Values *[]SetValue `json:"values,omitempty"` + // UpdateTriggerToken - Base64 encoded update trigger token that will be attached with the base image trigger webhook. + UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"` +} + +// PackageType the properties of a package type. +type PackageType struct { + // Name - The name of the package type. + Name *string `json:"name,omitempty"` + // Endpoint - READ-ONLY; The endpoint of the package type. + Endpoint *string `json:"endpoint,omitempty"` +} + +// MarshalJSON is the custom marshaler for PackageType. +func (pt PackageType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pt.Name != nil { + objectMap["name"] = pt.Name + } + return json.Marshal(objectMap) +} + +// PlatformProperties the platform properties against which the run has to happen. +type PlatformProperties struct { + // Os - The operating system type required for the run. Possible values include: 'OSWindows', 'OSLinux' + Os OS `json:"os,omitempty"` + // Architecture - The OS architecture. Possible values include: 'ArchitectureAmd64', 'ArchitectureX86', 'ArchitectureThreeEightSix', 'ArchitectureArm', 'ArchitectureArm64' + Architecture Architecture `json:"architecture,omitempty"` + // Variant - Variant of the CPU. Possible values include: 'VariantV6', 'VariantV7', 'VariantV8' + Variant Variant `json:"variant,omitempty"` +} + +// PlatformUpdateParameters the properties for updating the platform configuration. +type PlatformUpdateParameters struct { + // Os - The operating system type required for the run. Possible values include: 'OSWindows', 'OSLinux' + Os OS `json:"os,omitempty"` + // Architecture - The OS architecture. Possible values include: 'ArchitectureAmd64', 'ArchitectureX86', 'ArchitectureThreeEightSix', 'ArchitectureArm', 'ArchitectureArm64' + Architecture Architecture `json:"architecture,omitempty"` + // Variant - Variant of the CPU. Possible values include: 'VariantV6', 'VariantV7', 'VariantV8' + Variant Variant `json:"variant,omitempty"` +} + +// Policies the policies for a container registry. +type Policies struct { + // QuarantinePolicy - The quarantine policy for a container registry. + QuarantinePolicy *QuarantinePolicy `json:"quarantinePolicy,omitempty"` + // TrustPolicy - The content trust policy for a container registry. + TrustPolicy *TrustPolicy `json:"trustPolicy,omitempty"` + // RetentionPolicy - The retention policy for a container registry. + RetentionPolicy *RetentionPolicy `json:"retentionPolicy,omitempty"` + // ExportPolicy - The export policy for a container registry. + ExportPolicy *ExportPolicy `json:"exportPolicy,omitempty"` +} + +// PrivateEndpoint the Private Endpoint resource. +type PrivateEndpoint struct { + // ID - This is private endpoint resource created with Microsoft.Network resource provider. + ID *string `json:"id,omitempty"` +} + +// PrivateEndpointConnection an object that represents a private endpoint connection for a container +// registry. +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // PrivateEndpointConnectionProperties - The properties of a private endpoint connection. + *PrivateEndpointConnectionProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.PrivateEndpointConnectionProperties != nil { + objectMap["properties"] = pec.PrivateEndpointConnectionProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateEndpointConnection struct. +func (pec *PrivateEndpointConnection) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var privateEndpointConnectionProperties PrivateEndpointConnectionProperties + err = json.Unmarshal(*v, &privateEndpointConnectionProperties) + if err != nil { + return err + } + pec.PrivateEndpointConnectionProperties = &privateEndpointConnectionProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + pec.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + pec.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + pec.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + pec.SystemData = &systemData + } + } + } + + return nil +} + +// PrivateEndpointConnectionListResult the result of a request to list private endpoint connections for a +// container registry. +type PrivateEndpointConnectionListResult struct { + autorest.Response `json:"-"` + // Value - The list of private endpoint connections. Since this list may be incomplete, the nextLink field should be used to request the next list of private endpoint connections. + Value *[]PrivateEndpointConnection `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of private endpoint connections. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateEndpointConnectionListResultIterator provides access to a complete listing of +// PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultIterator struct { + i int + page PrivateEndpointConnectionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PrivateEndpointConnectionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateEndpointConnectionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateEndpointConnectionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PrivateEndpointConnectionListResultIterator) Response() PrivateEndpointConnectionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PrivateEndpointConnectionListResultIterator) Value() PrivateEndpointConnection { + if !iter.page.NotDone() { + return PrivateEndpointConnection{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateEndpointConnectionListResultIterator type. +func NewPrivateEndpointConnectionListResultIterator(page PrivateEndpointConnectionListResultPage) PrivateEndpointConnectionListResultIterator { + return PrivateEndpointConnectionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (peclr PrivateEndpointConnectionListResult) IsEmpty() bool { + return peclr.Value == nil || len(*peclr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (peclr PrivateEndpointConnectionListResult) hasNextLink() bool { + return peclr.NextLink != nil && len(*peclr.NextLink) != 0 +} + +// privateEndpointConnectionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (peclr PrivateEndpointConnectionListResult) privateEndpointConnectionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !peclr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(peclr.NextLink))) +} + +// PrivateEndpointConnectionListResultPage contains a page of PrivateEndpointConnection values. +type PrivateEndpointConnectionListResultPage struct { + fn func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error) + peclr PrivateEndpointConnectionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PrivateEndpointConnectionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.peclr) + if err != nil { + return err + } + page.peclr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateEndpointConnectionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateEndpointConnectionListResultPage) NotDone() bool { + return !page.peclr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateEndpointConnectionListResultPage) Response() PrivateEndpointConnectionListResult { + return page.peclr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateEndpointConnectionListResultPage) Values() []PrivateEndpointConnection { + if page.peclr.IsEmpty() { + return nil + } + return *page.peclr.Value +} + +// Creates a new instance of the PrivateEndpointConnectionListResultPage type. +func NewPrivateEndpointConnectionListResultPage(cur PrivateEndpointConnectionListResult, getNextPage func(context.Context, PrivateEndpointConnectionListResult) (PrivateEndpointConnectionListResult, error)) PrivateEndpointConnectionListResultPage { + return PrivateEndpointConnectionListResultPage{ + fn: getNextPage, + peclr: cur, + } +} + +// PrivateEndpointConnectionProperties the properties of a private endpoint connection. +type PrivateEndpointConnectionProperties struct { + // PrivateEndpoint - The resource of private endpoint. + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + // PrivateLinkServiceConnectionState - A collection of information about the state of the connection between service consumer and provider. + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of private endpoint connection resource. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnectionProperties. +func (pecp PrivateEndpointConnectionProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pecp.PrivateEndpoint != nil { + objectMap["privateEndpoint"] = pecp.PrivateEndpoint + } + if pecp.PrivateLinkServiceConnectionState != nil { + objectMap["privateLinkServiceConnectionState"] = pecp.PrivateLinkServiceConnectionState + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results +// of a long-running operation. +type PrivateEndpointConnectionsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsCreateOrUpdateFuture.Result. +func (future *PrivateEndpointConnectionsCreateOrUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.CreateOrUpdateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsCreateOrUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.PrivateEndpointConnectionsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// PrivateLinkResource a resource that supports private link capabilities. +type PrivateLinkResource struct { + autorest.Response `json:"-"` + // Type - READ-ONLY; The resource type is private link resource. + Type *string `json:"type,omitempty"` + // ID - The resource ID. + ID *string `json:"id,omitempty"` + // Name - The name of the resource. + Name *string `json:"name,omitempty"` + // PrivateLinkResourceProperties - A resource that supports private link capabilities. + *PrivateLinkResourceProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateLinkResource. +func (plr PrivateLinkResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if plr.ID != nil { + objectMap["id"] = plr.ID + } + if plr.Name != nil { + objectMap["name"] = plr.Name + } + if plr.PrivateLinkResourceProperties != nil { + objectMap["properties"] = plr.PrivateLinkResourceProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for PrivateLinkResource struct. +func (plr *PrivateLinkResource) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + plr.Type = &typeVar + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + plr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + plr.Name = &name + } + case "properties": + if v != nil { + var privateLinkResourceProperties PrivateLinkResourceProperties + err = json.Unmarshal(*v, &privateLinkResourceProperties) + if err != nil { + return err + } + plr.PrivateLinkResourceProperties = &privateLinkResourceProperties + } + } + } + + return nil +} + +// PrivateLinkResourceListResult the result of a request to list private link resources for a container +// registry. +type PrivateLinkResourceListResult struct { + autorest.Response `json:"-"` + // Value - The list of private link resources. Since this list may be incomplete, the nextLink field should be used to request the next list of private link resources. + Value *[]PrivateLinkResource `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of private link resources. + NextLink *string `json:"nextLink,omitempty"` +} + +// PrivateLinkResourceListResultIterator provides access to a complete listing of PrivateLinkResource +// values. +type PrivateLinkResourceListResultIterator struct { + i int + page PrivateLinkResourceListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PrivateLinkResourceListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PrivateLinkResourceListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PrivateLinkResourceListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PrivateLinkResourceListResultIterator) Response() PrivateLinkResourceListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PrivateLinkResourceListResultIterator) Value() PrivateLinkResource { + if !iter.page.NotDone() { + return PrivateLinkResource{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PrivateLinkResourceListResultIterator type. +func NewPrivateLinkResourceListResultIterator(page PrivateLinkResourceListResultPage) PrivateLinkResourceListResultIterator { + return PrivateLinkResourceListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plrlr PrivateLinkResourceListResult) IsEmpty() bool { + return plrlr.Value == nil || len(*plrlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plrlr PrivateLinkResourceListResult) hasNextLink() bool { + return plrlr.NextLink != nil && len(*plrlr.NextLink) != 0 +} + +// privateLinkResourceListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plrlr PrivateLinkResourceListResult) privateLinkResourceListResultPreparer(ctx context.Context) (*http.Request, error) { + if !plrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plrlr.NextLink))) +} + +// PrivateLinkResourceListResultPage contains a page of PrivateLinkResource values. +type PrivateLinkResourceListResultPage struct { + fn func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error) + plrlr PrivateLinkResourceListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PrivateLinkResourceListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourceListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plrlr) + if err != nil { + return err + } + page.plrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PrivateLinkResourceListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PrivateLinkResourceListResultPage) NotDone() bool { + return !page.plrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PrivateLinkResourceListResultPage) Response() PrivateLinkResourceListResult { + return page.plrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PrivateLinkResourceListResultPage) Values() []PrivateLinkResource { + if page.plrlr.IsEmpty() { + return nil + } + return *page.plrlr.Value +} + +// Creates a new instance of the PrivateLinkResourceListResultPage type. +func NewPrivateLinkResourceListResultPage(cur PrivateLinkResourceListResult, getNextPage func(context.Context, PrivateLinkResourceListResult) (PrivateLinkResourceListResult, error)) PrivateLinkResourceListResultPage { + return PrivateLinkResourceListResultPage{ + fn: getNextPage, + plrlr: cur, + } +} + +// PrivateLinkResourceProperties the properties of a private link resource. +type PrivateLinkResourceProperties struct { + // GroupID - The private link resource group id. + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - The private link resource required member names. + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The private link resource Private link DNS zone name. + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// PrivateLinkServiceConnectionState the state of a private link service connection. +type PrivateLinkServiceConnectionState struct { + // Status - The private link service connection status. Possible values include: 'ConnectionStatusApproved', 'ConnectionStatusPending', 'ConnectionStatusRejected', 'ConnectionStatusDisconnected' + Status ConnectionStatus `json:"status,omitempty"` + // Description - The description for connection status. For example if connection is rejected it can indicate reason for rejection. + Description *string `json:"description,omitempty"` + // ActionsRequired - A message indicating if changes on the service provider require any updates on the consumer. Possible values include: 'ActionsRequiredNone', 'ActionsRequiredRecreate' + ActionsRequired ActionsRequired `json:"actionsRequired,omitempty"` +} + +// ProxyResource the resource model definition for a ARM proxy resource. It will have everything other than +// required location and tags. +type ProxyResource struct { + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// QuarantinePolicy the quarantine policy for a container registry. +type QuarantinePolicy struct { + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` +} + +// RegenerateCredentialParameters the parameters used to regenerate the login credential. +type RegenerateCredentialParameters struct { + // Name - Specifies name of the password which should be regenerated -- password or password2. Possible values include: 'PasswordNamePassword', 'PasswordNamePassword2' + Name PasswordName `json:"name,omitempty"` +} + +// RegistriesCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (Registry, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesCreateFuture.Result. +func (future *RegistriesCreateFuture) result(client RegistriesClient) (r Registry, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + r.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.CreateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesCreateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// RegistriesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesDeleteFuture.Result. +func (future *RegistriesDeleteFuture) result(client RegistriesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// RegistriesImportImageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesImportImageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesImportImageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesImportImageFuture.Result. +func (future *RegistriesImportImageFuture) result(client RegistriesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesImportImageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesImportImageFuture") + return + } + ar.Response = future.Response() + return +} + +// RegistriesScheduleRunFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesScheduleRunFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (Run, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesScheduleRunFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesScheduleRunFuture.Result. +func (future *RegistriesScheduleRunFuture) result(client RegistriesClient) (r Run, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesScheduleRunFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + r.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesScheduleRunFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.ScheduleRunResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesScheduleRunFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// RegistriesUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type RegistriesUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RegistriesClient) (Registry, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RegistriesUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RegistriesUpdateFuture.Result. +func (future *RegistriesUpdateFuture) result(client RegistriesClient) (r Registry, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + r.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RegistriesUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.UpdateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesUpdateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// Registry an object that represents a container registry. +type Registry struct { + autorest.Response `json:"-"` + // Sku - The SKU of the container registry. + Sku *Sku `json:"sku,omitempty"` + // Identity - The identity of the container registry. + Identity *IdentityProperties `json:"identity,omitempty"` + // RegistryProperties - The properties of the container registry. + *RegistryProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Registry. +func (r Registry) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Sku != nil { + objectMap["sku"] = r.Sku + } + if r.Identity != nil { + objectMap["identity"] = r.Identity + } + if r.RegistryProperties != nil { + objectMap["properties"] = r.RegistryProperties + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Registry struct. +func (r *Registry) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + r.Sku = &sku + } + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + r.Identity = &identity + } + case "properties": + if v != nil { + var registryProperties RegistryProperties + err = json.Unmarshal(*v, ®istryProperties) + if err != nil { + return err + } + r.RegistryProperties = ®istryProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + r.SystemData = &systemData + } + } + } + + return nil +} + +// RegistryListCredentialsResult the response from the ListCredentials operation. +type RegistryListCredentialsResult struct { + autorest.Response `json:"-"` + // Username - The username for a container registry. + Username *string `json:"username,omitempty"` + // Passwords - The list of passwords for a container registry. + Passwords *[]RegistryPassword `json:"passwords,omitempty"` +} + +// RegistryListResult the result of a request to list container registries. +type RegistryListResult struct { + autorest.Response `json:"-"` + // Value - The list of container registries. Since this list may be incomplete, the nextLink field should be used to request the next list of container registries. + Value *[]Registry `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of container registries. + NextLink *string `json:"nextLink,omitempty"` +} + +// RegistryListResultIterator provides access to a complete listing of Registry values. +type RegistryListResultIterator struct { + i int + page RegistryListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RegistryListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistryListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RegistryListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RegistryListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RegistryListResultIterator) Response() RegistryListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RegistryListResultIterator) Value() Registry { + if !iter.page.NotDone() { + return Registry{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RegistryListResultIterator type. +func NewRegistryListResultIterator(page RegistryListResultPage) RegistryListResultIterator { + return RegistryListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RegistryListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rlr RegistryListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + +// registryListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RegistryListResult) registryListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RegistryListResultPage contains a page of Registry values. +type RegistryListResultPage struct { + fn func(context.Context, RegistryListResult) (RegistryListResult, error) + rlr RegistryListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RegistryListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistryListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RegistryListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RegistryListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RegistryListResultPage) Response() RegistryListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RegistryListResultPage) Values() []Registry { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the RegistryListResultPage type. +func NewRegistryListResultPage(cur RegistryListResult, getNextPage func(context.Context, RegistryListResult) (RegistryListResult, error)) RegistryListResultPage { + return RegistryListResultPage{ + fn: getNextPage, + rlr: cur, + } +} + +// RegistryNameCheckRequest a request to check whether a container registry name is available. +type RegistryNameCheckRequest struct { + // Name - The name of the container registry. + Name *string `json:"name,omitempty"` + // Type - The resource type of the container registry. This field must be set to 'Microsoft.ContainerRegistry/registries'. + Type *string `json:"type,omitempty"` +} + +// RegistryNameStatus the result of a request to check the availability of a container registry name. +type RegistryNameStatus struct { + autorest.Response `json:"-"` + // NameAvailable - The value that indicates whether the name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - If any, the reason that the name is not available. + Reason *string `json:"reason,omitempty"` + // Message - If any, the error message that provides more detail for the reason that the name is not available. + Message *string `json:"message,omitempty"` +} + +// RegistryPassword the login password for the container registry. +type RegistryPassword struct { + // Name - The password name. Possible values include: 'PasswordNamePassword', 'PasswordNamePassword2' + Name PasswordName `json:"name,omitempty"` + // Value - The password value. + Value *string `json:"value,omitempty"` +} + +// RegistryProperties the properties of a container registry. +type RegistryProperties struct { + // LoginServer - READ-ONLY; The URL that can be used to log into the container registry. + LoginServer *string `json:"loginServer,omitempty"` + // CreationDate - READ-ONLY; The creation date of the container registry in ISO8601 format. + CreationDate *date.Time `json:"creationDate,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the container registry at the time the operation was called. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; The status of the container registry at the time the operation was called. + Status *Status `json:"status,omitempty"` + // AdminUserEnabled - The value that indicates whether the admin user is enabled. + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + // NetworkRuleSet - The network rule set for a container registry. + NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + // Policies - The policies for a container registry. + Policies *Policies `json:"policies,omitempty"` + // Encryption - The encryption settings of container registry. + Encryption *EncryptionProperty `json:"encryption,omitempty"` + // DataEndpointEnabled - Enable a single data endpoint per region for serving data. + DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` + // DataEndpointHostNames - READ-ONLY; List of host names that will serve data when dataEndpointEnabled is true. + DataEndpointHostNames *[]string `json:"dataEndpointHostNames,omitempty"` + // PrivateEndpointConnections - READ-ONLY; List of private endpoint connections for a container registry. + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // PublicNetworkAccess - Whether or not public network access is allowed for the container registry. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // NetworkRuleBypassOptions - Whether to allow trusted Azure services to access a network restricted registry. Possible values include: 'NetworkRuleBypassOptionsAzureServices', 'NetworkRuleBypassOptionsNone' + NetworkRuleBypassOptions NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` + // ZoneRedundancy - Whether or not zone redundancy is enabled for this container registry. Possible values include: 'ZoneRedundancyEnabled', 'ZoneRedundancyDisabled' + ZoneRedundancy ZoneRedundancy `json:"zoneRedundancy,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegistryProperties. +func (rp RegistryProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.AdminUserEnabled != nil { + objectMap["adminUserEnabled"] = rp.AdminUserEnabled + } + if rp.NetworkRuleSet != nil { + objectMap["networkRuleSet"] = rp.NetworkRuleSet + } + if rp.Policies != nil { + objectMap["policies"] = rp.Policies + } + if rp.Encryption != nil { + objectMap["encryption"] = rp.Encryption + } + if rp.DataEndpointEnabled != nil { + objectMap["dataEndpointEnabled"] = rp.DataEndpointEnabled + } + if rp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = rp.PublicNetworkAccess + } + if rp.NetworkRuleBypassOptions != "" { + objectMap["networkRuleBypassOptions"] = rp.NetworkRuleBypassOptions + } + if rp.ZoneRedundancy != "" { + objectMap["zoneRedundancy"] = rp.ZoneRedundancy + } + return json.Marshal(objectMap) +} + +// RegistryPropertiesUpdateParameters the parameters for updating the properties of a container registry. +type RegistryPropertiesUpdateParameters struct { + // AdminUserEnabled - The value that indicates whether the admin user is enabled. + AdminUserEnabled *bool `json:"adminUserEnabled,omitempty"` + // NetworkRuleSet - The network rule set for a container registry. + NetworkRuleSet *NetworkRuleSet `json:"networkRuleSet,omitempty"` + // Policies - The policies for a container registry. + Policies *Policies `json:"policies,omitempty"` + // Encryption - The encryption settings of container registry. + Encryption *EncryptionProperty `json:"encryption,omitempty"` + // DataEndpointEnabled - Enable a single data endpoint per region for serving data. + DataEndpointEnabled *bool `json:"dataEndpointEnabled,omitempty"` + // PublicNetworkAccess - Whether or not public network access is allowed for the container registry. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // NetworkRuleBypassOptions - Whether to allow trusted Azure services to access a network restricted registry. Possible values include: 'NetworkRuleBypassOptionsAzureServices', 'NetworkRuleBypassOptionsNone' + NetworkRuleBypassOptions NetworkRuleBypassOptions `json:"networkRuleBypassOptions,omitempty"` +} + +// RegistryUpdateParameters the parameters for updating a container registry. +type RegistryUpdateParameters struct { + // Identity - The identity of the container registry. + Identity *IdentityProperties `json:"identity,omitempty"` + // Tags - The tags for the container registry. + Tags map[string]*string `json:"tags"` + // Sku - The SKU of the container registry. + Sku *Sku `json:"sku,omitempty"` + // RegistryPropertiesUpdateParameters - The properties that the container registry will be updated with. + *RegistryPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegistryUpdateParameters. +func (rup RegistryUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.Identity != nil { + objectMap["identity"] = rup.Identity + } + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + if rup.Sku != nil { + objectMap["sku"] = rup.Sku + } + if rup.RegistryPropertiesUpdateParameters != nil { + objectMap["properties"] = rup.RegistryPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for RegistryUpdateParameters struct. +func (rup *RegistryUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + rup.Identity = &identity + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rup.Tags = tags + } + case "sku": + if v != nil { + var sku Sku + err = json.Unmarshal(*v, &sku) + if err != nil { + return err + } + rup.Sku = &sku + } + case "properties": + if v != nil { + var registryPropertiesUpdateParameters RegistryPropertiesUpdateParameters + err = json.Unmarshal(*v, ®istryPropertiesUpdateParameters) + if err != nil { + return err + } + rup.RegistryPropertiesUpdateParameters = ®istryPropertiesUpdateParameters + } + } + } + + return nil +} + +// RegistryUsage the quota usage for a container registry. +type RegistryUsage struct { + // Name - The name of the usage. + Name *string `json:"name,omitempty"` + // Limit - The limit of the usage. + Limit *int64 `json:"limit,omitempty"` + // CurrentValue - The current value of the usage. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Unit - The unit of measurement. Possible values include: 'RegistryUsageUnitCount', 'RegistryUsageUnitBytes' + Unit RegistryUsageUnit `json:"unit,omitempty"` +} + +// RegistryUsageListResult the result of a request to get container registry quota usages. +type RegistryUsageListResult struct { + autorest.Response `json:"-"` + // Value - The list of container registry quota usages. + Value *[]RegistryUsage `json:"value,omitempty"` +} + +// Replication an object that represents a replication for a container registry. +type Replication struct { + autorest.Response `json:"-"` + // ReplicationProperties - The properties of the replication. + *ReplicationProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Replication. +func (r Replication) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.ReplicationProperties != nil { + objectMap["properties"] = r.ReplicationProperties + } + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Replication struct. +func (r *Replication) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var replicationProperties ReplicationProperties + err = json.Unmarshal(*v, &replicationProperties) + if err != nil { + return err + } + r.ReplicationProperties = &replicationProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + r.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + r.Tags = tags + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + r.SystemData = &systemData + } + } + } + + return nil +} + +// ReplicationListResult the result of a request to list replications for a container registry. +type ReplicationListResult struct { + autorest.Response `json:"-"` + // Value - The list of replications. Since this list may be incomplete, the nextLink field should be used to request the next list of replications. + Value *[]Replication `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of replications. + NextLink *string `json:"nextLink,omitempty"` +} + +// ReplicationListResultIterator provides access to a complete listing of Replication values. +type ReplicationListResultIterator struct { + i int + page ReplicationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ReplicationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ReplicationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ReplicationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ReplicationListResultIterator) Response() ReplicationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ReplicationListResultIterator) Value() Replication { + if !iter.page.NotDone() { + return Replication{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ReplicationListResultIterator type. +func NewReplicationListResultIterator(page ReplicationListResultPage) ReplicationListResultIterator { + return ReplicationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr ReplicationListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rlr ReplicationListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + +// replicationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr ReplicationListResult) replicationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// ReplicationListResultPage contains a page of Replication values. +type ReplicationListResultPage struct { + fn func(context.Context, ReplicationListResult) (ReplicationListResult, error) + rlr ReplicationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ReplicationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ReplicationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ReplicationListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ReplicationListResultPage) Response() ReplicationListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ReplicationListResultPage) Values() []Replication { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the ReplicationListResultPage type. +func NewReplicationListResultPage(cur ReplicationListResult, getNextPage func(context.Context, ReplicationListResult) (ReplicationListResult, error)) ReplicationListResultPage { + return ReplicationListResultPage{ + fn: getNextPage, + rlr: cur, + } +} + +// ReplicationProperties the properties of a replication. +type ReplicationProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the replication at the time the operation was called. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // Status - READ-ONLY; The status of the replication at the time the operation was called. + Status *Status `json:"status,omitempty"` + // RegionEndpointEnabled - Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications. + RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` + // ZoneRedundancy - Whether or not zone redundancy is enabled for this container registry replication. Possible values include: 'ZoneRedundancyEnabled', 'ZoneRedundancyDisabled' + ZoneRedundancy ZoneRedundancy `json:"zoneRedundancy,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationProperties. +func (rp ReplicationProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RegionEndpointEnabled != nil { + objectMap["regionEndpointEnabled"] = rp.RegionEndpointEnabled + } + if rp.ZoneRedundancy != "" { + objectMap["zoneRedundancy"] = rp.ZoneRedundancy + } + return json.Marshal(objectMap) +} + +// ReplicationsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationsClient) (Replication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationsCreateFuture.Result. +func (future *ReplicationsCreateFuture) result(client ReplicationsClient) (r Replication, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + r.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.CreateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsCreateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationsDeleteFuture.Result. +func (future *ReplicationsDeleteFuture) result(client ReplicationsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ReplicationsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type ReplicationsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(ReplicationsClient) (Replication, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *ReplicationsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for ReplicationsUpdateFuture.Result. +func (future *ReplicationsUpdateFuture) result(client ReplicationsClient) (r Replication, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + r.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.ReplicationsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.UpdateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsUpdateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// ReplicationUpdateParameters the parameters for updating a replication. +type ReplicationUpdateParameters struct { + // Tags - The tags for the replication. + Tags map[string]*string `json:"tags"` + // ReplicationUpdateParametersProperties - The parameters for updating a replication's properties + *ReplicationUpdateParametersProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReplicationUpdateParameters. +func (rup ReplicationUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rup.Tags != nil { + objectMap["tags"] = rup.Tags + } + if rup.ReplicationUpdateParametersProperties != nil { + objectMap["properties"] = rup.ReplicationUpdateParametersProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ReplicationUpdateParameters struct. +func (rup *ReplicationUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + rup.Tags = tags + } + case "properties": + if v != nil { + var replicationUpdateParametersProperties ReplicationUpdateParametersProperties + err = json.Unmarshal(*v, &replicationUpdateParametersProperties) + if err != nil { + return err + } + rup.ReplicationUpdateParametersProperties = &replicationUpdateParametersProperties + } + } + } + + return nil +} + +// ReplicationUpdateParametersProperties ... +type ReplicationUpdateParametersProperties struct { + // RegionEndpointEnabled - Specifies whether the replication's regional endpoint is enabled. Requests will not be routed to a replication whose regional endpoint is disabled, however its data will continue to be synced with other replications. + RegionEndpointEnabled *bool `json:"regionEndpointEnabled,omitempty"` +} + +// Request the request that generated the event. +type Request struct { + // ID - The ID of the request that initiated the event. + ID *string `json:"id,omitempty"` + // Addr - The IP or hostname and possibly port of the client connection that initiated the event. This is the RemoteAddr from the standard http request. + Addr *string `json:"addr,omitempty"` + // Host - The externally accessible hostname of the registry instance, as specified by the http host header on incoming requests. + Host *string `json:"host,omitempty"` + // Method - The request method that generated the event. + Method *string `json:"method,omitempty"` + // Useragent - The user agent header of the request. + Useragent *string `json:"useragent,omitempty"` +} + +// Resource an Azure resource. +type Resource struct { + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// RetentionPolicy the retention policy for a container registry. +type RetentionPolicy struct { + // Days - The number of days to retain an untagged manifest after which it gets purged. + Days *int32 `json:"days,omitempty"` + // LastUpdatedTime - READ-ONLY; The timestamp when the policy was last updated. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` +} + +// MarshalJSON is the custom marshaler for RetentionPolicy. +func (rp RetentionPolicy) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.Days != nil { + objectMap["days"] = rp.Days + } + if rp.Status != "" { + objectMap["status"] = rp.Status + } + return json.Marshal(objectMap) +} + +// Run run resource properties +type Run struct { + autorest.Response `json:"-"` + // RunProperties - The properties of a run. + *RunProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Run. +func (r Run) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.RunProperties != nil { + objectMap["properties"] = r.RunProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Run struct. +func (r *Run) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var runProperties RunProperties + err = json.Unmarshal(*v, &runProperties) + if err != nil { + return err + } + r.RunProperties = &runProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + r.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + r.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + r.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + r.SystemData = &systemData + } + } + } + + return nil +} + +// RunFilter properties that are enabled for Odata querying on runs. +type RunFilter struct { + // RunID - The unique identifier for the run. + RunID *string `json:"runId,omitempty"` + // RunType - The type of run. Possible values include: 'RunTypeQuickBuild', 'RunTypeQuickRun', 'RunTypeAutoBuild', 'RunTypeAutoRun' + RunType RunType `json:"runType,omitempty"` + // Status - The current status of the run. Possible values include: 'RunStatusQueued', 'RunStatusStarted', 'RunStatusRunning', 'RunStatusSucceeded', 'RunStatusFailed', 'RunStatusCanceled', 'RunStatusError', 'RunStatusTimeout' + Status RunStatus `json:"status,omitempty"` + // CreateTime - The create time for a run. + CreateTime *date.Time `json:"createTime,omitempty"` + // FinishTime - The time the run finished. + FinishTime *date.Time `json:"finishTime,omitempty"` + // OutputImageManifests - The list of comma-separated image manifests that were generated from the run. This is applicable if the run is of + // build type. + OutputImageManifests *string `json:"outputImageManifests,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // TaskName - The name of the task that the run corresponds to. + TaskName *string `json:"taskName,omitempty"` + // AgentPoolName - The name of the agent pool that the run corresponds to. + AgentPoolName *string `json:"agentPoolName,omitempty"` +} + +// RunGetLogResult the result of get log link operation. +type RunGetLogResult struct { + autorest.Response `json:"-"` + // LogLink - The link to logs for a run on a azure container registry. + LogLink *string `json:"logLink,omitempty"` + // LogArtifactLink - The link to logs in registry for a run on a azure container registry. + LogArtifactLink *string `json:"logArtifactLink,omitempty"` +} + +// RunListResult collection of runs. +type RunListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]Run `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// RunListResultIterator provides access to a complete listing of Run values. +type RunListResultIterator struct { + i int + page RunListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *RunListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *RunListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter RunListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter RunListResultIterator) Response() RunListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter RunListResultIterator) Value() Run { + if !iter.page.NotDone() { + return Run{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the RunListResultIterator type. +func NewRunListResultIterator(page RunListResultPage) RunListResultIterator { + return RunListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (rlr RunListResult) IsEmpty() bool { + return rlr.Value == nil || len(*rlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (rlr RunListResult) hasNextLink() bool { + return rlr.NextLink != nil && len(*rlr.NextLink) != 0 +} + +// runListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (rlr RunListResult) runListResultPreparer(ctx context.Context) (*http.Request, error) { + if !rlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(rlr.NextLink))) +} + +// RunListResultPage contains a page of Run values. +type RunListResultPage struct { + fn func(context.Context, RunListResult) (RunListResult, error) + rlr RunListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *RunListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.rlr) + if err != nil { + return err + } + page.rlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *RunListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page RunListResultPage) NotDone() bool { + return !page.rlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page RunListResultPage) Response() RunListResult { + return page.rlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page RunListResultPage) Values() []Run { + if page.rlr.IsEmpty() { + return nil + } + return *page.rlr.Value +} + +// Creates a new instance of the RunListResultPage type. +func NewRunListResultPage(cur RunListResult, getNextPage func(context.Context, RunListResult) (RunListResult, error)) RunListResultPage { + return RunListResultPage{ + fn: getNextPage, + rlr: cur, + } +} + +// RunProperties the properties for a run. +type RunProperties struct { + // RunID - The unique identifier for the run. + RunID *string `json:"runId,omitempty"` + // Status - The current status of the run. Possible values include: 'RunStatusQueued', 'RunStatusStarted', 'RunStatusRunning', 'RunStatusSucceeded', 'RunStatusFailed', 'RunStatusCanceled', 'RunStatusError', 'RunStatusTimeout' + Status RunStatus `json:"status,omitempty"` + // LastUpdatedTime - The last updated time for the run. + LastUpdatedTime *date.Time `json:"lastUpdatedTime,omitempty"` + // RunType - The type of run. Possible values include: 'RunTypeQuickBuild', 'RunTypeQuickRun', 'RunTypeAutoBuild', 'RunTypeAutoRun' + RunType RunType `json:"runType,omitempty"` + // AgentPoolName - The dedicated agent pool for the run. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // CreateTime - The time the run was scheduled. + CreateTime *date.Time `json:"createTime,omitempty"` + // StartTime - The time the run started. + StartTime *date.Time `json:"startTime,omitempty"` + // FinishTime - The time the run finished. + FinishTime *date.Time `json:"finishTime,omitempty"` + // OutputImages - The list of all images that were generated from the run. This is applicable if the run generates base image dependencies. + OutputImages *[]ImageDescriptor `json:"outputImages,omitempty"` + // Task - The task against which run was scheduled. + Task *string `json:"task,omitempty"` + // ImageUpdateTrigger - The image update trigger that caused the run. This is applicable if the task has base image trigger configured. + ImageUpdateTrigger *ImageUpdateTrigger `json:"imageUpdateTrigger,omitempty"` + // SourceTrigger - The source trigger that caused the run. + SourceTrigger *SourceTriggerDescriptor `json:"sourceTrigger,omitempty"` + // TimerTrigger - The timer trigger that caused the run. + TimerTrigger *TimerTriggerDescriptor `json:"timerTrigger,omitempty"` + // Platform - The platform properties against which the run will happen. + Platform *PlatformProperties `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // SourceRegistryAuth - The scope of the credentials that were used to login to the source registry during this run. + SourceRegistryAuth *string `json:"sourceRegistryAuth,omitempty"` + // CustomRegistries - The list of custom registries that were logged in during this run. + CustomRegistries *[]string `json:"customRegistries,omitempty"` + // RunErrorMessage - READ-ONLY; The error message received from backend systems after the run is scheduled. + RunErrorMessage *string `json:"runErrorMessage,omitempty"` + // UpdateTriggerToken - The update trigger token passed for the Run. + UpdateTriggerToken *string `json:"updateTriggerToken,omitempty"` + // LogArtifact - READ-ONLY; The image description for the log artifact. + LogArtifact *ImageDescriptor `json:"logArtifact,omitempty"` + // ProvisioningState - The provisioning state of a run. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` +} + +// MarshalJSON is the custom marshaler for RunProperties. +func (rp RunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rp.RunID != nil { + objectMap["runId"] = rp.RunID + } + if rp.Status != "" { + objectMap["status"] = rp.Status + } + if rp.LastUpdatedTime != nil { + objectMap["lastUpdatedTime"] = rp.LastUpdatedTime + } + if rp.RunType != "" { + objectMap["runType"] = rp.RunType + } + if rp.AgentPoolName != nil { + objectMap["agentPoolName"] = rp.AgentPoolName + } + if rp.CreateTime != nil { + objectMap["createTime"] = rp.CreateTime + } + if rp.StartTime != nil { + objectMap["startTime"] = rp.StartTime + } + if rp.FinishTime != nil { + objectMap["finishTime"] = rp.FinishTime + } + if rp.OutputImages != nil { + objectMap["outputImages"] = rp.OutputImages + } + if rp.Task != nil { + objectMap["task"] = rp.Task + } + if rp.ImageUpdateTrigger != nil { + objectMap["imageUpdateTrigger"] = rp.ImageUpdateTrigger + } + if rp.SourceTrigger != nil { + objectMap["sourceTrigger"] = rp.SourceTrigger + } + if rp.TimerTrigger != nil { + objectMap["timerTrigger"] = rp.TimerTrigger + } + if rp.Platform != nil { + objectMap["platform"] = rp.Platform + } + if rp.AgentConfiguration != nil { + objectMap["agentConfiguration"] = rp.AgentConfiguration + } + if rp.SourceRegistryAuth != nil { + objectMap["sourceRegistryAuth"] = rp.SourceRegistryAuth + } + if rp.CustomRegistries != nil { + objectMap["customRegistries"] = rp.CustomRegistries + } + if rp.UpdateTriggerToken != nil { + objectMap["updateTriggerToken"] = rp.UpdateTriggerToken + } + if rp.ProvisioningState != "" { + objectMap["provisioningState"] = rp.ProvisioningState + } + if rp.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = rp.IsArchiveEnabled + } + return json.Marshal(objectMap) +} + +// BasicRunRequest the request parameters for scheduling a run. +type BasicRunRequest interface { + AsDockerBuildRequest() (*DockerBuildRequest, bool) + AsFileTaskRunRequest() (*FileTaskRunRequest, bool) + AsTaskRunRequest() (*TaskRunRequest, bool) + AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) + AsRunRequest() (*RunRequest, bool) +} + +// RunRequest the request parameters for scheduling a run. +type RunRequest struct { + // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // AgentPoolName - The dedicated agent pool for the run. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` + // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' + Type Type `json:"type,omitempty"` +} + +func unmarshalBasicRunRequest(body []byte) (BasicRunRequest, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeDockerBuildRequest): + var dbr DockerBuildRequest + err := json.Unmarshal(body, &dbr) + return dbr, err + case string(TypeFileTaskRunRequest): + var ftrr FileTaskRunRequest + err := json.Unmarshal(body, &ftrr) + return ftrr, err + case string(TypeTaskRunRequest): + var trr TaskRunRequest + err := json.Unmarshal(body, &trr) + return trr, err + case string(TypeEncodedTaskRunRequest): + var etrr EncodedTaskRunRequest + err := json.Unmarshal(body, &etrr) + return etrr, err + default: + var rr RunRequest + err := json.Unmarshal(body, &rr) + return rr, err + } +} +func unmarshalBasicRunRequestArray(body []byte) ([]BasicRunRequest, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + rrArray := make([]BasicRunRequest, len(rawMessages)) + + for index, rawMessage := range rawMessages { + rr, err := unmarshalBasicRunRequest(*rawMessage) + if err != nil { + return nil, err + } + rrArray[index] = rr + } + return rrArray, nil +} + +// MarshalJSON is the custom marshaler for RunRequest. +func (rr RunRequest) MarshalJSON() ([]byte, error) { + rr.Type = TypeRunRequest + objectMap := make(map[string]interface{}) + if rr.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = rr.IsArchiveEnabled + } + if rr.AgentPoolName != nil { + objectMap["agentPoolName"] = rr.AgentPoolName + } + if rr.LogTemplate != nil { + objectMap["logTemplate"] = rr.LogTemplate + } + if rr.Type != "" { + objectMap["type"] = rr.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildRequest is the BasicRunRequest implementation for RunRequest. +func (rr RunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { + return nil, false +} + +// AsFileTaskRunRequest is the BasicRunRequest implementation for RunRequest. +func (rr RunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { + return nil, false +} + +// AsTaskRunRequest is the BasicRunRequest implementation for RunRequest. +func (rr RunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { + return nil, false +} + +// AsEncodedTaskRunRequest is the BasicRunRequest implementation for RunRequest. +func (rr RunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { + return nil, false +} + +// AsRunRequest is the BasicRunRequest implementation for RunRequest. +func (rr RunRequest) AsRunRequest() (*RunRequest, bool) { + return &rr, true +} + +// AsBasicRunRequest is the BasicRunRequest implementation for RunRequest. +func (rr RunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { + return &rr, true +} + +// RunsCancelFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RunsCancelFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RunsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RunsCancelFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RunsCancelFuture.Result. +func (future *RunsCancelFuture) result(client RunsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsCancelFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RunsCancelFuture") + return + } + ar.Response = future.Response() + return +} + +// RunsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type RunsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(RunsClient) (Run, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *RunsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for RunsUpdateFuture.Result. +func (future *RunsUpdateFuture) result(client RunsClient) (r Run, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + r.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.RunsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if r.Response.Response, err = future.GetResult(sender); err == nil && r.Response.Response.StatusCode != http.StatusNoContent { + r, err = client.UpdateResponder(r.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsUpdateFuture", "Result", r.Response.Response, "Failure responding to request") + } + } + return +} + +// RunUpdateParameters the set of run properties that can be updated. +type RunUpdateParameters struct { + // IsArchiveEnabled - The value that indicates whether archiving is enabled or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` +} + +// SecretObject describes the properties of a secret object value. +type SecretObject struct { + // Value - The value of the secret. The format of this value will be determined + // based on the type of the secret object. If the type is Opaque, the value will be + // used as is without any modification. + Value *string `json:"value,omitempty"` + // Type - The type of the secret object which determines how the value of the secret object has to be + // interpreted. Possible values include: 'SecretObjectTypeOpaque', 'SecretObjectTypeVaultsecret' + Type SecretObjectType `json:"type,omitempty"` +} + +// SetValue the properties of a overridable value that can be passed to a task template. +type SetValue struct { + // Name - The name of the overridable value. + Name *string `json:"name,omitempty"` + // Value - The overridable value. + Value *string `json:"value,omitempty"` + // IsSecret - Flag to indicate whether the value represents a secret or not. + IsSecret *bool `json:"isSecret,omitempty"` +} + +// Sku the SKU of a container registry. +type Sku struct { + // Name - The SKU name of the container registry. Required for registry creation. Possible values include: 'SkuNameClassic', 'SkuNameBasic', 'SkuNameStandard', 'SkuNamePremium' + Name SkuName `json:"name,omitempty"` + // Tier - READ-ONLY; The SKU tier based on the SKU name. Possible values include: 'SkuTierClassic', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` +} + +// MarshalJSON is the custom marshaler for Sku. +func (s Sku) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.Name != "" { + objectMap["name"] = s.Name + } + return json.Marshal(objectMap) +} + +// Source the registry node that generated the event. Put differently, while the actor initiates the event, +// the source generates it. +type Source struct { + // Addr - The IP or hostname and the port of the registry node that generated the event. Generally, this will be resolved by os.Hostname() along with the running port. + Addr *string `json:"addr,omitempty"` + // InstanceID - The running instance of an application. Changes after each restart. + InstanceID *string `json:"instanceID,omitempty"` +} + +// SourceProperties the properties of the source code repository. +type SourceProperties struct { + // SourceControlType - The type of source control service. Possible values include: 'SourceControlTypeGithub', 'SourceControlTypeVisualStudioTeamService' + SourceControlType SourceControlType `json:"sourceControlType,omitempty"` + // RepositoryURL - The full URL to the source code repository + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The branch name of the source code. + Branch *string `json:"branch,omitempty"` + // SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up + // webhooks for notifications. + SourceControlAuthProperties *AuthInfo `json:"sourceControlAuthProperties,omitempty"` +} + +// SourceRegistryCredentials describes the credential parameters for accessing the source registry. +type SourceRegistryCredentials struct { + // LoginMode - The authentication mode which determines the source registry login scope. The credentials for the source registry + // will be generated using the given scope. These credentials will be used to login to + // the source registry during the run. Possible values include: 'SourceRegistryLoginModeNone', 'SourceRegistryLoginModeDefault' + LoginMode SourceRegistryLoginMode `json:"loginMode,omitempty"` +} + +// SourceTrigger the properties of a source based trigger. +type SourceTrigger struct { + // SourceRepository - The properties that describes the source(code) for the task. + SourceRepository *SourceProperties `json:"sourceRepository,omitempty"` + // SourceTriggerEvents - The source event corresponding to the trigger. + SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// SourceTriggerDescriptor the source trigger that caused a run. +type SourceTriggerDescriptor struct { + // ID - The unique ID of the trigger. + ID *string `json:"id,omitempty"` + // EventType - The event type of the trigger. + EventType *string `json:"eventType,omitempty"` + // CommitID - The unique ID that identifies a commit. + CommitID *string `json:"commitId,omitempty"` + // PullRequestID - The unique ID that identifies pull request. + PullRequestID *string `json:"pullRequestId,omitempty"` + // RepositoryURL - The repository URL. + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // BranchName - The branch name in the repository. + BranchName *string `json:"branchName,omitempty"` + // ProviderType - The source control provider type. + ProviderType *string `json:"providerType,omitempty"` +} + +// SourceTriggerUpdateParameters the properties for updating a source based trigger. +type SourceTriggerUpdateParameters struct { + // SourceRepository - The properties that describes the source(code) for the task. + SourceRepository *SourceUpdateParameters `json:"sourceRepository,omitempty"` + // SourceTriggerEvents - The source event corresponding to the trigger. + SourceTriggerEvents *[]SourceTriggerEvent `json:"sourceTriggerEvents,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// SourceUpdateParameters the properties for updating the source code repository. +type SourceUpdateParameters struct { + // SourceControlType - The type of source control service. Possible values include: 'SourceControlTypeGithub', 'SourceControlTypeVisualStudioTeamService' + SourceControlType SourceControlType `json:"sourceControlType,omitempty"` + // RepositoryURL - The full URL to the source code repository + RepositoryURL *string `json:"repositoryUrl,omitempty"` + // Branch - The branch name of the source code. + Branch *string `json:"branch,omitempty"` + // SourceControlAuthProperties - The authorization properties for accessing the source code repository and to set up + // webhooks for notifications. + SourceControlAuthProperties *AuthInfoUpdateParameters `json:"sourceControlAuthProperties,omitempty"` +} + +// SourceUploadDefinition the properties of a response to source upload request. +type SourceUploadDefinition struct { + autorest.Response `json:"-"` + // UploadURL - The URL where the client can upload the source. + UploadURL *string `json:"uploadUrl,omitempty"` + // RelativePath - The relative path to the source. This is used to submit the subsequent queue build request. + RelativePath *string `json:"relativePath,omitempty"` +} + +// Status the status of an Azure resource at the time the operation was called. +type Status struct { + // DisplayStatus - READ-ONLY; The short label for the status. + DisplayStatus *string `json:"displayStatus,omitempty"` + // Message - READ-ONLY; The detailed message for the status, including alerts and error messages. + Message *string `json:"message,omitempty"` + // Timestamp - READ-ONLY; The timestamp when the status was changed to the current value. + Timestamp *date.Time `json:"timestamp,omitempty"` +} + +// MarshalJSON is the custom marshaler for Status. +func (s Status) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// StorageAccountProperties the properties of a storage account for a container registry. Only applicable +// to Classic SKU. +type StorageAccountProperties struct { + // ID - The resource ID of the storage account. + ID *string `json:"id,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'LastModifiedByTypeUser', 'LastModifiedByTypeApplication', 'LastModifiedByTypeManagedIdentity', 'LastModifiedByTypeKey' + LastModifiedByType LastModifiedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource modification (UTC). + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// Target the target of the event. +type Target struct { + // MediaType - The MIME type of the referenced object. + MediaType *string `json:"mediaType,omitempty"` + // Size - The number of bytes of the content. Same as Length field. + Size *int64 `json:"size,omitempty"` + // Digest - The digest of the content, as defined by the Registry V2 HTTP API Specification. + Digest *string `json:"digest,omitempty"` + // Length - The number of bytes of the content. Same as Size field. + Length *int64 `json:"length,omitempty"` + // Repository - The repository name. + Repository *string `json:"repository,omitempty"` + // URL - The direct URL to the content. + URL *string `json:"url,omitempty"` + // Tag - The tag name. + Tag *string `json:"tag,omitempty"` + // Name - The name of the artifact. + Name *string `json:"name,omitempty"` + // Version - The version of the artifact. + Version *string `json:"version,omitempty"` +} + +// Task the task that has the ARM resource and task properties. +// The task will have all information to schedule a run against it. +type Task struct { + autorest.Response `json:"-"` + // Identity - Identity for the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + // TaskProperties - The properties of a task. + *TaskProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Task. +func (t Task) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if t.Identity != nil { + objectMap["identity"] = t.Identity + } + if t.TaskProperties != nil { + objectMap["properties"] = t.TaskProperties + } + if t.Location != nil { + objectMap["location"] = t.Location + } + if t.Tags != nil { + objectMap["tags"] = t.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Task struct. +func (t *Task) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + t.Identity = &identity + } + case "properties": + if v != nil { + var taskProperties TaskProperties + err = json.Unmarshal(*v, &taskProperties) + if err != nil { + return err + } + t.TaskProperties = &taskProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + t.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + t.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + t.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + t.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + t.Tags = tags + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + t.SystemData = &systemData + } + } + } + + return nil +} + +// TaskListResult the collection of tasks. +type TaskListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]Task `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// TaskListResultIterator provides access to a complete listing of Task values. +type TaskListResultIterator struct { + i int + page TaskListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TaskListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TaskListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TaskListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TaskListResultIterator) Response() TaskListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TaskListResultIterator) Value() Task { + if !iter.page.NotDone() { + return Task{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TaskListResultIterator type. +func NewTaskListResultIterator(page TaskListResultPage) TaskListResultIterator { + return TaskListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (tlr TaskListResult) IsEmpty() bool { + return tlr.Value == nil || len(*tlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (tlr TaskListResult) hasNextLink() bool { + return tlr.NextLink != nil && len(*tlr.NextLink) != 0 +} + +// taskListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (tlr TaskListResult) taskListResultPreparer(ctx context.Context) (*http.Request, error) { + if !tlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(tlr.NextLink))) +} + +// TaskListResultPage contains a page of Task values. +type TaskListResultPage struct { + fn func(context.Context, TaskListResult) (TaskListResult, error) + tlr TaskListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TaskListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.tlr) + if err != nil { + return err + } + page.tlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TaskListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TaskListResultPage) NotDone() bool { + return !page.tlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TaskListResultPage) Response() TaskListResult { + return page.tlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TaskListResultPage) Values() []Task { + if page.tlr.IsEmpty() { + return nil + } + return *page.tlr.Value +} + +// Creates a new instance of the TaskListResultPage type. +func NewTaskListResultPage(cur TaskListResult, getNextPage func(context.Context, TaskListResult) (TaskListResult, error)) TaskListResultPage { + return TaskListResultPage{ + fn: getNextPage, + tlr: cur, + } +} + +// TaskProperties the properties of a task. +type TaskProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of the task. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // CreationDate - READ-ONLY; The creation date of task. + CreationDate *date.Time `json:"creationDate,omitempty"` + // Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled' + Status TaskStatus `json:"status,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformProperties `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // AgentPoolName - The dedicated agent pool for the task. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Step - The properties of a task step. + Step BasicTaskStepProperties `json:"step,omitempty"` + // Trigger - The properties that describe all triggers for the task. + Trigger *TriggerProperties `json:"trigger,omitempty"` + // Credentials - The properties that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` + // IsSystemTask - The value of this property indicates whether the task resource is system task or not. + IsSystemTask *bool `json:"isSystemTask,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaskProperties. +func (tp TaskProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tp.Status != "" { + objectMap["status"] = tp.Status + } + if tp.Platform != nil { + objectMap["platform"] = tp.Platform + } + if tp.AgentConfiguration != nil { + objectMap["agentConfiguration"] = tp.AgentConfiguration + } + if tp.AgentPoolName != nil { + objectMap["agentPoolName"] = tp.AgentPoolName + } + if tp.Timeout != nil { + objectMap["timeout"] = tp.Timeout + } + objectMap["step"] = tp.Step + if tp.Trigger != nil { + objectMap["trigger"] = tp.Trigger + } + if tp.Credentials != nil { + objectMap["credentials"] = tp.Credentials + } + if tp.LogTemplate != nil { + objectMap["logTemplate"] = tp.LogTemplate + } + if tp.IsSystemTask != nil { + objectMap["isSystemTask"] = tp.IsSystemTask + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TaskProperties struct. +func (tp *TaskProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + tp.ProvisioningState = provisioningState + } + case "creationDate": + if v != nil { + var creationDate date.Time + err = json.Unmarshal(*v, &creationDate) + if err != nil { + return err + } + tp.CreationDate = &creationDate + } + case "status": + if v != nil { + var status TaskStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + tp.Status = status + } + case "platform": + if v != nil { + var platform PlatformProperties + err = json.Unmarshal(*v, &platform) + if err != nil { + return err + } + tp.Platform = &platform + } + case "agentConfiguration": + if v != nil { + var agentConfiguration AgentProperties + err = json.Unmarshal(*v, &agentConfiguration) + if err != nil { + return err + } + tp.AgentConfiguration = &agentConfiguration + } + case "agentPoolName": + if v != nil { + var agentPoolName string + err = json.Unmarshal(*v, &agentPoolName) + if err != nil { + return err + } + tp.AgentPoolName = &agentPoolName + } + case "timeout": + if v != nil { + var timeout int32 + err = json.Unmarshal(*v, &timeout) + if err != nil { + return err + } + tp.Timeout = &timeout + } + case "step": + if v != nil { + step, err := unmarshalBasicTaskStepProperties(*v) + if err != nil { + return err + } + tp.Step = step + } + case "trigger": + if v != nil { + var trigger TriggerProperties + err = json.Unmarshal(*v, &trigger) + if err != nil { + return err + } + tp.Trigger = &trigger + } + case "credentials": + if v != nil { + var credentials Credentials + err = json.Unmarshal(*v, &credentials) + if err != nil { + return err + } + tp.Credentials = &credentials + } + case "logTemplate": + if v != nil { + var logTemplate string + err = json.Unmarshal(*v, &logTemplate) + if err != nil { + return err + } + tp.LogTemplate = &logTemplate + } + case "isSystemTask": + if v != nil { + var isSystemTask bool + err = json.Unmarshal(*v, &isSystemTask) + if err != nil { + return err + } + tp.IsSystemTask = &isSystemTask + } + } + } + + return nil +} + +// TaskPropertiesUpdateParameters the properties for updating a task. +type TaskPropertiesUpdateParameters struct { + // Status - The current status of task. Possible values include: 'TaskStatusDisabled', 'TaskStatusEnabled' + Status TaskStatus `json:"status,omitempty"` + // Platform - The platform properties against which the run has to happen. + Platform *PlatformUpdateParameters `json:"platform,omitempty"` + // AgentConfiguration - The machine configuration of the run agent. + AgentConfiguration *AgentProperties `json:"agentConfiguration,omitempty"` + // AgentPoolName - The dedicated agent pool for the task. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // Timeout - Run timeout in seconds. + Timeout *int32 `json:"timeout,omitempty"` + // Step - The properties for updating a task step. + Step BasicTaskStepUpdateParameters `json:"step,omitempty"` + // Trigger - The properties for updating trigger properties. + Trigger *TriggerUpdateParameters `json:"trigger,omitempty"` + // Credentials - The parameters that describes a set of credentials that will be used when this run is invoked. + Credentials *Credentials `json:"credentials,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TaskPropertiesUpdateParameters struct. +func (tpup *TaskPropertiesUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "status": + if v != nil { + var status TaskStatus + err = json.Unmarshal(*v, &status) + if err != nil { + return err + } + tpup.Status = status + } + case "platform": + if v != nil { + var platform PlatformUpdateParameters + err = json.Unmarshal(*v, &platform) + if err != nil { + return err + } + tpup.Platform = &platform + } + case "agentConfiguration": + if v != nil { + var agentConfiguration AgentProperties + err = json.Unmarshal(*v, &agentConfiguration) + if err != nil { + return err + } + tpup.AgentConfiguration = &agentConfiguration + } + case "agentPoolName": + if v != nil { + var agentPoolName string + err = json.Unmarshal(*v, &agentPoolName) + if err != nil { + return err + } + tpup.AgentPoolName = &agentPoolName + } + case "timeout": + if v != nil { + var timeout int32 + err = json.Unmarshal(*v, &timeout) + if err != nil { + return err + } + tpup.Timeout = &timeout + } + case "step": + if v != nil { + step, err := unmarshalBasicTaskStepUpdateParameters(*v) + if err != nil { + return err + } + tpup.Step = step + } + case "trigger": + if v != nil { + var trigger TriggerUpdateParameters + err = json.Unmarshal(*v, &trigger) + if err != nil { + return err + } + tpup.Trigger = &trigger + } + case "credentials": + if v != nil { + var credentials Credentials + err = json.Unmarshal(*v, &credentials) + if err != nil { + return err + } + tpup.Credentials = &credentials + } + case "logTemplate": + if v != nil { + var logTemplate string + err = json.Unmarshal(*v, &logTemplate) + if err != nil { + return err + } + tpup.LogTemplate = &logTemplate + } + } + } + + return nil +} + +// TaskRun the task run that has the ARM resource and properties. +// The task run will have the information of request and result of a run. +type TaskRun struct { + autorest.Response `json:"-"` + // Identity - Identity for the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + // TaskRunProperties - The properties associated with the task run, i.e., request and result of the run + *TaskRunProperties `json:"properties,omitempty"` + // Location - The location of the resource + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaskRun. +func (tr TaskRun) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Identity != nil { + objectMap["identity"] = tr.Identity + } + if tr.TaskRunProperties != nil { + objectMap["properties"] = tr.TaskRunProperties + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TaskRun struct. +func (tr *TaskRun) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tr.Identity = &identity + } + case "properties": + if v != nil { + var taskRunProperties TaskRunProperties + err = json.Unmarshal(*v, &taskRunProperties) + if err != nil { + return err + } + tr.TaskRunProperties = &taskRunProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + tr.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + tr.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + tr.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + tr.Type = &typeVar + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + tr.SystemData = &systemData + } + } + } + + return nil +} + +// TaskRunListResult the collection of task runs. +type TaskRunListResult struct { + autorest.Response `json:"-"` + // Value - The collection value. + Value *[]TaskRun `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next set of paged results. + NextLink *string `json:"nextLink,omitempty"` +} + +// TaskRunListResultIterator provides access to a complete listing of TaskRun values. +type TaskRunListResultIterator struct { + i int + page TaskRunListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *TaskRunListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *TaskRunListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter TaskRunListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter TaskRunListResultIterator) Response() TaskRunListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter TaskRunListResultIterator) Value() TaskRun { + if !iter.page.NotDone() { + return TaskRun{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the TaskRunListResultIterator type. +func NewTaskRunListResultIterator(page TaskRunListResultPage) TaskRunListResultIterator { + return TaskRunListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (trlr TaskRunListResult) IsEmpty() bool { + return trlr.Value == nil || len(*trlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (trlr TaskRunListResult) hasNextLink() bool { + return trlr.NextLink != nil && len(*trlr.NextLink) != 0 +} + +// taskRunListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (trlr TaskRunListResult) taskRunListResultPreparer(ctx context.Context) (*http.Request, error) { + if !trlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(trlr.NextLink))) +} + +// TaskRunListResultPage contains a page of TaskRun values. +type TaskRunListResultPage struct { + fn func(context.Context, TaskRunListResult) (TaskRunListResult, error) + trlr TaskRunListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *TaskRunListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.trlr) + if err != nil { + return err + } + page.trlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *TaskRunListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page TaskRunListResultPage) NotDone() bool { + return !page.trlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page TaskRunListResultPage) Response() TaskRunListResult { + return page.trlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page TaskRunListResultPage) Values() []TaskRun { + if page.trlr.IsEmpty() { + return nil + } + return *page.trlr.Value +} + +// Creates a new instance of the TaskRunListResultPage type. +func NewTaskRunListResultPage(cur TaskRunListResult, getNextPage func(context.Context, TaskRunListResult) (TaskRunListResult, error)) TaskRunListResultPage { + return TaskRunListResultPage{ + fn: getNextPage, + trlr: cur, + } +} + +// TaskRunProperties the properties of task run. +type TaskRunProperties struct { + // ProvisioningState - READ-ONLY; The provisioning state of this task run. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // RunRequest - The request (parameters) for the run + RunRequest BasicRunRequest `json:"runRequest,omitempty"` + // RunResult - READ-ONLY; The result of this task run + RunResult *Run `json:"runResult,omitempty"` + // ForceUpdateTag - How the run should be forced to rerun even if the run request configuration has not changed + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaskRunProperties. +func (trp TaskRunProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + objectMap["runRequest"] = trp.RunRequest + if trp.ForceUpdateTag != nil { + objectMap["forceUpdateTag"] = trp.ForceUpdateTag + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TaskRunProperties struct. +func (trp *TaskRunProperties) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "provisioningState": + if v != nil { + var provisioningState ProvisioningState + err = json.Unmarshal(*v, &provisioningState) + if err != nil { + return err + } + trp.ProvisioningState = provisioningState + } + case "runRequest": + if v != nil { + runRequest, err := unmarshalBasicRunRequest(*v) + if err != nil { + return err + } + trp.RunRequest = runRequest + } + case "runResult": + if v != nil { + var runResult Run + err = json.Unmarshal(*v, &runResult) + if err != nil { + return err + } + trp.RunResult = &runResult + } + case "forceUpdateTag": + if v != nil { + var forceUpdateTag string + err = json.Unmarshal(*v, &forceUpdateTag) + if err != nil { + return err + } + trp.ForceUpdateTag = &forceUpdateTag + } + } + } + + return nil +} + +// TaskRunPropertiesUpdateParameters the properties of a task run update parameters. +type TaskRunPropertiesUpdateParameters struct { + // RunRequest - The request (parameters) for the new run + RunRequest BasicRunRequest `json:"runRequest,omitempty"` + // ForceUpdateTag - How the run should be forced to rerun even if the run request configuration has not changed + ForceUpdateTag *string `json:"forceUpdateTag,omitempty"` +} + +// UnmarshalJSON is the custom unmarshaler for TaskRunPropertiesUpdateParameters struct. +func (trpup *TaskRunPropertiesUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "runRequest": + if v != nil { + runRequest, err := unmarshalBasicRunRequest(*v) + if err != nil { + return err + } + trpup.RunRequest = runRequest + } + case "forceUpdateTag": + if v != nil { + var forceUpdateTag string + err = json.Unmarshal(*v, &forceUpdateTag) + if err != nil { + return err + } + trpup.ForceUpdateTag = &forceUpdateTag + } + } + } + + return nil +} + +// TaskRunRequest the parameters for a task run request. +type TaskRunRequest struct { + // TaskID - The resource ID of task against which run has to be queued. + TaskID *string `json:"taskId,omitempty"` + // OverrideTaskStepProperties - Set of overridable parameters that can be passed when running a Task. + OverrideTaskStepProperties *OverrideTaskStepProperties `json:"overrideTaskStepProperties,omitempty"` + // IsArchiveEnabled - The value that indicates whether archiving is enabled for the run or not. + IsArchiveEnabled *bool `json:"isArchiveEnabled,omitempty"` + // AgentPoolName - The dedicated agent pool for the run. + AgentPoolName *string `json:"agentPoolName,omitempty"` + // LogTemplate - The template that describes the repository and tag information for run log artifact. + LogTemplate *string `json:"logTemplate,omitempty"` + // Type - Possible values include: 'TypeRunRequest', 'TypeDockerBuildRequest', 'TypeFileTaskRunRequest', 'TypeTaskRunRequest', 'TypeEncodedTaskRunRequest' + Type Type `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TaskRunRequest. +func (trr TaskRunRequest) MarshalJSON() ([]byte, error) { + trr.Type = TypeTaskRunRequest + objectMap := make(map[string]interface{}) + if trr.TaskID != nil { + objectMap["taskId"] = trr.TaskID + } + if trr.OverrideTaskStepProperties != nil { + objectMap["overrideTaskStepProperties"] = trr.OverrideTaskStepProperties + } + if trr.IsArchiveEnabled != nil { + objectMap["isArchiveEnabled"] = trr.IsArchiveEnabled + } + if trr.AgentPoolName != nil { + objectMap["agentPoolName"] = trr.AgentPoolName + } + if trr.LogTemplate != nil { + objectMap["logTemplate"] = trr.LogTemplate + } + if trr.Type != "" { + objectMap["type"] = trr.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsDockerBuildRequest() (*DockerBuildRequest, bool) { + return nil, false +} + +// AsFileTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsFileTaskRunRequest() (*FileTaskRunRequest, bool) { + return nil, false +} + +// AsTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsTaskRunRequest() (*TaskRunRequest, bool) { + return &trr, true +} + +// AsEncodedTaskRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsEncodedTaskRunRequest() (*EncodedTaskRunRequest, bool) { + return nil, false +} + +// AsRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsRunRequest() (*RunRequest, bool) { + return nil, false +} + +// AsBasicRunRequest is the BasicRunRequest implementation for TaskRunRequest. +func (trr TaskRunRequest) AsBasicRunRequest() (BasicRunRequest, bool) { + return &trr, true +} + +// TaskRunsCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TaskRunsCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TaskRunsClient) (TaskRun, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TaskRunsCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TaskRunsCreateFuture.Result. +func (future *TaskRunsCreateFuture) result(client TaskRunsClient) (tr TaskRun, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.TaskRunsCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { + tr, err = client.CreateResponder(tr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsCreateFuture", "Result", tr.Response.Response, "Failure responding to request") + } + } + return +} + +// TaskRunsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TaskRunsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TaskRunsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TaskRunsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TaskRunsDeleteFuture.Result. +func (future *TaskRunsDeleteFuture) result(client TaskRunsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.TaskRunsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// TaskRunsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type TaskRunsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TaskRunsClient) (TaskRun, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TaskRunsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TaskRunsUpdateFuture.Result. +func (future *TaskRunsUpdateFuture) result(client TaskRunsClient) (tr TaskRun, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + tr.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.TaskRunsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if tr.Response.Response, err = future.GetResult(sender); err == nil && tr.Response.Response.StatusCode != http.StatusNoContent { + tr, err = client.UpdateResponder(tr.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsUpdateFuture", "Result", tr.Response.Response, "Failure responding to request") + } + } + return +} + +// TaskRunUpdateParameters the parameters for updating a task run. +type TaskRunUpdateParameters struct { + // Identity - Identity for the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + // TaskRunPropertiesUpdateParameters - The properties for updating a task run. + *TaskRunPropertiesUpdateParameters `json:"properties,omitempty"` + // Location - The location of the resource + Location *string `json:"location,omitempty"` + // Tags - The ARM resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TaskRunUpdateParameters. +func (trup TaskRunUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if trup.Identity != nil { + objectMap["identity"] = trup.Identity + } + if trup.TaskRunPropertiesUpdateParameters != nil { + objectMap["properties"] = trup.TaskRunPropertiesUpdateParameters + } + if trup.Location != nil { + objectMap["location"] = trup.Location + } + if trup.Tags != nil { + objectMap["tags"] = trup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TaskRunUpdateParameters struct. +func (trup *TaskRunUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + trup.Identity = &identity + } + case "properties": + if v != nil { + var taskRunPropertiesUpdateParameters TaskRunPropertiesUpdateParameters + err = json.Unmarshal(*v, &taskRunPropertiesUpdateParameters) + if err != nil { + return err + } + trup.TaskRunPropertiesUpdateParameters = &taskRunPropertiesUpdateParameters + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + trup.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + trup.Tags = tags + } + } + } + + return nil +} + +// TasksCreateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TasksCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TasksClient) (Task, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TasksCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TasksCreateFuture.Result. +func (future *TasksCreateFuture) result(client TasksClient) (t Task, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + t.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.TasksCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent { + t, err = client.CreateResponder(t.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksCreateFuture", "Result", t.Response.Response, "Failure responding to request") + } + } + return +} + +// TasksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TasksDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TasksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TasksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TasksDeleteFuture.Result. +func (future *TasksDeleteFuture) result(client TasksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.TasksDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// BasicTaskStepProperties base properties for any task step. +type BasicTaskStepProperties interface { + AsDockerBuildStep() (*DockerBuildStep, bool) + AsFileTaskStep() (*FileTaskStep, bool) + AsEncodedTaskStep() (*EncodedTaskStep, bool) + AsTaskStepProperties() (*TaskStepProperties, bool) +} + +// TaskStepProperties base properties for any task step. +type TaskStepProperties struct { + // BaseImageDependencies - READ-ONLY; List of base image dependencies for a step. + BaseImageDependencies *[]BaseImageDependency `json:"baseImageDependencies,omitempty"` + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepPropertiesTypeTaskStepProperties', 'TypeBasicTaskStepPropertiesTypeDocker', 'TypeBasicTaskStepPropertiesTypeFileTask', 'TypeBasicTaskStepPropertiesTypeEncodedTask' + Type TypeBasicTaskStepProperties `json:"type,omitempty"` +} + +func unmarshalBasicTaskStepProperties(body []byte) (BasicTaskStepProperties, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeBasicTaskStepPropertiesTypeDocker): + var dbs DockerBuildStep + err := json.Unmarshal(body, &dbs) + return dbs, err + case string(TypeBasicTaskStepPropertiesTypeFileTask): + var fts FileTaskStep + err := json.Unmarshal(body, &fts) + return fts, err + case string(TypeBasicTaskStepPropertiesTypeEncodedTask): + var ets EncodedTaskStep + err := json.Unmarshal(body, &ets) + return ets, err + default: + var tsp TaskStepProperties + err := json.Unmarshal(body, &tsp) + return tsp, err + } +} +func unmarshalBasicTaskStepPropertiesArray(body []byte) ([]BasicTaskStepProperties, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tspArray := make([]BasicTaskStepProperties, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tsp, err := unmarshalBasicTaskStepProperties(*rawMessage) + if err != nil { + return nil, err + } + tspArray[index] = tsp + } + return tspArray, nil +} + +// MarshalJSON is the custom marshaler for TaskStepProperties. +func (tsp TaskStepProperties) MarshalJSON() ([]byte, error) { + tsp.Type = TypeBasicTaskStepPropertiesTypeTaskStepProperties + objectMap := make(map[string]interface{}) + if tsp.ContextPath != nil { + objectMap["contextPath"] = tsp.ContextPath + } + if tsp.ContextAccessToken != nil { + objectMap["contextAccessToken"] = tsp.ContextAccessToken + } + if tsp.Type != "" { + objectMap["type"] = tsp.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStep is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsDockerBuildStep() (*DockerBuildStep, bool) { + return nil, false +} + +// AsFileTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsFileTaskStep() (*FileTaskStep, bool) { + return nil, false +} + +// AsEncodedTaskStep is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsEncodedTaskStep() (*EncodedTaskStep, bool) { + return nil, false +} + +// AsTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsTaskStepProperties() (*TaskStepProperties, bool) { + return &tsp, true +} + +// AsBasicTaskStepProperties is the BasicTaskStepProperties implementation for TaskStepProperties. +func (tsp TaskStepProperties) AsBasicTaskStepProperties() (BasicTaskStepProperties, bool) { + return &tsp, true +} + +// BasicTaskStepUpdateParameters base properties for updating any task step. +type BasicTaskStepUpdateParameters interface { + AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) + AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) + AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) + AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) +} + +// TaskStepUpdateParameters base properties for updating any task step. +type TaskStepUpdateParameters struct { + // ContextPath - The URL(absolute or relative) of the source context for the task step. + ContextPath *string `json:"contextPath,omitempty"` + // ContextAccessToken - The token (git PAT or SAS token of storage account blob) associated with the context for a step. + ContextAccessToken *string `json:"contextAccessToken,omitempty"` + // Type - Possible values include: 'TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters', 'TypeBasicTaskStepUpdateParametersTypeDocker', 'TypeBasicTaskStepUpdateParametersTypeFileTask', 'TypeBasicTaskStepUpdateParametersTypeEncodedTask' + Type TypeBasicTaskStepUpdateParameters `json:"type,omitempty"` +} + +func unmarshalBasicTaskStepUpdateParameters(body []byte) (BasicTaskStepUpdateParameters, error) { + var m map[string]interface{} + err := json.Unmarshal(body, &m) + if err != nil { + return nil, err + } + + switch m["type"] { + case string(TypeBasicTaskStepUpdateParametersTypeDocker): + var dbsup DockerBuildStepUpdateParameters + err := json.Unmarshal(body, &dbsup) + return dbsup, err + case string(TypeBasicTaskStepUpdateParametersTypeFileTask): + var ftsup FileTaskStepUpdateParameters + err := json.Unmarshal(body, &ftsup) + return ftsup, err + case string(TypeBasicTaskStepUpdateParametersTypeEncodedTask): + var etsup EncodedTaskStepUpdateParameters + err := json.Unmarshal(body, &etsup) + return etsup, err + default: + var tsup TaskStepUpdateParameters + err := json.Unmarshal(body, &tsup) + return tsup, err + } +} +func unmarshalBasicTaskStepUpdateParametersArray(body []byte) ([]BasicTaskStepUpdateParameters, error) { + var rawMessages []*json.RawMessage + err := json.Unmarshal(body, &rawMessages) + if err != nil { + return nil, err + } + + tsupArray := make([]BasicTaskStepUpdateParameters, len(rawMessages)) + + for index, rawMessage := range rawMessages { + tsup, err := unmarshalBasicTaskStepUpdateParameters(*rawMessage) + if err != nil { + return nil, err + } + tsupArray[index] = tsup + } + return tsupArray, nil +} + +// MarshalJSON is the custom marshaler for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) MarshalJSON() ([]byte, error) { + tsup.Type = TypeBasicTaskStepUpdateParametersTypeTaskStepUpdateParameters + objectMap := make(map[string]interface{}) + if tsup.ContextPath != nil { + objectMap["contextPath"] = tsup.ContextPath + } + if tsup.ContextAccessToken != nil { + objectMap["contextAccessToken"] = tsup.ContextAccessToken + } + if tsup.Type != "" { + objectMap["type"] = tsup.Type + } + return json.Marshal(objectMap) +} + +// AsDockerBuildStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsDockerBuildStepUpdateParameters() (*DockerBuildStepUpdateParameters, bool) { + return nil, false +} + +// AsFileTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsFileTaskStepUpdateParameters() (*FileTaskStepUpdateParameters, bool) { + return nil, false +} + +// AsEncodedTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsEncodedTaskStepUpdateParameters() (*EncodedTaskStepUpdateParameters, bool) { + return nil, false +} + +// AsTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsTaskStepUpdateParameters() (*TaskStepUpdateParameters, bool) { + return &tsup, true +} + +// AsBasicTaskStepUpdateParameters is the BasicTaskStepUpdateParameters implementation for TaskStepUpdateParameters. +func (tsup TaskStepUpdateParameters) AsBasicTaskStepUpdateParameters() (BasicTaskStepUpdateParameters, bool) { + return &tsup, true +} + +// TasksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type TasksUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(TasksClient) (Task, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *TasksUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for TasksUpdateFuture.Result. +func (future *TasksUpdateFuture) result(client TasksClient) (t Task, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + t.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.TasksUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if t.Response.Response, err = future.GetResult(sender); err == nil && t.Response.Response.StatusCode != http.StatusNoContent { + t, err = client.UpdateResponder(t.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksUpdateFuture", "Result", t.Response.Response, "Failure responding to request") + } + } + return +} + +// TaskUpdateParameters the parameters for updating a task. +type TaskUpdateParameters struct { + // Identity - Identity for the resource. + Identity *IdentityProperties `json:"identity,omitempty"` + // TaskPropertiesUpdateParameters - The properties for updating a task. + *TaskPropertiesUpdateParameters `json:"properties,omitempty"` + // Tags - The ARM resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TaskUpdateParameters. +func (tup TaskUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tup.Identity != nil { + objectMap["identity"] = tup.Identity + } + if tup.TaskPropertiesUpdateParameters != nil { + objectMap["properties"] = tup.TaskPropertiesUpdateParameters + } + if tup.Tags != nil { + objectMap["tags"] = tup.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for TaskUpdateParameters struct. +func (tup *TaskUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "identity": + if v != nil { + var identity IdentityProperties + err = json.Unmarshal(*v, &identity) + if err != nil { + return err + } + tup.Identity = &identity + } + case "properties": + if v != nil { + var taskPropertiesUpdateParameters TaskPropertiesUpdateParameters + err = json.Unmarshal(*v, &taskPropertiesUpdateParameters) + if err != nil { + return err + } + tup.TaskPropertiesUpdateParameters = &taskPropertiesUpdateParameters + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + tup.Tags = tags + } + } + } + + return nil +} + +// TimerTrigger the properties of a timer trigger. +type TimerTrigger struct { + // Schedule - The CRON expression for the task schedule + Schedule *string `json:"schedule,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// TimerTriggerDescriptor ... +type TimerTriggerDescriptor struct { + // TimerTriggerName - The timer trigger name that caused the run. + TimerTriggerName *string `json:"timerTriggerName,omitempty"` + // ScheduleOccurrence - The occurrence that triggered the run. + ScheduleOccurrence *string `json:"scheduleOccurrence,omitempty"` +} + +// TimerTriggerUpdateParameters the properties for updating a timer trigger. +type TimerTriggerUpdateParameters struct { + // Schedule - The CRON expression for the task schedule + Schedule *string `json:"schedule,omitempty"` + // Status - The current status of trigger. Possible values include: 'TriggerStatusDisabled', 'TriggerStatusEnabled' + Status TriggerStatus `json:"status,omitempty"` + // Name - The name of the trigger. + Name *string `json:"name,omitempty"` +} + +// TriggerProperties the properties of a trigger. +type TriggerProperties struct { + // TimerTriggers - The collection of timer triggers. + TimerTriggers *[]TimerTrigger `json:"timerTriggers,omitempty"` + // SourceTriggers - The collection of triggers based on source code repository. + SourceTriggers *[]SourceTrigger `json:"sourceTriggers,omitempty"` + // BaseImageTrigger - The trigger based on base image dependencies. + BaseImageTrigger *BaseImageTrigger `json:"baseImageTrigger,omitempty"` +} + +// TriggerUpdateParameters the properties for updating triggers. +type TriggerUpdateParameters struct { + // TimerTriggers - The collection of timer triggers. + TimerTriggers *[]TimerTriggerUpdateParameters `json:"timerTriggers,omitempty"` + // SourceTriggers - The collection of triggers based on source code repository. + SourceTriggers *[]SourceTriggerUpdateParameters `json:"sourceTriggers,omitempty"` + // BaseImageTrigger - The trigger based on base image dependencies. + BaseImageTrigger *BaseImageTriggerUpdateParameters `json:"baseImageTrigger,omitempty"` +} + +// TrustPolicy the content trust policy for a container registry. +type TrustPolicy struct { + // Type - The type of trust policy. Possible values include: 'TrustPolicyTypeNotary' + Type TrustPolicyType `json:"type,omitempty"` + // Status - The value that indicates whether the policy is enabled or not. Possible values include: 'PolicyStatusEnabled', 'PolicyStatusDisabled' + Status PolicyStatus `json:"status,omitempty"` +} + +// UserIdentityProperties ... +type UserIdentityProperties struct { + // PrincipalID - The principal id of user assigned identity. + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - The client id of user assigned identity. + ClientID *string `json:"clientId,omitempty"` +} + +// Webhook an object that represents a webhook for a container registry. +type Webhook struct { + autorest.Response `json:"-"` + // WebhookProperties - The properties of the webhook. + *WebhookProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource ID. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. + Type *string `json:"type,omitempty"` + // Location - The location of the resource. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // Tags - The tags of the resource. + Tags map[string]*string `json:"tags"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the resource. + SystemData *SystemData `json:"systemData,omitempty"` +} + +// MarshalJSON is the custom marshaler for Webhook. +func (w Webhook) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if w.WebhookProperties != nil { + objectMap["properties"] = w.WebhookProperties + } + if w.Location != nil { + objectMap["location"] = w.Location + } + if w.Tags != nil { + objectMap["tags"] = w.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Webhook struct. +func (w *Webhook) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var webhookProperties WebhookProperties + err = json.Unmarshal(*v, &webhookProperties) + if err != nil { + return err + } + w.WebhookProperties = &webhookProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + w.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + w.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + w.Type = &typeVar + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + w.Location = &location + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + w.Tags = tags + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + w.SystemData = &systemData + } + } + } + + return nil +} + +// WebhookCreateParameters the parameters for creating a webhook. +type WebhookCreateParameters struct { + // Tags - The tags for the webhook. + Tags map[string]*string `json:"tags"` + // Location - The location of the webhook. This cannot be changed after the resource is created. + Location *string `json:"location,omitempty"` + // WebhookPropertiesCreateParameters - The properties that the webhook will be created with. + *WebhookPropertiesCreateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookCreateParameters. +func (wcp WebhookCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wcp.Tags != nil { + objectMap["tags"] = wcp.Tags + } + if wcp.Location != nil { + objectMap["location"] = wcp.Location + } + if wcp.WebhookPropertiesCreateParameters != nil { + objectMap["properties"] = wcp.WebhookPropertiesCreateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookCreateParameters struct. +func (wcp *WebhookCreateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wcp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + wcp.Location = &location + } + case "properties": + if v != nil { + var webhookPropertiesCreateParameters WebhookPropertiesCreateParameters + err = json.Unmarshal(*v, &webhookPropertiesCreateParameters) + if err != nil { + return err + } + wcp.WebhookPropertiesCreateParameters = &webhookPropertiesCreateParameters + } + } + } + + return nil +} + +// WebhookListResult the result of a request to list webhooks for a container registry. +type WebhookListResult struct { + autorest.Response `json:"-"` + // Value - The list of webhooks. Since this list may be incomplete, the nextLink field should be used to request the next list of webhooks. + Value *[]Webhook `json:"value,omitempty"` + // NextLink - The URI that can be used to request the next list of webhooks. + NextLink *string `json:"nextLink,omitempty"` +} + +// WebhookListResultIterator provides access to a complete listing of Webhook values. +type WebhookListResultIterator struct { + i int + page WebhookListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *WebhookListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *WebhookListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter WebhookListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter WebhookListResultIterator) Response() WebhookListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter WebhookListResultIterator) Value() Webhook { + if !iter.page.NotDone() { + return Webhook{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the WebhookListResultIterator type. +func NewWebhookListResultIterator(page WebhookListResultPage) WebhookListResultIterator { + return WebhookListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (wlr WebhookListResult) IsEmpty() bool { + return wlr.Value == nil || len(*wlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (wlr WebhookListResult) hasNextLink() bool { + return wlr.NextLink != nil && len(*wlr.NextLink) != 0 +} + +// webhookListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (wlr WebhookListResult) webhookListResultPreparer(ctx context.Context) (*http.Request, error) { + if !wlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(wlr.NextLink))) +} + +// WebhookListResultPage contains a page of Webhook values. +type WebhookListResultPage struct { + fn func(context.Context, WebhookListResult) (WebhookListResult, error) + wlr WebhookListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *WebhookListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhookListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.wlr) + if err != nil { + return err + } + page.wlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *WebhookListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page WebhookListResultPage) NotDone() bool { + return !page.wlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page WebhookListResultPage) Response() WebhookListResult { + return page.wlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page WebhookListResultPage) Values() []Webhook { + if page.wlr.IsEmpty() { + return nil + } + return *page.wlr.Value +} + +// Creates a new instance of the WebhookListResultPage type. +func NewWebhookListResultPage(cur WebhookListResult, getNextPage func(context.Context, WebhookListResult) (WebhookListResult, error)) WebhookListResultPage { + return WebhookListResultPage{ + fn: getNextPage, + wlr: cur, + } +} + +// WebhookProperties the properties of a webhook. +type WebhookProperties struct { + // Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled' + Status WebhookStatus `json:"status,omitempty"` + // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + Scope *string `json:"scope,omitempty"` + // Actions - The list of actions that trigger the webhook to post notifications. + Actions *[]WebhookAction `json:"actions,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state of the webhook at the time the operation was called. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateCanceled' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookProperties. +func (wp WebhookProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wp.Status != "" { + objectMap["status"] = wp.Status + } + if wp.Scope != nil { + objectMap["scope"] = wp.Scope + } + if wp.Actions != nil { + objectMap["actions"] = wp.Actions + } + return json.Marshal(objectMap) +} + +// WebhookPropertiesCreateParameters the parameters for creating the properties of a webhook. +type WebhookPropertiesCreateParameters struct { + // ServiceURI - The service URI for the webhook to post notifications. + ServiceURI *string `json:"serviceUri,omitempty"` + // CustomHeaders - Custom headers that will be added to the webhook notifications. + CustomHeaders map[string]*string `json:"customHeaders"` + // Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled' + Status WebhookStatus `json:"status,omitempty"` + // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + Scope *string `json:"scope,omitempty"` + // Actions - The list of actions that trigger the webhook to post notifications. + Actions *[]WebhookAction `json:"actions,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookPropertiesCreateParameters. +func (wpcp WebhookPropertiesCreateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpcp.ServiceURI != nil { + objectMap["serviceUri"] = wpcp.ServiceURI + } + if wpcp.CustomHeaders != nil { + objectMap["customHeaders"] = wpcp.CustomHeaders + } + if wpcp.Status != "" { + objectMap["status"] = wpcp.Status + } + if wpcp.Scope != nil { + objectMap["scope"] = wpcp.Scope + } + if wpcp.Actions != nil { + objectMap["actions"] = wpcp.Actions + } + return json.Marshal(objectMap) +} + +// WebhookPropertiesUpdateParameters the parameters for updating the properties of a webhook. +type WebhookPropertiesUpdateParameters struct { + // ServiceURI - The service URI for the webhook to post notifications. + ServiceURI *string `json:"serviceUri,omitempty"` + // CustomHeaders - Custom headers that will be added to the webhook notifications. + CustomHeaders map[string]*string `json:"customHeaders"` + // Status - The status of the webhook at the time the operation was called. Possible values include: 'WebhookStatusEnabled', 'WebhookStatusDisabled' + Status WebhookStatus `json:"status,omitempty"` + // Scope - The scope of repositories where the event can be triggered. For example, 'foo:*' means events for all tags under repository 'foo'. 'foo:bar' means events for 'foo:bar' only. 'foo' is equivalent to 'foo:latest'. Empty means all events. + Scope *string `json:"scope,omitempty"` + // Actions - The list of actions that trigger the webhook to post notifications. + Actions *[]WebhookAction `json:"actions,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookPropertiesUpdateParameters. +func (wpup WebhookPropertiesUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wpup.ServiceURI != nil { + objectMap["serviceUri"] = wpup.ServiceURI + } + if wpup.CustomHeaders != nil { + objectMap["customHeaders"] = wpup.CustomHeaders + } + if wpup.Status != "" { + objectMap["status"] = wpup.Status + } + if wpup.Scope != nil { + objectMap["scope"] = wpup.Scope + } + if wpup.Actions != nil { + objectMap["actions"] = wpup.Actions + } + return json.Marshal(objectMap) +} + +// WebhooksCreateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WebhooksCreateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebhooksClient) (Webhook, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebhooksCreateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WebhooksCreateFuture.Result. +func (future *WebhooksCreateFuture) result(client WebhooksClient) (w Webhook, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + w.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksCreateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { + w, err = client.CreateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksCreateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WebhooksDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WebhooksDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebhooksClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebhooksDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WebhooksDeleteFuture.Result. +func (future *WebhooksDeleteFuture) result(client WebhooksClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// WebhooksUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type WebhooksUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(WebhooksClient) (Webhook, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *WebhooksUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for WebhooksUpdateFuture.Result. +func (future *WebhooksUpdateFuture) result(client WebhooksClient) (w Webhook, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + w.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("containerregistry.WebhooksUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if w.Response.Response, err = future.GetResult(sender); err == nil && w.Response.Response.StatusCode != http.StatusNoContent { + w, err = client.UpdateResponder(w.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksUpdateFuture", "Result", w.Response.Response, "Failure responding to request") + } + } + return +} + +// WebhookUpdateParameters the parameters for updating a webhook. +type WebhookUpdateParameters struct { + // Tags - The tags for the webhook. + Tags map[string]*string `json:"tags"` + // WebhookPropertiesUpdateParameters - The properties that the webhook will be updated with. + *WebhookPropertiesUpdateParameters `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for WebhookUpdateParameters. +func (wup WebhookUpdateParameters) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if wup.Tags != nil { + objectMap["tags"] = wup.Tags + } + if wup.WebhookPropertiesUpdateParameters != nil { + objectMap["properties"] = wup.WebhookPropertiesUpdateParameters + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for WebhookUpdateParameters struct. +func (wup *WebhookUpdateParameters) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + wup.Tags = tags + } + case "properties": + if v != nil { + var webhookPropertiesUpdateParameters WebhookPropertiesUpdateParameters + err = json.Unmarshal(*v, &webhookPropertiesUpdateParameters) + if err != nil { + return err + } + wup.WebhookPropertiesUpdateParameters = &webhookPropertiesUpdateParameters + } + } + } + + return nil +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/operations.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/operations.go new file mode 100644 index 000000000000..cc68ddc33d9a --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/operations.go @@ -0,0 +1,140 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Containerregistry service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available Azure Container Registry REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.ContainerRegistry/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/privateendpointconnections.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/privateendpointconnections.go new file mode 100644 index 000000000000..7f9ded2752f1 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/privateendpointconnections.go @@ -0,0 +1,434 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the client for the PrivateEndpointConnections methods of the Containerregistry +// service. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate update the state of specified private endpoint connection associated with the container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// privateEndpointConnectionName - the name of the private endpoint connection. +// privateEndpointConnection - the parameters for creating a private endpoint connection. +func (client PrivateEndpointConnectionsClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (result PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.PrivateEndpointConnectionsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, registryName, privateEndpointConnectionName, privateEndpointConnection) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client PrivateEndpointConnectionsClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointConnection), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateSender(req *http.Request) (future PrivateEndpointConnectionsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) CreateOrUpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes the specified private endpoint connection associated with the container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.PrivateEndpointConnectionsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the specified private endpoint connection associated with the container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// privateEndpointConnectionName - the name of the private endpoint connection. +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.PrivateEndpointConnectionsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list all private endpoint connections in a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result PrivateEndpointConnectionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") + defer func() { + sc := -1 + if result.peclr.Response.Response != nil { + sc = result.peclr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.PrivateEndpointConnectionsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.peclr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result.peclr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + return + } + if result.peclr.hasNextLink() && result.peclr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result PrivateEndpointConnectionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client PrivateEndpointConnectionsClient) listNextResults(ctx context.Context, lastResults PrivateEndpointConnectionListResult) (result PrivateEndpointConnectionListResult, err error) { + req, err := lastResults.privateEndpointConnectionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.PrivateEndpointConnectionsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client PrivateEndpointConnectionsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result PrivateEndpointConnectionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/registries.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/registries.go new file mode 100644 index 000000000000..1a1c622d18fa --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/registries.go @@ -0,0 +1,1467 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RegistriesClient is the client for the Registries methods of the Containerregistry service. +type RegistriesClient struct { + BaseClient +} + +// NewRegistriesClient creates an instance of the RegistriesClient client. +func NewRegistriesClient(subscriptionID string) RegistriesClient { + return NewRegistriesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRegistriesClientWithBaseURI creates an instance of the RegistriesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRegistriesClientWithBaseURI(baseURI string, subscriptionID string) RegistriesClient { + return RegistriesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability checks whether the container registry name is available for use. The name must contain only +// alphanumeric characters, be globally unique, and between 5 and 50 characters in length. +// Parameters: +// registryNameCheckRequest - the object containing information for the availability request. +func (client RegistriesClient) CheckNameAvailability(ctx context.Context, registryNameCheckRequest RegistryNameCheckRequest) (result RegistryNameStatus, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: registryNameCheckRequest, + Constraints: []validation.Constraint{{Target: "registryNameCheckRequest.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "registryNameCheckRequest.Name", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryNameCheckRequest.Name", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryNameCheckRequest.Name", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}, + }}, + {Target: "registryNameCheckRequest.Type", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, registryNameCheckRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client RegistriesClient) CheckNameAvailabilityPreparer(ctx context.Context, registryNameCheckRequest RegistryNameCheckRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/checkNameAvailability", pathParameters), + autorest.WithJSON(registryNameCheckRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client RegistriesClient) CheckNameAvailabilityResponder(resp *http.Response) (result RegistryNameStatus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Create creates a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// registry - the parameters for creating a container registry. +func (client RegistriesClient) Create(ctx context.Context, resourceGroupName string, registryName string, registry Registry) (result RegistriesCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: registry, + Constraints: []validation.Constraint{{Target: "registry.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, registry) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client RegistriesClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, registry Registry) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithJSON(registry), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) CreateSender(req *http.Request) (future RegistriesCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client RegistriesClient) CreateResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) Delete(ctx context.Context, resourceGroupName string, registryName string) (result RegistriesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client RegistriesClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) DeleteSender(req *http.Request) (future RegistriesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client RegistriesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) Get(ctx context.Context, resourceGroupName string, registryName string) (result Registry, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RegistriesClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RegistriesClient) GetResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetBuildSourceUploadURL get the upload location for the user to be able to upload the source. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) GetBuildSourceUploadURL(ctx context.Context, resourceGroupName string, registryName string) (result SourceUploadDefinition, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.GetBuildSourceUploadURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "GetBuildSourceUploadURL", err.Error()) + } + + req, err := client.GetBuildSourceUploadURLPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetBuildSourceUploadURL", nil, "Failure preparing request") + return + } + + resp, err := client.GetBuildSourceUploadURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetBuildSourceUploadURL", resp, "Failure sending request") + return + } + + result, err = client.GetBuildSourceUploadURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetBuildSourceUploadURL", resp, "Failure responding to request") + return + } + + return +} + +// GetBuildSourceUploadURLPreparer prepares the GetBuildSourceUploadURL request. +func (client RegistriesClient) GetBuildSourceUploadURLPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listBuildSourceUploadUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetBuildSourceUploadURLSender sends the GetBuildSourceUploadURL request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) GetBuildSourceUploadURLSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetBuildSourceUploadURLResponder handles the response to the GetBuildSourceUploadURL request. The method always +// closes the http.Response Body. +func (client RegistriesClient) GetBuildSourceUploadURLResponder(resp *http.Response) (result SourceUploadDefinition, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetPrivateLinkResource gets a private link resource by a specified group name for a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// groupName - the name of the private link resource. +func (client RegistriesClient) GetPrivateLinkResource(ctx context.Context, resourceGroupName string, registryName string, groupName string) (result PrivateLinkResource, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.GetPrivateLinkResource") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "GetPrivateLinkResource", err.Error()) + } + + req, err := client.GetPrivateLinkResourcePreparer(ctx, resourceGroupName, registryName, groupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetPrivateLinkResource", nil, "Failure preparing request") + return + } + + resp, err := client.GetPrivateLinkResourceSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetPrivateLinkResource", resp, "Failure sending request") + return + } + + result, err = client.GetPrivateLinkResourceResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "GetPrivateLinkResource", resp, "Failure responding to request") + return + } + + return +} + +// GetPrivateLinkResourcePreparer prepares the GetPrivateLinkResource request. +func (client RegistriesClient) GetPrivateLinkResourcePreparer(ctx context.Context, resourceGroupName string, registryName string, groupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupName": autorest.Encode("path", groupName), + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources/{groupName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetPrivateLinkResourceSender sends the GetPrivateLinkResource request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) GetPrivateLinkResourceSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetPrivateLinkResourceResponder handles the response to the GetPrivateLinkResource request. The method always +// closes the http.Response Body. +func (client RegistriesClient) GetPrivateLinkResourceResponder(resp *http.Response) (result PrivateLinkResource, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ImportImage copies an image to this container registry from the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// parameters - the parameters specifying the image to copy and the source container registry. +func (client RegistriesClient) ImportImage(ctx context.Context, resourceGroupName string, registryName string, parameters ImportImageParameters) (result RegistriesImportImageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ImportImage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: parameters, + Constraints: []validation.Constraint{{Target: "parameters.Source", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "parameters.Source.Credentials", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "parameters.Source.Credentials.Password", Name: validation.Null, Rule: true, Chain: nil}}}, + {Target: "parameters.Source.SourceImage", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ImportImage", err.Error()) + } + + req, err := client.ImportImagePreparer(ctx, resourceGroupName, registryName, parameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ImportImage", nil, "Failure preparing request") + return + } + + result, err = client.ImportImageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ImportImage", result.Response(), "Failure sending request") + return + } + + return +} + +// ImportImagePreparer prepares the ImportImage request. +func (client RegistriesClient) ImportImagePreparer(ctx context.Context, resourceGroupName string, registryName string, parameters ImportImageParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/importImage", pathParameters), + autorest.WithJSON(parameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ImportImageSender sends the ImportImage request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ImportImageSender(req *http.Request) (future RegistriesImportImageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ImportImageResponder handles the response to the ImportImage request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ImportImageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// List lists all the container registries under the specified subscription. +func (client RegistriesClient) List(ctx context.Context) (result RegistryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.List") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RegistriesClient) ListPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.ContainerRegistry/registries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListResponder(resp *http.Response) (result RegistryListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RegistriesClient) listNextResults(ctx context.Context, lastResults RegistryListResult) (result RegistryListResult, err error) { + req, err := lastResults.registryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegistriesClient) ListComplete(ctx context.Context) (result RegistryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} + +// ListByResourceGroup lists all the container registries under the specified resource group. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +func (client RegistriesClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result RegistryListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client RegistriesClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListByResourceGroupResponder(resp *http.Response) (result RegistryListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client RegistriesClient) listByResourceGroupNextResults(ctx context.Context, lastResults RegistryListResult) (result RegistryListResult, err error) { + req, err := lastResults.registryListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegistriesClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result RegistryListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListCredentials lists the login credentials for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) ListCredentials(ctx context.Context, resourceGroupName string, registryName string) (result RegistryListCredentialsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListCredentials") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListCredentials", err.Error()) + } + + req, err := client.ListCredentialsPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", nil, "Failure preparing request") + return + } + + resp, err := client.ListCredentialsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", resp, "Failure sending request") + return + } + + result, err = client.ListCredentialsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListCredentials", resp, "Failure responding to request") + return + } + + return +} + +// ListCredentialsPreparer prepares the ListCredentials request. +func (client RegistriesClient) ListCredentialsPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listCredentials", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListCredentialsSender sends the ListCredentials request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListCredentialsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListCredentialsResponder handles the response to the ListCredentials request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListCredentialsResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListPrivateLinkResources lists the private link resources for a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) ListPrivateLinkResources(ctx context.Context, resourceGroupName string, registryName string) (result PrivateLinkResourceListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListPrivateLinkResources") + defer func() { + sc := -1 + if result.plrlr.Response.Response != nil { + sc = result.plrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListPrivateLinkResources", err.Error()) + } + + result.fn = client.listPrivateLinkResourcesNextResults + req, err := client.ListPrivateLinkResourcesPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListPrivateLinkResources", nil, "Failure preparing request") + return + } + + resp, err := client.ListPrivateLinkResourcesSender(req) + if err != nil { + result.plrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListPrivateLinkResources", resp, "Failure sending request") + return + } + + result.plrlr, err = client.ListPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListPrivateLinkResources", resp, "Failure responding to request") + return + } + if result.plrlr.hasNextLink() && result.plrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPrivateLinkResourcesPreparer prepares the ListPrivateLinkResources request. +func (client RegistriesClient) ListPrivateLinkResourcesPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListPrivateLinkResourcesSender sends the ListPrivateLinkResources request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListPrivateLinkResourcesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListPrivateLinkResourcesResponder handles the response to the ListPrivateLinkResources request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListPrivateLinkResourcesResponder(resp *http.Response) (result PrivateLinkResourceListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listPrivateLinkResourcesNextResults retrieves the next set of results, if any. +func (client RegistriesClient) listPrivateLinkResourcesNextResults(ctx context.Context, lastResults PrivateLinkResourceListResult) (result PrivateLinkResourceListResult, err error) { + req, err := lastResults.privateLinkResourceListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listPrivateLinkResourcesNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListPrivateLinkResourcesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listPrivateLinkResourcesNextResults", resp, "Failure sending next results request") + } + result, err = client.ListPrivateLinkResourcesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "listPrivateLinkResourcesNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListPrivateLinkResourcesComplete enumerates all values, automatically crossing page boundaries as required. +func (client RegistriesClient) ListPrivateLinkResourcesComplete(ctx context.Context, resourceGroupName string, registryName string) (result PrivateLinkResourceListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListPrivateLinkResources") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListPrivateLinkResources(ctx, resourceGroupName, registryName) + return +} + +// ListUsages gets the quota usages for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client RegistriesClient) ListUsages(ctx context.Context, resourceGroupName string, registryName string) (result RegistryUsageListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ListUsages") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ListUsages", err.Error()) + } + + req, err := client.ListUsagesPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", nil, "Failure preparing request") + return + } + + resp, err := client.ListUsagesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure sending request") + return + } + + result, err = client.ListUsagesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ListUsages", resp, "Failure responding to request") + return + } + + return +} + +// ListUsagesPreparer prepares the ListUsages request. +func (client RegistriesClient) ListUsagesPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/listUsages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListUsagesSender sends the ListUsages request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ListUsagesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListUsagesResponder handles the response to the ListUsages request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ListUsagesResponder(resp *http.Response) (result RegistryUsageListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// RegenerateCredential regenerates one of the login credentials for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// regenerateCredentialParameters - specifies name of the password which should be regenerated -- password or +// password2. +func (client RegistriesClient) RegenerateCredential(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters) (result RegistryListCredentialsResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.RegenerateCredential") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "RegenerateCredential", err.Error()) + } + + req, err := client.RegenerateCredentialPreparer(ctx, resourceGroupName, registryName, regenerateCredentialParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", nil, "Failure preparing request") + return + } + + resp, err := client.RegenerateCredentialSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", resp, "Failure sending request") + return + } + + result, err = client.RegenerateCredentialResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "RegenerateCredential", resp, "Failure responding to request") + return + } + + return +} + +// RegenerateCredentialPreparer prepares the RegenerateCredential request. +func (client RegistriesClient) RegenerateCredentialPreparer(ctx context.Context, resourceGroupName string, registryName string, regenerateCredentialParameters RegenerateCredentialParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/regenerateCredential", pathParameters), + autorest.WithJSON(regenerateCredentialParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RegenerateCredentialSender sends the RegenerateCredential request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) RegenerateCredentialSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// RegenerateCredentialResponder handles the response to the RegenerateCredential request. The method always +// closes the http.Response Body. +func (client RegistriesClient) RegenerateCredentialResponder(resp *http.Response) (result RegistryListCredentialsResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ScheduleRun schedules a new run based on the request parameters and add it to the run queue. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// runRequest - the parameters of a run that needs to scheduled. +func (client RegistriesClient) ScheduleRun(ctx context.Context, resourceGroupName string, registryName string, runRequest BasicRunRequest) (result RegistriesScheduleRunFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.ScheduleRun") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "ScheduleRun", err.Error()) + } + + req, err := client.ScheduleRunPreparer(ctx, resourceGroupName, registryName, runRequest) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ScheduleRun", nil, "Failure preparing request") + return + } + + result, err = client.ScheduleRunSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "ScheduleRun", result.Response(), "Failure sending request") + return + } + + return +} + +// ScheduleRunPreparer prepares the ScheduleRun request. +func (client RegistriesClient) ScheduleRunPreparer(ctx context.Context, resourceGroupName string, registryName string, runRequest BasicRunRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/scheduleRun", pathParameters), + autorest.WithJSON(runRequest), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ScheduleRunSender sends the ScheduleRun request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) ScheduleRunSender(req *http.Request) (future RegistriesScheduleRunFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ScheduleRunResponder handles the response to the ScheduleRun request. The method always +// closes the http.Response Body. +func (client RegistriesClient) ScheduleRunResponder(resp *http.Response) (result Run, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// registryUpdateParameters - the parameters for updating a container registry. +func (client RegistriesClient) Update(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (result RegistriesUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RegistriesClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RegistriesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, registryUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RegistriesClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RegistriesClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, registryUpdateParameters RegistryUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}", pathParameters), + autorest.WithJSON(registryUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RegistriesClient) UpdateSender(req *http.Request) (future RegistriesUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RegistriesClient) UpdateResponder(resp *http.Response) (result Registry, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/replications.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/replications.go new file mode 100644 index 000000000000..d244688f1de9 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/replications.go @@ -0,0 +1,542 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ReplicationsClient is the client for the Replications methods of the Containerregistry service. +type ReplicationsClient struct { + BaseClient +} + +// NewReplicationsClient creates an instance of the ReplicationsClient client. +func NewReplicationsClient(subscriptionID string) ReplicationsClient { + return NewReplicationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewReplicationsClientWithBaseURI creates an instance of the ReplicationsClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewReplicationsClientWithBaseURI(baseURI string, subscriptionID string) ReplicationsClient { + return ReplicationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a replication for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +// replication - the parameters for creating a replication. +func (client ReplicationsClient) Create(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (result ReplicationsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, replicationName, replication) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client ReplicationsClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replication Replication) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithJSON(replication), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) CreateSender(req *http.Request) (future ReplicationsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) CreateResponder(resp *http.Response) (result Replication, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a replication from a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +func (client ReplicationsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result ReplicationsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, replicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client ReplicationsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) DeleteSender(req *http.Request) (future ReplicationsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified replication. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +func (client ReplicationsClient) Get(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (result Replication, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, replicationName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ReplicationsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) GetResponder(resp *http.Response) (result Replication, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the replications for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client ReplicationsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result ReplicationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.List") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client ReplicationsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) ListResponder(resp *http.Response) (result ReplicationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client ReplicationsClient) listNextResults(ctx context.Context, lastResults ReplicationListResult) (result ReplicationListResult, err error) { + req, err := lastResults.replicationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client ReplicationsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result ReplicationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// Update updates a replication for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// replicationName - the name of the replication. +// replicationUpdateParameters - the parameters for updating a replication. +func (client ReplicationsClient) Update(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (result ReplicationsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ReplicationsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: replicationName, + Constraints: []validation.Constraint{{Target: "replicationName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "replicationName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "replicationName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.ReplicationsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, replicationName, replicationUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.ReplicationsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ReplicationsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, replicationName string, replicationUpdateParameters ReplicationUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "replicationName": autorest.Encode("path", replicationName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/replications/{replicationName}", pathParameters), + autorest.WithJSON(replicationUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ReplicationsClient) UpdateSender(req *http.Request) (future ReplicationsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ReplicationsClient) UpdateResponder(resp *http.Response) (result Replication, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/runs.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/runs.go new file mode 100644 index 000000000000..7035b1e3c4f3 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/runs.go @@ -0,0 +1,529 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// RunsClient is the client for the Runs methods of the Containerregistry service. +type RunsClient struct { + BaseClient +} + +// NewRunsClient creates an instance of the RunsClient client. +func NewRunsClient(subscriptionID string) RunsClient { + return NewRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewRunsClientWithBaseURI creates an instance of the RunsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewRunsClientWithBaseURI(baseURI string, subscriptionID string) RunsClient { + return RunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Cancel cancel an existing run. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// runID - the run ID. +func (client RunsClient) Cancel(ctx context.Context, resourceGroupName string, registryName string, runID string) (result RunsCancelFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Cancel") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RunsClient", "Cancel", err.Error()) + } + + req, err := client.CancelPreparer(ctx, resourceGroupName, registryName, runID) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Cancel", nil, "Failure preparing request") + return + } + + result, err = client.CancelSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Cancel", result.Response(), "Failure sending request") + return + } + + return +} + +// CancelPreparer prepares the Cancel request. +func (client RunsClient) CancelPreparer(ctx context.Context, resourceGroupName string, registryName string, runID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/cancel", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CancelSender sends the Cancel request. The method will close the +// http.Response Body if it receives an error. +func (client RunsClient) CancelSender(req *http.Request) (future RunsCancelFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CancelResponder handles the response to the Cancel request. The method always +// closes the http.Response Body. +func (client RunsClient) CancelResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the detailed information for a given run. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// runID - the run ID. +func (client RunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, runID string) (result Run, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RunsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, runID) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client RunsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, runID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client RunsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client RunsClient) GetResponder(resp *http.Response) (result Run, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetLogSasURL gets a link to download the run logs. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// runID - the run ID. +func (client RunsClient) GetLogSasURL(ctx context.Context, resourceGroupName string, registryName string, runID string) (result RunGetLogResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.GetLogSasURL") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RunsClient", "GetLogSasURL", err.Error()) + } + + req, err := client.GetLogSasURLPreparer(ctx, resourceGroupName, registryName, runID) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", nil, "Failure preparing request") + return + } + + resp, err := client.GetLogSasURLSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", resp, "Failure sending request") + return + } + + result, err = client.GetLogSasURLResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "GetLogSasURL", resp, "Failure responding to request") + return + } + + return +} + +// GetLogSasURLPreparer prepares the GetLogSasURL request. +func (client RunsClient) GetLogSasURLPreparer(ctx context.Context, resourceGroupName string, registryName string, runID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}/listLogSasUrl", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetLogSasURLSender sends the GetLogSasURL request. The method will close the +// http.Response Body if it receives an error. +func (client RunsClient) GetLogSasURLSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetLogSasURLResponder handles the response to the GetLogSasURL request. The method always +// closes the http.Response Body. +func (client RunsClient) GetLogSasURLResponder(resp *http.Response) (result RunGetLogResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List gets all the runs for a registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// filter - the runs filter to apply on the operation. Arithmetic operators are not supported. The allowed +// string function is 'contains'. All logical operators except 'Not', 'Has', 'All' are allowed. +// top - $top is supported for get list of runs, which limits the maximum number of runs to return. +func (client RunsClient) List(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (result RunListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.List") + defer func() { + sc := -1 + if result.rlr.Response.Response != nil { + sc = result.rlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RunsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName, filter, top) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.rlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", resp, "Failure sending request") + return + } + + result.rlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "List", resp, "Failure responding to request") + return + } + if result.rlr.hasNextLink() && result.rlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client RunsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + if top != nil { + queryParameters["$top"] = autorest.Encode("query", *top) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client RunsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client RunsClient) ListResponder(resp *http.Response) (result RunListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client RunsClient) listNextResults(ctx context.Context, lastResults RunListResult) (result RunListResult, err error) { + req, err := lastResults.runListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.RunsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.RunsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client RunsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string, filter string, top *int32) (result RunListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName, filter, top) + return +} + +// Update patch the run properties. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// runID - the run ID. +// runUpdateParameters - the run update properties. +func (client RunsClient) Update(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters) (result RunsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/RunsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.RunsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, runID, runUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.RunsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client RunsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, runID string, runUpdateParameters RunUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "runId": autorest.Encode("path", runID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/runs/{runId}", pathParameters), + autorest.WithJSON(runUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client RunsClient) UpdateSender(req *http.Request) (future RunsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client RunsClient) UpdateResponder(resp *http.Response) (result Run, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/taskruns.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/taskruns.go new file mode 100644 index 000000000000..ee13d4b2d14f --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/taskruns.go @@ -0,0 +1,634 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TaskRunsClient is the client for the TaskRuns methods of the Containerregistry service. +type TaskRunsClient struct { + BaseClient +} + +// NewTaskRunsClient creates an instance of the TaskRunsClient client. +func NewTaskRunsClient(subscriptionID string) TaskRunsClient { + return NewTaskRunsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTaskRunsClientWithBaseURI creates an instance of the TaskRunsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTaskRunsClientWithBaseURI(baseURI string, subscriptionID string) TaskRunsClient { + return TaskRunsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a task run for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskRunName - the name of the task run. +// taskRun - the parameters of a run that needs to scheduled. +func (client TaskRunsClient) Create(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun TaskRun) (result TaskRunsCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskRunName, + Constraints: []validation.Constraint{{Target: "taskRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TaskRunsClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, taskRunName, taskRun) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TaskRunsClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, taskRun TaskRun) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskRunName": autorest.Encode("path", taskRunName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", pathParameters), + autorest.WithJSON(taskRun), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TaskRunsClient) CreateSender(req *http.Request) (future TaskRunsCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TaskRunsClient) CreateResponder(resp *http.Response) (result TaskRun, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a specified task run resource. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskRunName - the name of the task run. +func (client TaskRunsClient) Delete(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (result TaskRunsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskRunName, + Constraints: []validation.Constraint{{Target: "taskRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TaskRunsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, taskRunName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TaskRunsClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskRunName": autorest.Encode("path", taskRunName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TaskRunsClient) DeleteSender(req *http.Request) (future TaskRunsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TaskRunsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the detailed information for a given task run. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskRunName - the name of the task run. +func (client TaskRunsClient) Get(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (result TaskRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskRunName, + Constraints: []validation.Constraint{{Target: "taskRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TaskRunsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, taskRunName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client TaskRunsClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskRunName": autorest.Encode("path", taskRunName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TaskRunsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TaskRunsClient) GetResponder(resp *http.Response) (result TaskRun, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDetails gets the detailed information for a given task run that includes all secrets. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskRunName - the name of the task run. +func (client TaskRunsClient) GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (result TaskRun, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.GetDetails") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskRunName, + Constraints: []validation.Constraint{{Target: "taskRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TaskRunsClient", "GetDetails", err.Error()) + } + + req, err := client.GetDetailsPreparer(ctx, resourceGroupName, registryName, taskRunName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "GetDetails", nil, "Failure preparing request") + return + } + + resp, err := client.GetDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "GetDetails", resp, "Failure sending request") + return + } + + result, err = client.GetDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "GetDetails", resp, "Failure responding to request") + return + } + + return +} + +// GetDetailsPreparer prepares the GetDetails request. +func (client TaskRunsClient) GetDetailsPreparer(ctx context.Context, resourceGroupName string, registryName string, taskRunName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskRunName": autorest.Encode("path", taskRunName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}/listDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDetailsSender sends the GetDetails request. The method will close the +// http.Response Body if it receives an error. +func (client TaskRunsClient) GetDetailsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDetailsResponder handles the response to the GetDetails request. The method always +// closes the http.Response Body. +func (client TaskRunsClient) GetDetailsResponder(resp *http.Response) (result TaskRun, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the task runs for a specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client TaskRunsClient) List(ctx context.Context, resourceGroupName string, registryName string) (result TaskRunListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.List") + defer func() { + sc := -1 + if result.trlr.Response.Response != nil { + sc = result.trlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TaskRunsClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.trlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "List", resp, "Failure sending request") + return + } + + result.trlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "List", resp, "Failure responding to request") + return + } + if result.trlr.hasNextLink() && result.trlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client TaskRunsClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client TaskRunsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client TaskRunsClient) ListResponder(resp *http.Response) (result TaskRunListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client TaskRunsClient) listNextResults(ctx context.Context, lastResults TaskRunListResult) (result TaskRunListResult, err error) { + req, err := lastResults.taskRunListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TaskRunsClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result TaskRunListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// Update updates a task run with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskRunName - the name of the task run. +// updateParameters - the parameters for updating a task run. +func (client TaskRunsClient) Update(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters TaskRunUpdateParameters) (result TaskRunsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TaskRunsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskRunName, + Constraints: []validation.Constraint{{Target: "taskRunName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskRunName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskRunName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TaskRunsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, taskRunName, updateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TaskRunsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TaskRunsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, taskRunName string, updateParameters TaskRunUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskRunName": autorest.Encode("path", taskRunName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/taskRuns/{taskRunName}", pathParameters), + autorest.WithJSON(updateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client TaskRunsClient) UpdateSender(req *http.Request) (future TaskRunsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client TaskRunsClient) UpdateResponder(resp *http.Response) (result TaskRun, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/tasks.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/tasks.go new file mode 100644 index 000000000000..3af51765a125 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/tasks.go @@ -0,0 +1,645 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// TasksClient is the client for the Tasks methods of the Containerregistry service. +type TasksClient struct { + BaseClient +} + +// NewTasksClient creates an instance of the TasksClient client. +func NewTasksClient(subscriptionID string) TasksClient { + return NewTasksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewTasksClientWithBaseURI creates an instance of the TasksClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewTasksClientWithBaseURI(baseURI string, subscriptionID string) TasksClient { + return TasksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a task for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskName - the name of the container registry task. +// taskCreateParameters - the parameters for creating a task. +func (client TasksClient) Create(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters Task) (result TasksCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskName, + Constraints: []validation.Constraint{{Target: "taskName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}, + {TargetValue: taskCreateParameters, + Constraints: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Timeout", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Timeout", Name: validation.InclusiveMaximum, Rule: int64(28800), Chain: nil}, + {Target: "taskCreateParameters.TaskProperties.Timeout", Name: validation.InclusiveMinimum, Rule: int64(300), Chain: nil}, + }}, + {Target: "taskCreateParameters.TaskProperties.Trigger", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Trigger.BaseImageTrigger", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "taskCreateParameters.TaskProperties.Trigger.BaseImageTrigger.Name", Name: validation.Null, Rule: true, Chain: nil}}}, + }}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.TasksClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, taskName, taskCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client TasksClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskCreateParameters Task) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskName": autorest.Encode("path", taskName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", pathParameters), + autorest.WithJSON(taskCreateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client TasksClient) CreateSender(req *http.Request) (future TasksCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client TasksClient) CreateResponder(resp *http.Response) (result Task, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a specified task. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskName - the name of the container registry task. +func (client TasksClient) Delete(ctx context.Context, resourceGroupName string, registryName string, taskName string) (result TasksDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskName, + Constraints: []validation.Constraint{{Target: "taskName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TasksClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, taskName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client TasksClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, taskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskName": autorest.Encode("path", taskName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client TasksClient) DeleteSender(req *http.Request) (future TasksDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client TasksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get get the properties of a specified task. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskName - the name of the container registry task. +func (client TasksClient) Get(ctx context.Context, resourceGroupName string, registryName string, taskName string) (result Task, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskName, + Constraints: []validation.Constraint{{Target: "taskName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TasksClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, taskName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client TasksClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, taskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskName": autorest.Encode("path", taskName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client TasksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client TasksClient) GetResponder(resp *http.Response) (result Task, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetDetails returns a task with extended information that includes all secrets. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskName - the name of the container registry task. +func (client TasksClient) GetDetails(ctx context.Context, resourceGroupName string, registryName string, taskName string) (result Task, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.GetDetails") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskName, + Constraints: []validation.Constraint{{Target: "taskName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TasksClient", "GetDetails", err.Error()) + } + + req, err := client.GetDetailsPreparer(ctx, resourceGroupName, registryName, taskName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "GetDetails", nil, "Failure preparing request") + return + } + + resp, err := client.GetDetailsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "GetDetails", resp, "Failure sending request") + return + } + + result, err = client.GetDetailsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "GetDetails", resp, "Failure responding to request") + return + } + + return +} + +// GetDetailsPreparer prepares the GetDetails request. +func (client TasksClient) GetDetailsPreparer(ctx context.Context, resourceGroupName string, registryName string, taskName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskName": autorest.Encode("path", taskName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}/listDetails", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetDetailsSender sends the GetDetails request. The method will close the +// http.Response Body if it receives an error. +func (client TasksClient) GetDetailsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetDetailsResponder handles the response to the GetDetails request. The method always +// closes the http.Response Body. +func (client TasksClient) GetDetailsResponder(resp *http.Response) (result Task, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the tasks for a specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client TasksClient) List(ctx context.Context, resourceGroupName string, registryName string) (result TaskListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.List") + defer func() { + sc := -1 + if result.tlr.Response.Response != nil { + sc = result.tlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TasksClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.tlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "List", resp, "Failure sending request") + return + } + + result.tlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "List", resp, "Failure responding to request") + return + } + if result.tlr.hasNextLink() && result.tlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client TasksClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client TasksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client TasksClient) ListResponder(resp *http.Response) (result TaskListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client TasksClient) listNextResults(ctx context.Context, lastResults TaskListResult) (result TaskListResult, err error) { + req, err := lastResults.taskListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.TasksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.TasksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client TasksClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result TaskListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// Update updates a task with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// taskName - the name of the container registry task. +// taskUpdateParameters - the parameters for updating a task. +func (client TasksClient) Update(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters TaskUpdateParameters) (result TasksUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/TasksClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: taskName, + Constraints: []validation.Constraint{{Target: "taskName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "taskName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "taskName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9-_]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.TasksClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, taskName, taskUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.TasksClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client TasksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, taskName string, taskUpdateParameters TaskUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "taskName": autorest.Encode("path", taskName), + } + + const APIVersion = "2019-06-01-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/tasks/{taskName}", pathParameters), + autorest.WithJSON(taskUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client TasksClient) UpdateSender(req *http.Request) (future TasksUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client TasksClient) UpdateResponder(resp *http.Response) (result Task, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/version.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/version.go new file mode 100644 index 000000000000..99b67c2027b6 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/version.go @@ -0,0 +1,19 @@ +package containerregistry + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " containerregistry/2021-09-01" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/webhooks.go b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/webhooks.go new file mode 100644 index 000000000000..53d1f9e259a3 --- /dev/null +++ b/services/preview/containerregistry/mgmt/2021-09-01/containerregistry/webhooks.go @@ -0,0 +1,866 @@ +package containerregistry + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// WebhooksClient is the client for the Webhooks methods of the Containerregistry service. +type WebhooksClient struct { + BaseClient +} + +// NewWebhooksClient creates an instance of the WebhooksClient client. +func NewWebhooksClient(subscriptionID string) WebhooksClient { + return NewWebhooksClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWebhooksClientWithBaseURI creates an instance of the WebhooksClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWebhooksClientWithBaseURI(baseURI string, subscriptionID string) WebhooksClient { + return WebhooksClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Create creates a webhook for a container registry with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +// webhookCreateParameters - the parameters for creating a webhook. +func (client WebhooksClient) Create(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters) (result WebhooksCreateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Create") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookCreateParameters, + Constraints: []validation.Constraint{{Target: "webhookCreateParameters.Location", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.ServiceURI", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "webhookCreateParameters.WebhookPropertiesCreateParameters.Actions", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Create", err.Error()) + } + + req, err := client.CreatePreparer(ctx, resourceGroupName, registryName, webhookName, webhookCreateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", nil, "Failure preparing request") + return + } + + result, err = client.CreateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Create", result.Response(), "Failure sending request") + return + } + + return +} + +// CreatePreparer prepares the Create request. +func (client WebhooksClient) CreatePreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookCreateParameters WebhookCreateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(webhookCreateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateSender sends the Create request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) CreateSender(req *http.Request) (future WebhooksCreateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateResponder handles the response to the Create request. The method always +// closes the http.Response Body. +func (client WebhooksClient) CreateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes a webhook from a container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) Delete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result WebhooksDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client WebhooksClient) DeletePreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) DeleteSender(req *http.Request) (future WebhooksDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client WebhooksClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get gets the properties of the specified webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) Get(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result Webhook, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client WebhooksClient) GetPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client WebhooksClient) GetResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetCallbackConfig gets the configuration of service URI and custom headers for the webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) GetCallbackConfig(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result CallbackConfig, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.GetCallbackConfig") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "GetCallbackConfig", err.Error()) + } + + req, err := client.GetCallbackConfigPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", nil, "Failure preparing request") + return + } + + resp, err := client.GetCallbackConfigSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure sending request") + return + } + + result, err = client.GetCallbackConfigResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "GetCallbackConfig", resp, "Failure responding to request") + return + } + + return +} + +// GetCallbackConfigPreparer prepares the GetCallbackConfig request. +func (client WebhooksClient) GetCallbackConfigPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/getCallbackConfig", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetCallbackConfigSender sends the GetCallbackConfig request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) GetCallbackConfigSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetCallbackConfigResponder handles the response to the GetCallbackConfig request. The method always +// closes the http.Response Body. +func (client WebhooksClient) GetCallbackConfigResponder(resp *http.Response) (result CallbackConfig, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List lists all the webhooks for the specified container registry. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +func (client WebhooksClient) List(ctx context.Context, resourceGroupName string, registryName string) (result WebhookListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.List") + defer func() { + sc := -1 + if result.wlr.Response.Response != nil { + sc = result.wlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, resourceGroupName, registryName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.wlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure sending request") + return + } + + result.wlr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "List", resp, "Failure responding to request") + return + } + if result.wlr.hasNextLink() && result.wlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client WebhooksClient) ListPreparer(ctx context.Context, resourceGroupName string, registryName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client WebhooksClient) ListResponder(resp *http.Response) (result WebhookListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client WebhooksClient) listNextResults(ctx context.Context, lastResults WebhookListResult) (result WebhookListResult, err error) { + req, err := lastResults.webhookListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhooksClient) ListComplete(ctx context.Context, resourceGroupName string, registryName string) (result WebhookListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, resourceGroupName, registryName) + return +} + +// ListEvents lists recent events for the specified webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) ListEvents(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result EventListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.ListEvents") + defer func() { + sc := -1 + if result.elr.Response.Response != nil { + sc = result.elr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "ListEvents", err.Error()) + } + + result.fn = client.listEventsNextResults + req, err := client.ListEventsPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", nil, "Failure preparing request") + return + } + + resp, err := client.ListEventsSender(req) + if err != nil { + result.elr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure sending request") + return + } + + result.elr, err = client.ListEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "ListEvents", resp, "Failure responding to request") + return + } + if result.elr.hasNextLink() && result.elr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListEventsPreparer prepares the ListEvents request. +func (client WebhooksClient) ListEventsPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/listEvents", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEventsSender sends the ListEvents request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) ListEventsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListEventsResponder handles the response to the ListEvents request. The method always +// closes the http.Response Body. +func (client WebhooksClient) ListEventsResponder(resp *http.Response) (result EventListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listEventsNextResults retrieves the next set of results, if any. +func (client WebhooksClient) listEventsNextResults(ctx context.Context, lastResults EventListResult) (result EventListResult, err error) { + req, err := lastResults.eventListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listEventsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListEventsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listEventsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListEventsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "listEventsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListEventsComplete enumerates all values, automatically crossing page boundaries as required. +func (client WebhooksClient) ListEventsComplete(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result EventListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.ListEvents") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListEvents(ctx, resourceGroupName, registryName, webhookName) + return +} + +// Ping triggers a ping event to be sent to the webhook. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +func (client WebhooksClient) Ping(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (result EventInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Ping") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Ping", err.Error()) + } + + req, err := client.PingPreparer(ctx, resourceGroupName, registryName, webhookName) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", nil, "Failure preparing request") + return + } + + resp, err := client.PingSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure sending request") + return + } + + result, err = client.PingResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Ping", resp, "Failure responding to request") + return + } + + return +} + +// PingPreparer prepares the Ping request. +func (client WebhooksClient) PingPreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}/ping", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PingSender sends the Ping request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) PingSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// PingResponder handles the response to the Ping request. The method always +// closes the http.Response Body. +func (client WebhooksClient) PingResponder(resp *http.Response) (result EventInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update updates a webhook with the specified parameters. +// Parameters: +// resourceGroupName - the name of the resource group to which the container registry belongs. +// registryName - the name of the container registry. +// webhookName - the name of the webhook. +// webhookUpdateParameters - the parameters for updating a webhook. +func (client WebhooksClient) Update(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters) (result WebhooksUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/WebhooksClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: registryName, + Constraints: []validation.Constraint{{Target: "registryName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "registryName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "registryName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}, + {TargetValue: webhookName, + Constraints: []validation.Constraint{{Target: "webhookName", Name: validation.MaxLength, Rule: 50, Chain: nil}, + {Target: "webhookName", Name: validation.MinLength, Rule: 5, Chain: nil}, + {Target: "webhookName", Name: validation.Pattern, Rule: `^[a-zA-Z0-9]*$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("containerregistry.WebhooksClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, registryName, webhookName, webhookUpdateParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "containerregistry.WebhooksClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client WebhooksClient) UpdatePreparer(ctx context.Context, resourceGroupName string, registryName string, webhookName string, webhookUpdateParameters WebhookUpdateParameters) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "registryName": autorest.Encode("path", registryName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "webhookName": autorest.Encode("path", webhookName), + } + + const APIVersion = "2021-09-01" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.ContainerRegistry/registries/{registryName}/webhooks/{webhookName}", pathParameters), + autorest.WithJSON(webhookUpdateParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client WebhooksClient) UpdateSender(req *http.Request) (future WebhooksUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client WebhooksClient) UpdateResponder(resp *http.Response) (result Webhook, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} From dde6d8377f8a9d376a22f82f20f52249ae9baebc Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:21:11 +0800 Subject: [PATCH 4/8] Generated from specification/datafactory/resource-manager/readme.md tag package-2018-06 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- .../datafactory/mgmt/datafactory/models.go | 3 + .../datafactory/mgmt/datafactory/models.go | 3 + .../mgmt/2018-06-01/datafactory/CHANGELOG.md | 108 +++ .../mgmt/2018-06-01/datafactory/_meta.json | 6 +- .../mgmt/2018-06-01/datafactory/enums.go | 4 +- .../mgmt/2018-06-01/datafactory/models.go | 705 +++++++++++++++++- 6 files changed, 787 insertions(+), 42 deletions(-) diff --git a/profiles/latest/datafactory/mgmt/datafactory/models.go b/profiles/latest/datafactory/mgmt/datafactory/models.go index 872565df864c..91d7979a54a1 100644 --- a/profiles/latest/datafactory/mgmt/datafactory/models.go +++ b/profiles/latest/datafactory/mgmt/datafactory/models.go @@ -838,6 +838,7 @@ const ( TypeBasicActivityTypeExecuteSSISPackage TypeBasicActivity = original.TypeBasicActivityTypeExecuteSSISPackage TypeBasicActivityTypeExecuteWranglingDataflow TypeBasicActivity = original.TypeBasicActivityTypeExecuteWranglingDataflow TypeBasicActivityTypeExecution TypeBasicActivity = original.TypeBasicActivityTypeExecution + TypeBasicActivityTypeFail TypeBasicActivity = original.TypeBasicActivityTypeFail TypeBasicActivityTypeFilter TypeBasicActivity = original.TypeBasicActivityTypeFilter TypeBasicActivityTypeForEach TypeBasicActivity = original.TypeBasicActivityTypeForEach TypeBasicActivityTypeGetMetadata TypeBasicActivity = original.TypeBasicActivityTypeGetMetadata @@ -1832,6 +1833,8 @@ type FactoryRepoConfiguration = original.FactoryRepoConfiguration type FactoryRepoUpdate = original.FactoryRepoUpdate type FactoryUpdateParameters = original.FactoryUpdateParameters type FactoryVSTSConfiguration = original.FactoryVSTSConfiguration +type FailActivity = original.FailActivity +type FailActivityTypeProperties = original.FailActivityTypeProperties type FileServerLinkedService = original.FileServerLinkedService type FileServerLinkedServiceTypeProperties = original.FileServerLinkedServiceTypeProperties type FileServerLocation = original.FileServerLocation diff --git a/profiles/preview/datafactory/mgmt/datafactory/models.go b/profiles/preview/datafactory/mgmt/datafactory/models.go index 4074cc49c6ed..ee949da4e963 100644 --- a/profiles/preview/datafactory/mgmt/datafactory/models.go +++ b/profiles/preview/datafactory/mgmt/datafactory/models.go @@ -838,6 +838,7 @@ const ( TypeBasicActivityTypeExecuteSSISPackage TypeBasicActivity = original.TypeBasicActivityTypeExecuteSSISPackage TypeBasicActivityTypeExecuteWranglingDataflow TypeBasicActivity = original.TypeBasicActivityTypeExecuteWranglingDataflow TypeBasicActivityTypeExecution TypeBasicActivity = original.TypeBasicActivityTypeExecution + TypeBasicActivityTypeFail TypeBasicActivity = original.TypeBasicActivityTypeFail TypeBasicActivityTypeFilter TypeBasicActivity = original.TypeBasicActivityTypeFilter TypeBasicActivityTypeForEach TypeBasicActivity = original.TypeBasicActivityTypeForEach TypeBasicActivityTypeGetMetadata TypeBasicActivity = original.TypeBasicActivityTypeGetMetadata @@ -1832,6 +1833,8 @@ type FactoryRepoConfiguration = original.FactoryRepoConfiguration type FactoryRepoUpdate = original.FactoryRepoUpdate type FactoryUpdateParameters = original.FactoryUpdateParameters type FactoryVSTSConfiguration = original.FactoryVSTSConfiguration +type FailActivity = original.FailActivity +type FailActivityTypeProperties = original.FailActivityTypeProperties type FileServerLinkedService = original.FileServerLinkedService type FileServerLinkedServiceTypeProperties = original.FileServerLinkedServiceTypeProperties type FileServerLocation = original.FileServerLocation diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md b/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md index 52911e4cc5e4..397a9b88fd1d 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md +++ b/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md @@ -1,2 +1,110 @@ # Change History +## Additive Changes + +### New Constants + +1. TypeBasicActivity.TypeBasicActivityTypeFail + +### New Funcs + +1. *FailActivity.UnmarshalJSON([]byte) error +1. Activity.AsFailActivity() (*FailActivity, bool) +1. AppendVariableActivity.AsFailActivity() (*FailActivity, bool) +1. AzureDataExplorerCommandActivity.AsFailActivity() (*FailActivity, bool) +1. AzureFunctionActivity.AsFailActivity() (*FailActivity, bool) +1. AzureMLBatchExecutionActivity.AsFailActivity() (*FailActivity, bool) +1. AzureMLExecutePipelineActivity.AsFailActivity() (*FailActivity, bool) +1. AzureMLUpdateResourceActivity.AsFailActivity() (*FailActivity, bool) +1. ControlActivity.AsFailActivity() (*FailActivity, bool) +1. CopyActivity.AsFailActivity() (*FailActivity, bool) +1. CustomActivity.AsFailActivity() (*FailActivity, bool) +1. DataLakeAnalyticsUSQLActivity.AsFailActivity() (*FailActivity, bool) +1. DatabricksNotebookActivity.AsFailActivity() (*FailActivity, bool) +1. DatabricksSparkJarActivity.AsFailActivity() (*FailActivity, bool) +1. DatabricksSparkPythonActivity.AsFailActivity() (*FailActivity, bool) +1. DeleteActivity.AsFailActivity() (*FailActivity, bool) +1. ExecuteDataFlowActivity.AsFailActivity() (*FailActivity, bool) +1. ExecutePipelineActivity.AsFailActivity() (*FailActivity, bool) +1. ExecuteSSISPackageActivity.AsFailActivity() (*FailActivity, bool) +1. ExecuteWranglingDataflowActivity.AsFailActivity() (*FailActivity, bool) +1. ExecutionActivity.AsFailActivity() (*FailActivity, bool) +1. FailActivity.AsActivity() (*Activity, bool) +1. FailActivity.AsAppendVariableActivity() (*AppendVariableActivity, bool) +1. FailActivity.AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) +1. FailActivity.AsAzureFunctionActivity() (*AzureFunctionActivity, bool) +1. FailActivity.AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) +1. FailActivity.AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) +1. FailActivity.AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) +1. FailActivity.AsBasicActivity() (BasicActivity, bool) +1. FailActivity.AsBasicControlActivity() (BasicControlActivity, bool) +1. FailActivity.AsBasicExecutionActivity() (BasicExecutionActivity, bool) +1. FailActivity.AsControlActivity() (*ControlActivity, bool) +1. FailActivity.AsCopyActivity() (*CopyActivity, bool) +1. FailActivity.AsCustomActivity() (*CustomActivity, bool) +1. FailActivity.AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) +1. FailActivity.AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) +1. FailActivity.AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) +1. FailActivity.AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) +1. FailActivity.AsDeleteActivity() (*DeleteActivity, bool) +1. FailActivity.AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) +1. FailActivity.AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) +1. FailActivity.AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) +1. FailActivity.AsExecuteWranglingDataflowActivity() (*ExecuteWranglingDataflowActivity, bool) +1. FailActivity.AsExecutionActivity() (*ExecutionActivity, bool) +1. FailActivity.AsFailActivity() (*FailActivity, bool) +1. FailActivity.AsFilterActivity() (*FilterActivity, bool) +1. FailActivity.AsForEachActivity() (*ForEachActivity, bool) +1. FailActivity.AsGetMetadataActivity() (*GetMetadataActivity, bool) +1. FailActivity.AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) +1. FailActivity.AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) +1. FailActivity.AsHDInsightPigActivity() (*HDInsightPigActivity, bool) +1. FailActivity.AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) +1. FailActivity.AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) +1. FailActivity.AsIfConditionActivity() (*IfConditionActivity, bool) +1. FailActivity.AsLookupActivity() (*LookupActivity, bool) +1. FailActivity.AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) +1. FailActivity.AsSetVariableActivity() (*SetVariableActivity, bool) +1. FailActivity.AsSwitchActivity() (*SwitchActivity, bool) +1. FailActivity.AsUntilActivity() (*UntilActivity, bool) +1. FailActivity.AsValidationActivity() (*ValidationActivity, bool) +1. FailActivity.AsWaitActivity() (*WaitActivity, bool) +1. FailActivity.AsWebActivity() (*WebActivity, bool) +1. FailActivity.AsWebHookActivity() (*WebHookActivity, bool) +1. FailActivity.MarshalJSON() ([]byte, error) +1. FilterActivity.AsFailActivity() (*FailActivity, bool) +1. ForEachActivity.AsFailActivity() (*FailActivity, bool) +1. GetMetadataActivity.AsFailActivity() (*FailActivity, bool) +1. HDInsightHiveActivity.AsFailActivity() (*FailActivity, bool) +1. HDInsightMapReduceActivity.AsFailActivity() (*FailActivity, bool) +1. HDInsightPigActivity.AsFailActivity() (*FailActivity, bool) +1. HDInsightSparkActivity.AsFailActivity() (*FailActivity, bool) +1. HDInsightStreamingActivity.AsFailActivity() (*FailActivity, bool) +1. IfConditionActivity.AsFailActivity() (*FailActivity, bool) +1. LookupActivity.AsFailActivity() (*FailActivity, bool) +1. SQLServerStoredProcedureActivity.AsFailActivity() (*FailActivity, bool) +1. SetVariableActivity.AsFailActivity() (*FailActivity, bool) +1. SwitchActivity.AsFailActivity() (*FailActivity, bool) +1. UntilActivity.AsFailActivity() (*FailActivity, bool) +1. ValidationActivity.AsFailActivity() (*FailActivity, bool) +1. WaitActivity.AsFailActivity() (*FailActivity, bool) +1. WebActivity.AsFailActivity() (*FailActivity, bool) +1. WebHookActivity.AsFailActivity() (*FailActivity, bool) + +### Struct Changes + +#### New Structs + +1. FailActivity +1. FailActivityTypeProperties + +#### New Struct Fields + +1. AzureBlobFSLinkedServiceTypeProperties.ServicePrincipalCredential +1. AzureBlobFSLinkedServiceTypeProperties.ServicePrincipalCredentialType +1. AzureDatabricksDetltaLakeLinkedServiceTypeProperties.Credential +1. AzureDatabricksDetltaLakeLinkedServiceTypeProperties.WorkspaceResourceID +1. CosmosDbLinkedServiceTypeProperties.Credential +1. DynamicsLinkedServiceTypeProperties.Credential +1. GoogleAdWordsLinkedServiceTypeProperties.ConnectionProperties +1. LinkedIntegrationRuntimeRbacAuthorization.Credential diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json b/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json index dbeef5455177..d2b934dac8e5 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json +++ b/services/datafactory/mgmt/2018-06-01/datafactory/_meta.json @@ -1,11 +1,11 @@ { - "commit": "d600759c3516b61a7c353bc8682bccbab85a6f65", + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", "readme": "/_/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md", "tag": "package-2018-06", "use": "@microsoft.azure/autorest.go@2.1.187", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2018-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2018-06 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/datafactory/resource-manager/readme.md", "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" } } \ No newline at end of file diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/enums.go b/services/datafactory/mgmt/2018-06-01/datafactory/enums.go index 5b123d3c4253..a2c02a31bc8d 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/enums.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/enums.go @@ -1740,6 +1740,8 @@ const ( TypeBasicActivityTypeExecuteWranglingDataflow TypeBasicActivity = "ExecuteWranglingDataflow" // TypeBasicActivityTypeExecution ... TypeBasicActivityTypeExecution TypeBasicActivity = "Execution" + // TypeBasicActivityTypeFail ... + TypeBasicActivityTypeFail TypeBasicActivity = "Fail" // TypeBasicActivityTypeFilter ... TypeBasicActivityTypeFilter TypeBasicActivity = "Filter" // TypeBasicActivityTypeForEach ... @@ -1780,7 +1782,7 @@ const ( // PossibleTypeBasicActivityValues returns an array of possible values for the TypeBasicActivity const type. func PossibleTypeBasicActivityValues() []TypeBasicActivity { - return []TypeBasicActivity{TypeBasicActivityTypeActivity, TypeBasicActivityTypeAppendVariable, TypeBasicActivityTypeAzureDataExplorerCommand, TypeBasicActivityTypeAzureFunctionActivity, TypeBasicActivityTypeAzureMLBatchExecution, TypeBasicActivityTypeAzureMLExecutePipeline, TypeBasicActivityTypeAzureMLUpdateResource, TypeBasicActivityTypeContainer, TypeBasicActivityTypeCopy, TypeBasicActivityTypeCustom, TypeBasicActivityTypeDatabricksNotebook, TypeBasicActivityTypeDatabricksSparkJar, TypeBasicActivityTypeDatabricksSparkPython, TypeBasicActivityTypeDataLakeAnalyticsUSQL, TypeBasicActivityTypeDelete, TypeBasicActivityTypeExecuteDataFlow, TypeBasicActivityTypeExecutePipeline, TypeBasicActivityTypeExecuteSSISPackage, TypeBasicActivityTypeExecuteWranglingDataflow, TypeBasicActivityTypeExecution, TypeBasicActivityTypeFilter, TypeBasicActivityTypeForEach, TypeBasicActivityTypeGetMetadata, TypeBasicActivityTypeHDInsightHive, TypeBasicActivityTypeHDInsightMapReduce, TypeBasicActivityTypeHDInsightPig, TypeBasicActivityTypeHDInsightSpark, TypeBasicActivityTypeHDInsightStreaming, TypeBasicActivityTypeIfCondition, TypeBasicActivityTypeLookup, TypeBasicActivityTypeSetVariable, TypeBasicActivityTypeSQLServerStoredProcedure, TypeBasicActivityTypeSwitch, TypeBasicActivityTypeUntil, TypeBasicActivityTypeValidation, TypeBasicActivityTypeWait, TypeBasicActivityTypeWebActivity, TypeBasicActivityTypeWebHook} + return []TypeBasicActivity{TypeBasicActivityTypeActivity, TypeBasicActivityTypeAppendVariable, TypeBasicActivityTypeAzureDataExplorerCommand, TypeBasicActivityTypeAzureFunctionActivity, TypeBasicActivityTypeAzureMLBatchExecution, TypeBasicActivityTypeAzureMLExecutePipeline, TypeBasicActivityTypeAzureMLUpdateResource, TypeBasicActivityTypeContainer, TypeBasicActivityTypeCopy, TypeBasicActivityTypeCustom, TypeBasicActivityTypeDatabricksNotebook, TypeBasicActivityTypeDatabricksSparkJar, TypeBasicActivityTypeDatabricksSparkPython, TypeBasicActivityTypeDataLakeAnalyticsUSQL, TypeBasicActivityTypeDelete, TypeBasicActivityTypeExecuteDataFlow, TypeBasicActivityTypeExecutePipeline, TypeBasicActivityTypeExecuteSSISPackage, TypeBasicActivityTypeExecuteWranglingDataflow, TypeBasicActivityTypeExecution, TypeBasicActivityTypeFail, TypeBasicActivityTypeFilter, TypeBasicActivityTypeForEach, TypeBasicActivityTypeGetMetadata, TypeBasicActivityTypeHDInsightHive, TypeBasicActivityTypeHDInsightMapReduce, TypeBasicActivityTypeHDInsightPig, TypeBasicActivityTypeHDInsightSpark, TypeBasicActivityTypeHDInsightStreaming, TypeBasicActivityTypeIfCondition, TypeBasicActivityTypeLookup, TypeBasicActivityTypeSetVariable, TypeBasicActivityTypeSQLServerStoredProcedure, TypeBasicActivityTypeSwitch, TypeBasicActivityTypeUntil, TypeBasicActivityTypeValidation, TypeBasicActivityTypeWait, TypeBasicActivityTypeWebActivity, TypeBasicActivityTypeWebHook} } // TypeBasicCompressionReadSettings enumerates the values for type basic compression read settings. diff --git a/services/datafactory/mgmt/2018-06-01/datafactory/models.go b/services/datafactory/mgmt/2018-06-01/datafactory/models.go index 52711d6435ce..e80af576267d 100644 --- a/services/datafactory/mgmt/2018-06-01/datafactory/models.go +++ b/services/datafactory/mgmt/2018-06-01/datafactory/models.go @@ -66,6 +66,7 @@ type BasicActivity interface { AsFilterActivity() (*FilterActivity, bool) AsValidationActivity() (*ValidationActivity, bool) AsUntilActivity() (*UntilActivity, bool) + AsFailActivity() (*FailActivity, bool) AsWaitActivity() (*WaitActivity, bool) AsForEachActivity() (*ForEachActivity, bool) AsSwitchActivity() (*SwitchActivity, bool) @@ -88,7 +89,7 @@ type Activity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -224,6 +225,10 @@ func unmarshalBasicActivity(body []byte) (BasicActivity, error) { var ua UntilActivity err := json.Unmarshal(body, &ua) return ua, err + case string(TypeBasicActivityTypeFail): + var fa FailActivity + err := json.Unmarshal(body, &fa) + return fa, err case string(TypeBasicActivityTypeWait): var wa WaitActivity err := json.Unmarshal(body, &wa) @@ -458,6 +463,11 @@ func (a Activity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for Activity. +func (a Activity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for Activity. func (a Activity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -12436,7 +12446,7 @@ type AppendVariableActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -12628,6 +12638,11 @@ func (ava AppendVariableActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for AppendVariableActivity. +func (ava AppendVariableActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for AppendVariableActivity. func (ava AppendVariableActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -17707,6 +17722,10 @@ type AzureBlobFSLinkedServiceTypeProperties struct { EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` // Credential - The credential reference containing authentication information. Credential *CredentialReference `json:"credential,omitempty"` + // ServicePrincipalCredentialType - The service principal credential type to use in Server-To-Server authentication. 'ServicePrincipalKey' for key/secret, 'ServicePrincipalCert' for certificate. Type: string (or Expression with resultType string). + ServicePrincipalCredentialType interface{} `json:"servicePrincipalCredentialType,omitempty"` + // ServicePrincipalCredential - The credential of the service principal object in Azure Active Directory. If servicePrincipalCredentialType is 'ServicePrincipalKey', servicePrincipalCredential can be SecureString or AzureKeyVaultSecretReference. If servicePrincipalCredentialType is 'ServicePrincipalCert', servicePrincipalCredential can only be AzureKeyVaultSecretReference. + ServicePrincipalCredential BasicSecretBase `json:"servicePrincipalCredential,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AzureBlobFSLinkedServiceTypeProperties struct. @@ -17789,6 +17808,23 @@ func (abflstp *AzureBlobFSLinkedServiceTypeProperties) UnmarshalJSON(body []byte } abflstp.Credential = &credential } + case "servicePrincipalCredentialType": + if v != nil { + var servicePrincipalCredentialType interface{} + err = json.Unmarshal(*v, &servicePrincipalCredentialType) + if err != nil { + return err + } + abflstp.ServicePrincipalCredentialType = servicePrincipalCredentialType + } + case "servicePrincipalCredential": + if v != nil { + servicePrincipalCredential, err := unmarshalBasicSecretBase(*v) + if err != nil { + return err + } + abflstp.ServicePrincipalCredential = servicePrincipalCredential + } } } @@ -23386,6 +23422,10 @@ type AzureDatabricksDetltaLakeLinkedServiceTypeProperties struct { ClusterID interface{} `json:"clusterId,omitempty"` // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // Credential - The credential reference containing authentication information. + Credential *CredentialReference `json:"credential,omitempty"` + // WorkspaceResourceID - Workspace resource id for databricks REST API. Type: string (or Expression with resultType string). + WorkspaceResourceID interface{} `json:"workspaceResourceId,omitempty"` } // UnmarshalJSON is the custom unmarshaler for AzureDatabricksDetltaLakeLinkedServiceTypeProperties struct. @@ -23432,6 +23472,24 @@ func (addllstp *AzureDatabricksDetltaLakeLinkedServiceTypeProperties) UnmarshalJ } addllstp.EncryptedCredential = encryptedCredential } + case "credential": + if v != nil { + var credential CredentialReference + err = json.Unmarshal(*v, &credential) + if err != nil { + return err + } + addllstp.Credential = &credential + } + case "workspaceResourceId": + if v != nil { + var workspaceResourceID interface{} + err = json.Unmarshal(*v, &workspaceResourceID) + if err != nil { + return err + } + addllstp.WorkspaceResourceID = workspaceResourceID + } } } @@ -24391,7 +24449,7 @@ type AzureDataExplorerCommandActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -24589,6 +24647,11 @@ func (adeca AzureDataExplorerCommandActivity) AsUntilActivity() (*UntilActivity, return nil, false } +// AsFailActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. +func (adeca AzureDataExplorerCommandActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for AzureDataExplorerCommandActivity. func (adeca AzureDataExplorerCommandActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -32433,7 +32496,7 @@ type AzureFunctionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -32631,6 +32694,11 @@ func (afa AzureFunctionActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for AzureFunctionActivity. +func (afa AzureFunctionActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for AzureFunctionActivity. func (afa AzureFunctionActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -36198,7 +36266,7 @@ type AzureMLBatchExecutionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -36396,6 +36464,11 @@ func (ambea AzureMLBatchExecutionActivity) AsUntilActivity() (*UntilActivity, bo return nil, false } +// AsFailActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. +func (ambea AzureMLBatchExecutionActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for AzureMLBatchExecutionActivity. func (ambea AzureMLBatchExecutionActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -36583,7 +36656,7 @@ type AzureMLExecutePipelineActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -36781,6 +36854,11 @@ func (amepa AzureMLExecutePipelineActivity) AsUntilActivity() (*UntilActivity, b return nil, false } +// AsFailActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. +func (amepa AzureMLExecutePipelineActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for AzureMLExecutePipelineActivity. func (amepa AzureMLExecutePipelineActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -38457,7 +38535,7 @@ type AzureMLUpdateResourceActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -38655,6 +38733,11 @@ func (amura AzureMLUpdateResourceActivity) AsUntilActivity() (*UntilActivity, bo return nil, false } +// AsFailActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. +func (amura AzureMLUpdateResourceActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for AzureMLUpdateResourceActivity. func (amura AzureMLUpdateResourceActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -64446,6 +64529,7 @@ type BasicControlActivity interface { AsFilterActivity() (*FilterActivity, bool) AsValidationActivity() (*ValidationActivity, bool) AsUntilActivity() (*UntilActivity, bool) + AsFailActivity() (*FailActivity, bool) AsWaitActivity() (*WaitActivity, bool) AsForEachActivity() (*ForEachActivity, bool) AsSwitchActivity() (*SwitchActivity, bool) @@ -64466,7 +64550,7 @@ type ControlActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -64502,6 +64586,10 @@ func unmarshalBasicControlActivity(body []byte) (BasicControlActivity, error) { var ua UntilActivity err := json.Unmarshal(body, &ua) return ua, err + case string(TypeBasicActivityTypeFail): + var fa FailActivity + err := json.Unmarshal(body, &fa) + return fa, err case string(TypeBasicActivityTypeWait): var wa WaitActivity err := json.Unmarshal(body, &wa) @@ -64732,6 +64820,11 @@ func (ca ControlActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for ControlActivity. +func (ca ControlActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ControlActivity. func (ca ControlActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -64871,7 +64964,7 @@ type CopyActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -65075,6 +65168,11 @@ func (ca CopyActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for CopyActivity. +func (ca CopyActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for CopyActivity. func (ca CopyActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -67909,6 +68007,8 @@ type CosmosDbLinkedServiceTypeProperties struct { ConnectionMode CosmosDbConnectionMode `json:"connectionMode,omitempty"` // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // Credential - The credential reference containing authentication information. + Credential *CredentialReference `json:"credential,omitempty"` } // UnmarshalJSON is the custom unmarshaler for CosmosDbLinkedServiceTypeProperties struct. @@ -68017,6 +68117,15 @@ func (cdlstp *CosmosDbLinkedServiceTypeProperties) UnmarshalJSON(body []byte) er } cdlstp.EncryptedCredential = encryptedCredential } + case "credential": + if v != nil { + var credential CredentialReference + err = json.Unmarshal(*v, &credential) + if err != nil { + return err + } + cdlstp.Credential = &credential + } } } @@ -74385,7 +74494,7 @@ type CustomActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -74583,6 +74692,11 @@ func (ca CustomActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for CustomActivity. +func (ca CustomActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for CustomActivity. func (ca CustomActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -76394,7 +76508,7 @@ type DatabricksNotebookActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -76592,6 +76706,11 @@ func (dna DatabricksNotebookActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for DatabricksNotebookActivity. +func (dna DatabricksNotebookActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for DatabricksNotebookActivity. func (dna DatabricksNotebookActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -76779,7 +76898,7 @@ type DatabricksSparkJarActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -76977,6 +77096,11 @@ func (dsja DatabricksSparkJarActivity) AsUntilActivity() (*UntilActivity, bool) return nil, false } +// AsFailActivity is the BasicActivity implementation for DatabricksSparkJarActivity. +func (dsja DatabricksSparkJarActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for DatabricksSparkJarActivity. func (dsja DatabricksSparkJarActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -77149,7 +77273,7 @@ type DatabricksSparkPythonActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -77347,6 +77471,11 @@ func (dspa DatabricksSparkPythonActivity) AsUntilActivity() (*UntilActivity, boo return nil, false } +// AsFailActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. +func (dspa DatabricksSparkPythonActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for DatabricksSparkPythonActivity. func (dspa DatabricksSparkPythonActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -78506,7 +78635,7 @@ type DataLakeAnalyticsUSQLActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -78704,6 +78833,11 @@ func (dlaua DataLakeAnalyticsUSQLActivity) AsUntilActivity() (*UntilActivity, bo return nil, false } +// AsFailActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. +func (dlaua DataLakeAnalyticsUSQLActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for DataLakeAnalyticsUSQLActivity. func (dlaua DataLakeAnalyticsUSQLActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -83045,7 +83179,7 @@ type DeleteActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -83243,6 +83377,11 @@ func (da DeleteActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for DeleteActivity. +func (da DeleteActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for DeleteActivity. func (da DeleteActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -95187,6 +95326,8 @@ type DynamicsLinkedServiceTypeProperties struct { ServicePrincipalCredential BasicSecretBase `json:"servicePrincipalCredential,omitempty"` // EncryptedCredential - The encrypted credential used for authentication. Credentials are encrypted using the integration runtime credential manager. Type: string (or Expression with resultType string). EncryptedCredential interface{} `json:"encryptedCredential,omitempty"` + // Credential - The credential reference containing authentication information. + Credential *CredentialReference `json:"credential,omitempty"` } // UnmarshalJSON is the custom unmarshaler for DynamicsLinkedServiceTypeProperties struct. @@ -95304,6 +95445,15 @@ func (dlstp *DynamicsLinkedServiceTypeProperties) UnmarshalJSON(body []byte) err } dlstp.EncryptedCredential = encryptedCredential } + case "credential": + if v != nil { + var credential CredentialReference + err = json.Unmarshal(*v, &credential) + if err != nil { + return err + } + dlstp.Credential = &credential + } } } @@ -99877,7 +100027,7 @@ type ExecuteDataFlowActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -100075,6 +100225,11 @@ func (edfa ExecuteDataFlowActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for ExecuteDataFlowActivity. +func (edfa ExecuteDataFlowActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ExecuteDataFlowActivity. func (edfa ExecuteDataFlowActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -100259,7 +100414,7 @@ type ExecutePipelineActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -100451,6 +100606,11 @@ func (epa ExecutePipelineActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for ExecutePipelineActivity. +func (epa ExecutePipelineActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ExecutePipelineActivity. func (epa ExecutePipelineActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -100675,7 +100835,7 @@ type ExecuteSSISPackageActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -100873,6 +101033,11 @@ func (espa ExecuteSSISPackageActivity) AsUntilActivity() (*UntilActivity, bool) return nil, false } +// AsFailActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. +func (espa ExecuteSSISPackageActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ExecuteSSISPackageActivity. func (espa ExecuteSSISPackageActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -101103,7 +101268,7 @@ type ExecuteWranglingDataflowActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -101298,6 +101463,11 @@ func (ewda ExecuteWranglingDataflowActivity) AsUntilActivity() (*UntilActivity, return nil, false } +// AsFailActivity is the BasicActivity implementation for ExecuteWranglingDataflowActivity. +func (ewda ExecuteWranglingDataflowActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ExecuteWranglingDataflowActivity. func (ewda ExecuteWranglingDataflowActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -101477,7 +101647,7 @@ type ExecutionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -101797,6 +101967,11 @@ func (ea ExecutionActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for ExecutionActivity. +func (ea ExecutionActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ExecutionActivity. func (ea ExecutionActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -102859,6 +103034,354 @@ func (fvc FactoryVSTSConfiguration) AsBasicFactoryRepoConfiguration() (BasicFact return &fvc, true } +// FailActivity this activity will fail within its own scope and output a custom error message and error +// code. The error message and code can provided either as a string literal or as an expression that can be +// evaluated to a string at runtime. The activity scope can be the whole pipeline or a control activity +// (e.g. foreach, switch, until), if the fail activity is contained in it. +type FailActivity struct { + // FailActivityTypeProperties - Fail activity properties. + *FailActivityTypeProperties `json:"typeProperties,omitempty"` + // AdditionalProperties - Unmatched properties from the message are deserialized this collection + AdditionalProperties map[string]interface{} `json:""` + // Name - Activity name. + Name *string `json:"name,omitempty"` + // Description - Activity description. + Description *string `json:"description,omitempty"` + // DependsOn - Activity depends on condition. + DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` + // UserProperties - Activity user properties. + UserProperties *[]UserProperty `json:"userProperties,omitempty"` + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + Type TypeBasicActivity `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for FailActivity. +func (fa FailActivity) MarshalJSON() ([]byte, error) { + fa.Type = TypeBasicActivityTypeFail + objectMap := make(map[string]interface{}) + if fa.FailActivityTypeProperties != nil { + objectMap["typeProperties"] = fa.FailActivityTypeProperties + } + if fa.Name != nil { + objectMap["name"] = fa.Name + } + if fa.Description != nil { + objectMap["description"] = fa.Description + } + if fa.DependsOn != nil { + objectMap["dependsOn"] = fa.DependsOn + } + if fa.UserProperties != nil { + objectMap["userProperties"] = fa.UserProperties + } + if fa.Type != "" { + objectMap["type"] = fa.Type + } + for k, v := range fa.AdditionalProperties { + objectMap[k] = v + } + return json.Marshal(objectMap) +} + +// AsExecuteWranglingDataflowActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsExecuteWranglingDataflowActivity() (*ExecuteWranglingDataflowActivity, bool) { + return nil, false +} + +// AsExecuteDataFlowActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsExecuteDataFlowActivity() (*ExecuteDataFlowActivity, bool) { + return nil, false +} + +// AsAzureFunctionActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsAzureFunctionActivity() (*AzureFunctionActivity, bool) { + return nil, false +} + +// AsDatabricksSparkPythonActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsDatabricksSparkPythonActivity() (*DatabricksSparkPythonActivity, bool) { + return nil, false +} + +// AsDatabricksSparkJarActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsDatabricksSparkJarActivity() (*DatabricksSparkJarActivity, bool) { + return nil, false +} + +// AsDatabricksNotebookActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsDatabricksNotebookActivity() (*DatabricksNotebookActivity, bool) { + return nil, false +} + +// AsDataLakeAnalyticsUSQLActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsDataLakeAnalyticsUSQLActivity() (*DataLakeAnalyticsUSQLActivity, bool) { + return nil, false +} + +// AsAzureMLExecutePipelineActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsAzureMLExecutePipelineActivity() (*AzureMLExecutePipelineActivity, bool) { + return nil, false +} + +// AsAzureMLUpdateResourceActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsAzureMLUpdateResourceActivity() (*AzureMLUpdateResourceActivity, bool) { + return nil, false +} + +// AsAzureMLBatchExecutionActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsAzureMLBatchExecutionActivity() (*AzureMLBatchExecutionActivity, bool) { + return nil, false +} + +// AsGetMetadataActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsGetMetadataActivity() (*GetMetadataActivity, bool) { + return nil, false +} + +// AsWebActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsWebActivity() (*WebActivity, bool) { + return nil, false +} + +// AsLookupActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsLookupActivity() (*LookupActivity, bool) { + return nil, false +} + +// AsAzureDataExplorerCommandActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsAzureDataExplorerCommandActivity() (*AzureDataExplorerCommandActivity, bool) { + return nil, false +} + +// AsDeleteActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsDeleteActivity() (*DeleteActivity, bool) { + return nil, false +} + +// AsSQLServerStoredProcedureActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsSQLServerStoredProcedureActivity() (*SQLServerStoredProcedureActivity, bool) { + return nil, false +} + +// AsCustomActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsCustomActivity() (*CustomActivity, bool) { + return nil, false +} + +// AsExecuteSSISPackageActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsExecuteSSISPackageActivity() (*ExecuteSSISPackageActivity, bool) { + return nil, false +} + +// AsHDInsightSparkActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsHDInsightSparkActivity() (*HDInsightSparkActivity, bool) { + return nil, false +} + +// AsHDInsightStreamingActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsHDInsightStreamingActivity() (*HDInsightStreamingActivity, bool) { + return nil, false +} + +// AsHDInsightMapReduceActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsHDInsightMapReduceActivity() (*HDInsightMapReduceActivity, bool) { + return nil, false +} + +// AsHDInsightPigActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsHDInsightPigActivity() (*HDInsightPigActivity, bool) { + return nil, false +} + +// AsHDInsightHiveActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsHDInsightHiveActivity() (*HDInsightHiveActivity, bool) { + return nil, false +} + +// AsCopyActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsCopyActivity() (*CopyActivity, bool) { + return nil, false +} + +// AsExecutionActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsExecutionActivity() (*ExecutionActivity, bool) { + return nil, false +} + +// AsBasicExecutionActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsBasicExecutionActivity() (BasicExecutionActivity, bool) { + return nil, false +} + +// AsWebHookActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsWebHookActivity() (*WebHookActivity, bool) { + return nil, false +} + +// AsAppendVariableActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsAppendVariableActivity() (*AppendVariableActivity, bool) { + return nil, false +} + +// AsSetVariableActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsSetVariableActivity() (*SetVariableActivity, bool) { + return nil, false +} + +// AsFilterActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsFilterActivity() (*FilterActivity, bool) { + return nil, false +} + +// AsValidationActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsValidationActivity() (*ValidationActivity, bool) { + return nil, false +} + +// AsUntilActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsUntilActivity() (*UntilActivity, bool) { + return nil, false +} + +// AsFailActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsFailActivity() (*FailActivity, bool) { + return &fa, true +} + +// AsWaitActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsWaitActivity() (*WaitActivity, bool) { + return nil, false +} + +// AsForEachActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsForEachActivity() (*ForEachActivity, bool) { + return nil, false +} + +// AsSwitchActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsSwitchActivity() (*SwitchActivity, bool) { + return nil, false +} + +// AsIfConditionActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsIfConditionActivity() (*IfConditionActivity, bool) { + return nil, false +} + +// AsExecutePipelineActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsExecutePipelineActivity() (*ExecutePipelineActivity, bool) { + return nil, false +} + +// AsControlActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsControlActivity() (*ControlActivity, bool) { + return nil, false +} + +// AsBasicControlActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsBasicControlActivity() (BasicControlActivity, bool) { + return &fa, true +} + +// AsActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsActivity() (*Activity, bool) { + return nil, false +} + +// AsBasicActivity is the BasicActivity implementation for FailActivity. +func (fa FailActivity) AsBasicActivity() (BasicActivity, bool) { + return &fa, true +} + +// UnmarshalJSON is the custom unmarshaler for FailActivity struct. +func (fa *FailActivity) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "typeProperties": + if v != nil { + var failActivityTypeProperties FailActivityTypeProperties + err = json.Unmarshal(*v, &failActivityTypeProperties) + if err != nil { + return err + } + fa.FailActivityTypeProperties = &failActivityTypeProperties + } + default: + if v != nil { + var additionalProperties interface{} + err = json.Unmarshal(*v, &additionalProperties) + if err != nil { + return err + } + if fa.AdditionalProperties == nil { + fa.AdditionalProperties = make(map[string]interface{}) + } + fa.AdditionalProperties[k] = additionalProperties + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + fa.Name = &name + } + case "description": + if v != nil { + var description string + err = json.Unmarshal(*v, &description) + if err != nil { + return err + } + fa.Description = &description + } + case "dependsOn": + if v != nil { + var dependsOn []ActivityDependency + err = json.Unmarshal(*v, &dependsOn) + if err != nil { + return err + } + fa.DependsOn = &dependsOn + } + case "userProperties": + if v != nil { + var userProperties []UserProperty + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + fa.UserProperties = &userProperties + } + case "type": + if v != nil { + var typeVar TypeBasicActivity + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + fa.Type = typeVar + } + } + } + + return nil +} + +// FailActivityTypeProperties fail activity properties. +type FailActivityTypeProperties struct { + // Message - The error message that surfaced in the Fail activity. It can be dynamic content that's evaluated to a non empty/blank string at runtime. Type: string (or Expression with resultType string). + Message interface{} `json:"message,omitempty"` + // ErrorCode - The error code that categorizes the error type of the Fail activity. It can be dynamic content that's evaluated to a non empty/blank string at runtime. Type: string (or Expression with resultType string). + ErrorCode interface{} `json:"errorCode,omitempty"` +} + // FileServerLinkedService file system linked service. type FileServerLinkedService struct { // FileServerLinkedServiceTypeProperties - File system linked service properties. @@ -105921,7 +106444,7 @@ type FilterActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -106113,6 +106636,11 @@ func (fa FilterActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for FilterActivity. +func (fa FilterActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for FilterActivity. func (fa FilterActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -106396,7 +106924,7 @@ type ForEachActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -106588,6 +107116,11 @@ func (fea ForEachActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for ForEachActivity. +func (fea ForEachActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ForEachActivity. func (fea ForEachActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -108355,7 +108888,7 @@ type GetMetadataActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -108553,6 +109086,11 @@ func (gma GetMetadataActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for GetMetadataActivity. +func (gma GetMetadataActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for GetMetadataActivity. func (gma GetMetadataActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -109448,6 +109986,8 @@ func (gawls *GoogleAdWordsLinkedService) UnmarshalJSON(body []byte) error { // GoogleAdWordsLinkedServiceTypeProperties google AdWords service linked service properties. type GoogleAdWordsLinkedServiceTypeProperties struct { + // ConnectionProperties - Properties used to connect to GoogleAds. It is mutually exclusive with any other properties in the linked service. Type: object. + ConnectionProperties interface{} `json:"connectionProperties,omitempty"` // ClientCustomerID - The Client customer ID of the AdWords account that you want to fetch report data for. ClientCustomerID interface{} `json:"clientCustomerID,omitempty"` // DeveloperToken - The developer token associated with the manager account that you use to grant access to the AdWords API. @@ -109481,6 +110021,15 @@ func (gawlstp *GoogleAdWordsLinkedServiceTypeProperties) UnmarshalJSON(body []by } for k, v := range m { switch k { + case "connectionProperties": + if v != nil { + var connectionProperties interface{} + err = json.Unmarshal(*v, &connectionProperties) + if err != nil { + return err + } + gawlstp.ConnectionProperties = connectionProperties + } case "clientCustomerID": if v != nil { var clientCustomerID interface{} @@ -120064,7 +120613,7 @@ type HDInsightHiveActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -120262,6 +120811,11 @@ func (hiha HDInsightHiveActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for HDInsightHiveActivity. +func (hiha HDInsightHiveActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for HDInsightHiveActivity. func (hiha HDInsightHiveActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -121227,7 +121781,7 @@ type HDInsightMapReduceActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -121425,6 +121979,11 @@ func (himra HDInsightMapReduceActivity) AsUntilActivity() (*UntilActivity, bool) return nil, false } +// AsFailActivity is the BasicActivity implementation for HDInsightMapReduceActivity. +func (himra HDInsightMapReduceActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for HDInsightMapReduceActivity. func (himra HDInsightMapReduceActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -122674,7 +123233,7 @@ type HDInsightPigActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -122872,6 +123431,11 @@ func (hipa HDInsightPigActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for HDInsightPigActivity. +func (hipa HDInsightPigActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for HDInsightPigActivity. func (hipa HDInsightPigActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -123074,7 +123638,7 @@ type HDInsightSparkActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -123272,6 +123836,11 @@ func (hisa HDInsightSparkActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for HDInsightSparkActivity. +func (hisa HDInsightSparkActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for HDInsightSparkActivity. func (hisa HDInsightSparkActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -123484,7 +124053,7 @@ type HDInsightStreamingActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -123682,6 +124251,11 @@ func (hisa HDInsightStreamingActivity) AsUntilActivity() (*UntilActivity, bool) return nil, false } +// AsFailActivity is the BasicActivity implementation for HDInsightStreamingActivity. +func (hisa HDInsightStreamingActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for HDInsightStreamingActivity. func (hisa HDInsightStreamingActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -130662,7 +131236,7 @@ type IfConditionActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -130854,6 +131428,11 @@ func (ica IfConditionActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for IfConditionActivity. +func (ica IfConditionActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for IfConditionActivity. func (ica IfConditionActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -141609,6 +142188,8 @@ func (lirka LinkedIntegrationRuntimeKeyAuthorization) AsBasicLinkedIntegrationRu type LinkedIntegrationRuntimeRbacAuthorization struct { // ResourceID - The resource identifier of the integration runtime to be shared. ResourceID *string `json:"resourceId,omitempty"` + // Credential - The credential reference containing authentication information. + Credential *CredentialReference `json:"credential,omitempty"` // AuthorizationType - Possible values include: 'AuthorizationTypeLinkedIntegrationRuntimeType', 'AuthorizationTypeRBAC', 'AuthorizationTypeKey' AuthorizationType AuthorizationType `json:"authorizationType,omitempty"` } @@ -141620,6 +142201,9 @@ func (lirra LinkedIntegrationRuntimeRbacAuthorization) MarshalJSON() ([]byte, er if lirra.ResourceID != nil { objectMap["resourceId"] = lirra.ResourceID } + if lirra.Credential != nil { + objectMap["credential"] = lirra.Credential + } if lirra.AuthorizationType != "" { objectMap["authorizationType"] = lirra.AuthorizationType } @@ -143358,7 +143942,7 @@ type LookupActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -143556,6 +144140,11 @@ func (la LookupActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for LookupActivity. +func (la LookupActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for LookupActivity. func (la LookupActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -221658,7 +222247,7 @@ type SetVariableActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -221850,6 +222439,11 @@ func (sva SetVariableActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for SetVariableActivity. +func (sva SetVariableActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for SetVariableActivity. func (sva SetVariableActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -236471,7 +237065,7 @@ type SQLServerStoredProcedureActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -236669,6 +237263,11 @@ func (ssspa SQLServerStoredProcedureActivity) AsUntilActivity() (*UntilActivity, return nil, false } +// AsFailActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. +func (ssspa SQLServerStoredProcedureActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for SQLServerStoredProcedureActivity. func (ssspa SQLServerStoredProcedureActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -242218,7 +242817,7 @@ type SwitchActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -242410,6 +243009,11 @@ func (sa SwitchActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for SwitchActivity. +func (sa SwitchActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for SwitchActivity. func (sa SwitchActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -249653,7 +250257,7 @@ type UntilActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -249845,6 +250449,11 @@ func (ua UntilActivity) AsUntilActivity() (*UntilActivity, bool) { return &ua, true } +// AsFailActivity is the BasicActivity implementation for UntilActivity. +func (ua UntilActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for UntilActivity. func (ua UntilActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -250072,7 +250681,7 @@ type ValidationActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -250264,6 +250873,11 @@ func (va ValidationActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for ValidationActivity. +func (va ValidationActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for ValidationActivity. func (va ValidationActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -252392,7 +253006,7 @@ type WaitActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -252584,6 +253198,11 @@ func (wa WaitActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for WaitActivity. +func (wa WaitActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for WaitActivity. func (wa WaitActivity) AsWaitActivity() (*WaitActivity, bool) { return &wa, true @@ -252734,7 +253353,7 @@ type WebActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -252932,6 +253551,11 @@ func (wa WebActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for WebActivity. +func (wa WebActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for WebActivity. func (wa WebActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false @@ -253459,7 +254083,7 @@ type WebHookActivity struct { DependsOn *[]ActivityDependency `json:"dependsOn,omitempty"` // UserProperties - Activity user properties. UserProperties *[]UserProperty `json:"userProperties,omitempty"` - // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' + // Type - Possible values include: 'TypeBasicActivityTypeActivity', 'TypeBasicActivityTypeExecuteWranglingDataflow', 'TypeBasicActivityTypeExecuteDataFlow', 'TypeBasicActivityTypeAzureFunctionActivity', 'TypeBasicActivityTypeDatabricksSparkPython', 'TypeBasicActivityTypeDatabricksSparkJar', 'TypeBasicActivityTypeDatabricksNotebook', 'TypeBasicActivityTypeDataLakeAnalyticsUSQL', 'TypeBasicActivityTypeAzureMLExecutePipeline', 'TypeBasicActivityTypeAzureMLUpdateResource', 'TypeBasicActivityTypeAzureMLBatchExecution', 'TypeBasicActivityTypeGetMetadata', 'TypeBasicActivityTypeWebActivity', 'TypeBasicActivityTypeLookup', 'TypeBasicActivityTypeAzureDataExplorerCommand', 'TypeBasicActivityTypeDelete', 'TypeBasicActivityTypeSQLServerStoredProcedure', 'TypeBasicActivityTypeCustom', 'TypeBasicActivityTypeExecuteSSISPackage', 'TypeBasicActivityTypeHDInsightSpark', 'TypeBasicActivityTypeHDInsightStreaming', 'TypeBasicActivityTypeHDInsightMapReduce', 'TypeBasicActivityTypeHDInsightPig', 'TypeBasicActivityTypeHDInsightHive', 'TypeBasicActivityTypeCopy', 'TypeBasicActivityTypeExecution', 'TypeBasicActivityTypeWebHook', 'TypeBasicActivityTypeAppendVariable', 'TypeBasicActivityTypeSetVariable', 'TypeBasicActivityTypeFilter', 'TypeBasicActivityTypeValidation', 'TypeBasicActivityTypeUntil', 'TypeBasicActivityTypeFail', 'TypeBasicActivityTypeWait', 'TypeBasicActivityTypeForEach', 'TypeBasicActivityTypeSwitch', 'TypeBasicActivityTypeIfCondition', 'TypeBasicActivityTypeExecutePipeline', 'TypeBasicActivityTypeContainer' Type TypeBasicActivity `json:"type,omitempty"` } @@ -253651,6 +254275,11 @@ func (wha WebHookActivity) AsUntilActivity() (*UntilActivity, bool) { return nil, false } +// AsFailActivity is the BasicActivity implementation for WebHookActivity. +func (wha WebHookActivity) AsFailActivity() (*FailActivity, bool) { + return nil, false +} + // AsWaitActivity is the BasicActivity implementation for WebHookActivity. func (wha WebHookActivity) AsWaitActivity() (*WaitActivity, bool) { return nil, false From 9ce1599387ae5949a74a921881aa27166aed0a2b Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:22:29 +0800 Subject: [PATCH 5/8] Generated from specification/iothub/resource-manager/readme.md tag package-2021-07-02 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- .../iothub/mgmt/devices/devicesapi/models.go | 2 +- profiles/latest/iothub/mgmt/devices/models.go | 15 +- .../iothub/mgmt/devices/devicesapi/models.go | 2 +- .../preview/iothub/mgmt/devices/models.go | 15 +- .../mgmt/2021-07-02/devices/CHANGELOG.md | 2 + .../iothub/mgmt/2021-07-02/devices/_meta.json | 11 + .../mgmt/2021-07-02/devices/certificates.go | 551 ++++ .../iothub/mgmt/2021-07-02/devices/client.go | 41 + .../devices/devicesapi/interfaces.go | 102 + .../iothub/mgmt/2021-07-02/devices/enums.go | 429 +++ .../iothub/mgmt/2021-07-02/devices/iothub.go | 121 + .../mgmt/2021-07-02/devices/iothubresource.go | 2247 +++++++++++++ .../iothub/mgmt/2021-07-02/devices/models.go | 2844 +++++++++++++++++ .../mgmt/2021-07-02/devices/operations.go | 140 + .../devices/privateendpointconnections.go | 364 +++ .../devices/privatelinkresources.go | 186 ++ .../devices/resourceprovidercommon.go | 103 + .../iothub/mgmt/2021-07-02/devices/version.go | 19 + 18 files changed, 7190 insertions(+), 4 deletions(-) create mode 100644 services/iothub/mgmt/2021-07-02/devices/CHANGELOG.md create mode 100644 services/iothub/mgmt/2021-07-02/devices/_meta.json create mode 100644 services/iothub/mgmt/2021-07-02/devices/certificates.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/client.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/devicesapi/interfaces.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/enums.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/iothub.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/iothubresource.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/models.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/operations.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/privateendpointconnections.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/privatelinkresources.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/resourceprovidercommon.go create mode 100644 services/iothub/mgmt/2021-07-02/devices/version.go diff --git a/profiles/latest/iothub/mgmt/devices/devicesapi/models.go b/profiles/latest/iothub/mgmt/devices/devicesapi/models.go index 29756f55c141..e12473782696 100644 --- a/profiles/latest/iothub/mgmt/devices/devicesapi/models.go +++ b/profiles/latest/iothub/mgmt/devices/devicesapi/models.go @@ -9,7 +9,7 @@ package devicesapi -import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-03-31/devices/devicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices/devicesapi" type CertificatesClientAPI = original.CertificatesClientAPI type IotHubClientAPI = original.IotHubClientAPI diff --git a/profiles/latest/iothub/mgmt/devices/models.go b/profiles/latest/iothub/mgmt/devices/models.go index 8afe6b3f33bd..7d3057f87aaa 100644 --- a/profiles/latest/iothub/mgmt/devices/models.go +++ b/profiles/latest/iothub/mgmt/devices/models.go @@ -12,7 +12,7 @@ package devices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-03-31/devices" + original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices" ) const ( @@ -53,6 +53,15 @@ const ( CapabilitiesNone Capabilities = original.CapabilitiesNone ) +type CreatedByType = original.CreatedByType + +const ( + CreatedByTypeApplication CreatedByType = original.CreatedByTypeApplication + CreatedByTypeKey CreatedByType = original.CreatedByTypeKey + CreatedByTypeManagedIdentity CreatedByType = original.CreatedByTypeManagedIdentity + CreatedByTypeUser CreatedByType = original.CreatedByTypeUser +) + type DefaultAction = original.DefaultAction const ( @@ -315,6 +324,7 @@ type SharedAccessSignatureAuthorizationRuleListResult = original.SharedAccessSig type SharedAccessSignatureAuthorizationRuleListResultIterator = original.SharedAccessSignatureAuthorizationRuleListResultIterator type SharedAccessSignatureAuthorizationRuleListResultPage = original.SharedAccessSignatureAuthorizationRuleListResultPage type StorageEndpointProperties = original.StorageEndpointProperties +type SystemData = original.SystemData type TagsResource = original.TagsResource type TestAllRoutesInput = original.TestAllRoutesInput type TestAllRoutesResult = original.TestAllRoutesResult @@ -429,6 +439,9 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { func PossibleCapabilitiesValues() []Capabilities { return original.PossibleCapabilitiesValues() } +func PossibleCreatedByTypeValues() []CreatedByType { + return original.PossibleCreatedByTypeValues() +} func PossibleDefaultActionValues() []DefaultAction { return original.PossibleDefaultActionValues() } diff --git a/profiles/preview/iothub/mgmt/devices/devicesapi/models.go b/profiles/preview/iothub/mgmt/devices/devicesapi/models.go index 29756f55c141..e12473782696 100644 --- a/profiles/preview/iothub/mgmt/devices/devicesapi/models.go +++ b/profiles/preview/iothub/mgmt/devices/devicesapi/models.go @@ -9,7 +9,7 @@ package devicesapi -import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-03-31/devices/devicesapi" +import original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices/devicesapi" type CertificatesClientAPI = original.CertificatesClientAPI type IotHubClientAPI = original.IotHubClientAPI diff --git a/profiles/preview/iothub/mgmt/devices/models.go b/profiles/preview/iothub/mgmt/devices/models.go index 813d2cac617d..f5be237c1c6d 100644 --- a/profiles/preview/iothub/mgmt/devices/models.go +++ b/profiles/preview/iothub/mgmt/devices/models.go @@ -12,7 +12,7 @@ package devices import ( "context" - original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-03-31/devices" + original "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices" ) const ( @@ -53,6 +53,15 @@ const ( CapabilitiesNone Capabilities = original.CapabilitiesNone ) +type CreatedByType = original.CreatedByType + +const ( + CreatedByTypeApplication CreatedByType = original.CreatedByTypeApplication + CreatedByTypeKey CreatedByType = original.CreatedByTypeKey + CreatedByTypeManagedIdentity CreatedByType = original.CreatedByTypeManagedIdentity + CreatedByTypeUser CreatedByType = original.CreatedByTypeUser +) + type DefaultAction = original.DefaultAction const ( @@ -315,6 +324,7 @@ type SharedAccessSignatureAuthorizationRuleListResult = original.SharedAccessSig type SharedAccessSignatureAuthorizationRuleListResultIterator = original.SharedAccessSignatureAuthorizationRuleListResultIterator type SharedAccessSignatureAuthorizationRuleListResultPage = original.SharedAccessSignatureAuthorizationRuleListResultPage type StorageEndpointProperties = original.StorageEndpointProperties +type SystemData = original.SystemData type TagsResource = original.TagsResource type TestAllRoutesInput = original.TestAllRoutesInput type TestAllRoutesResult = original.TestAllRoutesResult @@ -429,6 +439,9 @@ func PossibleAuthenticationTypeValues() []AuthenticationType { func PossibleCapabilitiesValues() []Capabilities { return original.PossibleCapabilitiesValues() } +func PossibleCreatedByTypeValues() []CreatedByType { + return original.PossibleCreatedByTypeValues() +} func PossibleDefaultActionValues() []DefaultAction { return original.PossibleDefaultActionValues() } diff --git a/services/iothub/mgmt/2021-07-02/devices/CHANGELOG.md b/services/iothub/mgmt/2021-07-02/devices/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/iothub/mgmt/2021-07-02/devices/_meta.json b/services/iothub/mgmt/2021-07-02/devices/_meta.json new file mode 100644 index 000000000000..2af469a1cc7e --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", + "readme": "/_/azure-rest-api-specs/specification/iothub/resource-manager/readme.md", + "tag": "package-2021-07-02", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-2021-07-02 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/iothub/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" + } +} \ No newline at end of file diff --git a/services/iothub/mgmt/2021-07-02/devices/certificates.go b/services/iothub/mgmt/2021-07-02/devices/certificates.go new file mode 100644 index 000000000000..e4d844c3e9a1 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/certificates.go @@ -0,0 +1,551 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// CertificatesClient is the use this API to manage the IoT hubs in your Azure subscription. +type CertificatesClient struct { + BaseClient +} + +// NewCertificatesClient creates an instance of the CertificatesClient client. +func NewCertificatesClient(subscriptionID string) CertificatesClient { + return NewCertificatesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewCertificatesClientWithBaseURI creates an instance of the CertificatesClient client using a custom endpoint. Use +// this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewCertificatesClientWithBaseURI(baseURI string, subscriptionID string) CertificatesClient { + return CertificatesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate adds new or replaces existing certificate. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// certificateName - the name of the certificate +// certificateDescription - the certificate body. +// ifMatch - eTag of the Certificate. Do not specify for creating a brand new certificate. Required to update +// an existing certificate. +func (client CertificatesClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateDescription CertificateDescription, ifMatch string) (result CertificateDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.CertificatesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, certificateName, certificateDescription, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client CertificatesClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateDescription CertificateDescription, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + certificateDescription.ID = nil + certificateDescription.Name = nil + certificateDescription.Etag = nil + certificateDescription.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", pathParameters), + autorest.WithJSON(certificateDescription), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client CertificatesClient) CreateOrUpdateResponder(resp *http.Response) (result CertificateDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete deletes an existing X509 certificate or does nothing if it does not exist. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// certificateName - the name of the certificate +// ifMatch - eTag of the Certificate. +func (client CertificatesClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.Delete") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.CertificatesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, certificateName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Delete", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Delete", resp, "Failure sending request") + return + } + + result, err = client.DeleteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Delete", resp, "Failure responding to request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client CertificatesClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) DeleteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client CertificatesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// GenerateVerificationCode generates verification code for proof of possession flow. The verification code will be +// used to generate a leaf certificate. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// certificateName - the name of the certificate +// ifMatch - eTag of the Certificate. +func (client CertificatesClient) GenerateVerificationCode(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (result CertificateWithNonceDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.GenerateVerificationCode") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.CertificatesClient", "GenerateVerificationCode", err.Error()) + } + + req, err := client.GenerateVerificationCodePreparer(ctx, resourceGroupName, resourceName, certificateName, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "GenerateVerificationCode", nil, "Failure preparing request") + return + } + + resp, err := client.GenerateVerificationCodeSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "GenerateVerificationCode", resp, "Failure sending request") + return + } + + result, err = client.GenerateVerificationCodeResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "GenerateVerificationCode", resp, "Failure responding to request") + return + } + + return +} + +// GenerateVerificationCodePreparer prepares the GenerateVerificationCode request. +func (client CertificatesClient) GenerateVerificationCodePreparer(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/generateVerificationCode", pathParameters), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GenerateVerificationCodeSender sends the GenerateVerificationCode request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) GenerateVerificationCodeSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GenerateVerificationCodeResponder handles the response to the GenerateVerificationCode request. The method always +// closes the http.Response Body. +func (client CertificatesClient) GenerateVerificationCodeResponder(resp *http.Response) (result CertificateWithNonceDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get returns the certificate. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// certificateName - the name of the certificate +func (client CertificatesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, certificateName string) (result CertificateDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.CertificatesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, certificateName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client CertificatesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, certificateName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client CertificatesClient) GetResponder(resp *http.Response) (result CertificateDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByIotHub returns the list of certificates. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client CertificatesClient) ListByIotHub(ctx context.Context, resourceGroupName string, resourceName string) (result CertificateListDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.ListByIotHub") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListByIotHubPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "ListByIotHub", nil, "Failure preparing request") + return + } + + resp, err := client.ListByIotHubSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "ListByIotHub", resp, "Failure sending request") + return + } + + result, err = client.ListByIotHubResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "ListByIotHub", resp, "Failure responding to request") + return + } + + return +} + +// ListByIotHubPreparer prepares the ListByIotHub request. +func (client CertificatesClient) ListByIotHubPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByIotHubSender sends the ListByIotHub request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) ListByIotHubSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByIotHubResponder handles the response to the ListByIotHub request. The method always +// closes the http.Response Body. +func (client CertificatesClient) ListByIotHubResponder(resp *http.Response) (result CertificateListDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Verify verifies the certificate's private key possession by providing the leaf cert issued by the verifying pre +// uploaded certificate. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// certificateName - the name of the certificate +// certificateVerificationBody - the name of the certificate +// ifMatch - eTag of the Certificate. +func (client CertificatesClient) Verify(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateVerificationBody CertificateVerificationDescription, ifMatch string) (result CertificateDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/CertificatesClient.Verify") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: certificateName, + Constraints: []validation.Constraint{{Target: "certificateName", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.CertificatesClient", "Verify", err.Error()) + } + + req, err := client.VerifyPreparer(ctx, resourceGroupName, resourceName, certificateName, certificateVerificationBody, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Verify", nil, "Failure preparing request") + return + } + + resp, err := client.VerifySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Verify", resp, "Failure sending request") + return + } + + result, err = client.VerifyResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.CertificatesClient", "Verify", resp, "Failure responding to request") + return + } + + return +} + +// VerifyPreparer prepares the Verify request. +func (client CertificatesClient) VerifyPreparer(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateVerificationBody CertificateVerificationDescription, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "certificateName": autorest.Encode("path", certificateName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/certificates/{certificateName}/verify", pathParameters), + autorest.WithJSON(certificateVerificationBody), + autorest.WithQueryParameters(queryParameters), + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// VerifySender sends the Verify request. The method will close the +// http.Response Body if it receives an error. +func (client CertificatesClient) VerifySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// VerifyResponder handles the response to the Verify request. The method always +// closes the http.Response Body. +func (client CertificatesClient) VerifyResponder(resp *http.Response) (result CertificateDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/client.go b/services/iothub/mgmt/2021-07-02/devices/client.go new file mode 100644 index 000000000000..6e29b029f667 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/client.go @@ -0,0 +1,41 @@ +// Package devices implements the Azure ARM Devices service API version 2021-07-02. +// +// Use this API to manage the IoT hubs in your Azure subscription. +package devices + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Devices + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Devices. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/iothub/mgmt/2021-07-02/devices/devicesapi/interfaces.go b/services/iothub/mgmt/2021-07-02/devices/devicesapi/interfaces.go new file mode 100644 index 000000000000..3bc0f867f281 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/devicesapi/interfaces.go @@ -0,0 +1,102 @@ +package devicesapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices" + "github.com/Azure/go-autorest/autorest" +) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result devices.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result devices.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*devices.OperationsClient)(nil) + +// IotHubResourceClientAPI contains the set of methods on the IotHubResourceClient type. +type IotHubResourceClientAPI interface { + CheckNameAvailability(ctx context.Context, operationInputs devices.OperationInputs) (result devices.IotHubNameAvailabilityInfo, err error) + CreateEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string, consumerGroupBody devices.EventHubConsumerGroupBodyDescription) (result devices.EventHubConsumerGroupInfo, err error) + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, iotHubDescription devices.IotHubDescription, ifMatch string) (result devices.IotHubResourceCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string) (result devices.IotHubResourceDeleteFuture, err error) + DeleteEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result autorest.Response, err error) + ExportDevices(ctx context.Context, resourceGroupName string, resourceName string, exportDevicesParameters devices.ExportDevicesRequest) (result devices.JobResponse, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string) (result devices.IotHubDescription, err error) + GetEndpointHealth(ctx context.Context, resourceGroupName string, iotHubName string) (result devices.EndpointHealthDataListResultPage, err error) + GetEndpointHealthComplete(ctx context.Context, resourceGroupName string, iotHubName string) (result devices.EndpointHealthDataListResultIterator, err error) + GetEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result devices.EventHubConsumerGroupInfo, err error) + GetJob(ctx context.Context, resourceGroupName string, resourceName string, jobID string) (result devices.JobResponse, err error) + GetKeysForKeyName(ctx context.Context, resourceGroupName string, resourceName string, keyName string) (result devices.SharedAccessSignatureAuthorizationRule, err error) + GetQuotaMetrics(ctx context.Context, resourceGroupName string, resourceName string) (result devices.IotHubQuotaMetricInfoListResultPage, err error) + GetQuotaMetricsComplete(ctx context.Context, resourceGroupName string, resourceName string) (result devices.IotHubQuotaMetricInfoListResultIterator, err error) + GetStats(ctx context.Context, resourceGroupName string, resourceName string) (result devices.RegistryStatistics, err error) + GetValidSkus(ctx context.Context, resourceGroupName string, resourceName string) (result devices.IotHubSkuDescriptionListResultPage, err error) + GetValidSkusComplete(ctx context.Context, resourceGroupName string, resourceName string) (result devices.IotHubSkuDescriptionListResultIterator, err error) + ImportDevices(ctx context.Context, resourceGroupName string, resourceName string, importDevicesParameters devices.ImportDevicesRequest) (result devices.JobResponse, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result devices.IotHubDescriptionListResultPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result devices.IotHubDescriptionListResultIterator, err error) + ListBySubscription(ctx context.Context) (result devices.IotHubDescriptionListResultPage, err error) + ListBySubscriptionComplete(ctx context.Context) (result devices.IotHubDescriptionListResultIterator, err error) + ListEventHubConsumerGroups(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string) (result devices.EventHubConsumerGroupsListResultPage, err error) + ListEventHubConsumerGroupsComplete(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string) (result devices.EventHubConsumerGroupsListResultIterator, err error) + ListJobs(ctx context.Context, resourceGroupName string, resourceName string) (result devices.JobResponseListResultPage, err error) + ListJobsComplete(ctx context.Context, resourceGroupName string, resourceName string) (result devices.JobResponseListResultIterator, err error) + ListKeys(ctx context.Context, resourceGroupName string, resourceName string) (result devices.SharedAccessSignatureAuthorizationRuleListResultPage, err error) + ListKeysComplete(ctx context.Context, resourceGroupName string, resourceName string) (result devices.SharedAccessSignatureAuthorizationRuleListResultIterator, err error) + TestAllRoutes(ctx context.Context, input devices.TestAllRoutesInput, iotHubName string, resourceGroupName string) (result devices.TestAllRoutesResult, err error) + TestRoute(ctx context.Context, input devices.TestRouteInput, iotHubName string, resourceGroupName string) (result devices.TestRouteResult, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, iotHubTags devices.TagsResource) (result devices.IotHubResourceUpdateFuture, err error) +} + +var _ IotHubResourceClientAPI = (*devices.IotHubResourceClient)(nil) + +// ResourceProviderCommonClientAPI contains the set of methods on the ResourceProviderCommonClient type. +type ResourceProviderCommonClientAPI interface { + GetSubscriptionQuota(ctx context.Context) (result devices.UserSubscriptionQuotaListResult, err error) +} + +var _ ResourceProviderCommonClientAPI = (*devices.ResourceProviderCommonClient)(nil) + +// CertificatesClientAPI contains the set of methods on the CertificatesClient type. +type CertificatesClientAPI interface { + CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateDescription devices.CertificateDescription, ifMatch string) (result devices.CertificateDescription, err error) + Delete(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (result autorest.Response, err error) + GenerateVerificationCode(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, ifMatch string) (result devices.CertificateWithNonceDescription, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, certificateName string) (result devices.CertificateDescription, err error) + ListByIotHub(ctx context.Context, resourceGroupName string, resourceName string) (result devices.CertificateListDescription, err error) + Verify(ctx context.Context, resourceGroupName string, resourceName string, certificateName string, certificateVerificationBody devices.CertificateVerificationDescription, ifMatch string) (result devices.CertificateDescription, err error) +} + +var _ CertificatesClientAPI = (*devices.CertificatesClient)(nil) + +// IotHubClientAPI contains the set of methods on the IotHubClient type. +type IotHubClientAPI interface { + ManualFailover(ctx context.Context, iotHubName string, failoverInput devices.FailoverInput, resourceGroupName string) (result devices.IotHubManualFailoverFuture, err error) +} + +var _ IotHubClientAPI = (*devices.IotHubClient)(nil) + +// PrivateLinkResourcesClientAPI contains the set of methods on the PrivateLinkResourcesClient type. +type PrivateLinkResourcesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, resourceName string, groupID string) (result devices.GroupIDInformation, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result devices.PrivateLinkResources, err error) +} + +var _ PrivateLinkResourcesClientAPI = (*devices.PrivateLinkResourcesClient)(nil) + +// PrivateEndpointConnectionsClientAPI contains the set of methods on the PrivateEndpointConnectionsClient type. +type PrivateEndpointConnectionsClientAPI interface { + Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result devices.PrivateEndpointConnectionsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result devices.PrivateEndpointConnection, err error) + List(ctx context.Context, resourceGroupName string, resourceName string) (result devices.ListPrivateEndpointConnection, err error) + Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection devices.PrivateEndpointConnection) (result devices.PrivateEndpointConnectionsUpdateFuture, err error) +} + +var _ PrivateEndpointConnectionsClientAPI = (*devices.PrivateEndpointConnectionsClient)(nil) diff --git a/services/iothub/mgmt/2021-07-02/devices/enums.go b/services/iothub/mgmt/2021-07-02/devices/enums.go new file mode 100644 index 000000000000..8b582f01371c --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/enums.go @@ -0,0 +1,429 @@ +package devices + +// 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. + +// AccessRights enumerates the values for access rights. +type AccessRights string + +const ( + // AccessRightsDeviceConnect ... + AccessRightsDeviceConnect AccessRights = "DeviceConnect" + // AccessRightsRegistryRead ... + AccessRightsRegistryRead AccessRights = "RegistryRead" + // AccessRightsRegistryReadDeviceConnect ... + AccessRightsRegistryReadDeviceConnect AccessRights = "RegistryRead, DeviceConnect" + // AccessRightsRegistryReadRegistryWrite ... + AccessRightsRegistryReadRegistryWrite AccessRights = "RegistryRead, RegistryWrite" + // AccessRightsRegistryReadRegistryWriteDeviceConnect ... + AccessRightsRegistryReadRegistryWriteDeviceConnect AccessRights = "RegistryRead, RegistryWrite, DeviceConnect" + // AccessRightsRegistryReadRegistryWriteServiceConnect ... + AccessRightsRegistryReadRegistryWriteServiceConnect AccessRights = "RegistryRead, RegistryWrite, ServiceConnect" + // AccessRightsRegistryReadRegistryWriteServiceConnectDeviceConnect ... + AccessRightsRegistryReadRegistryWriteServiceConnectDeviceConnect AccessRights = "RegistryRead, RegistryWrite, ServiceConnect, DeviceConnect" + // AccessRightsRegistryReadServiceConnect ... + AccessRightsRegistryReadServiceConnect AccessRights = "RegistryRead, ServiceConnect" + // AccessRightsRegistryReadServiceConnectDeviceConnect ... + AccessRightsRegistryReadServiceConnectDeviceConnect AccessRights = "RegistryRead, ServiceConnect, DeviceConnect" + // AccessRightsRegistryWrite ... + AccessRightsRegistryWrite AccessRights = "RegistryWrite" + // AccessRightsRegistryWriteDeviceConnect ... + AccessRightsRegistryWriteDeviceConnect AccessRights = "RegistryWrite, DeviceConnect" + // AccessRightsRegistryWriteServiceConnect ... + AccessRightsRegistryWriteServiceConnect AccessRights = "RegistryWrite, ServiceConnect" + // AccessRightsRegistryWriteServiceConnectDeviceConnect ... + AccessRightsRegistryWriteServiceConnectDeviceConnect AccessRights = "RegistryWrite, ServiceConnect, DeviceConnect" + // AccessRightsServiceConnect ... + AccessRightsServiceConnect AccessRights = "ServiceConnect" + // AccessRightsServiceConnectDeviceConnect ... + AccessRightsServiceConnectDeviceConnect AccessRights = "ServiceConnect, DeviceConnect" +) + +// PossibleAccessRightsValues returns an array of possible values for the AccessRights const type. +func PossibleAccessRightsValues() []AccessRights { + return []AccessRights{AccessRightsDeviceConnect, AccessRightsRegistryRead, AccessRightsRegistryReadDeviceConnect, AccessRightsRegistryReadRegistryWrite, AccessRightsRegistryReadRegistryWriteDeviceConnect, AccessRightsRegistryReadRegistryWriteServiceConnect, AccessRightsRegistryReadRegistryWriteServiceConnectDeviceConnect, AccessRightsRegistryReadServiceConnect, AccessRightsRegistryReadServiceConnectDeviceConnect, AccessRightsRegistryWrite, AccessRightsRegistryWriteDeviceConnect, AccessRightsRegistryWriteServiceConnect, AccessRightsRegistryWriteServiceConnectDeviceConnect, AccessRightsServiceConnect, AccessRightsServiceConnectDeviceConnect} +} + +// AuthenticationType enumerates the values for authentication type. +type AuthenticationType string + +const ( + // AuthenticationTypeIdentityBased ... + AuthenticationTypeIdentityBased AuthenticationType = "identityBased" + // AuthenticationTypeKeyBased ... + AuthenticationTypeKeyBased AuthenticationType = "keyBased" +) + +// PossibleAuthenticationTypeValues returns an array of possible values for the AuthenticationType const type. +func PossibleAuthenticationTypeValues() []AuthenticationType { + return []AuthenticationType{AuthenticationTypeIdentityBased, AuthenticationTypeKeyBased} +} + +// Capabilities enumerates the values for capabilities. +type Capabilities string + +const ( + // CapabilitiesDeviceManagement ... + CapabilitiesDeviceManagement Capabilities = "DeviceManagement" + // CapabilitiesNone ... + CapabilitiesNone Capabilities = "None" +) + +// PossibleCapabilitiesValues returns an array of possible values for the Capabilities const type. +func PossibleCapabilitiesValues() []Capabilities { + return []Capabilities{CapabilitiesDeviceManagement, CapabilitiesNone} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// DefaultAction enumerates the values for default action. +type DefaultAction string + +const ( + // DefaultActionAllow ... + DefaultActionAllow DefaultAction = "Allow" + // DefaultActionDeny ... + DefaultActionDeny DefaultAction = "Deny" +) + +// PossibleDefaultActionValues returns an array of possible values for the DefaultAction const type. +func PossibleDefaultActionValues() []DefaultAction { + return []DefaultAction{DefaultActionAllow, DefaultActionDeny} +} + +// Encoding enumerates the values for encoding. +type Encoding string + +const ( + // EncodingAvro ... + EncodingAvro Encoding = "Avro" + // EncodingAvroDeflate ... + EncodingAvroDeflate Encoding = "AvroDeflate" + // EncodingJSON ... + EncodingJSON Encoding = "JSON" +) + +// PossibleEncodingValues returns an array of possible values for the Encoding const type. +func PossibleEncodingValues() []Encoding { + return []Encoding{EncodingAvro, EncodingAvroDeflate, EncodingJSON} +} + +// EndpointHealthStatus enumerates the values for endpoint health status. +type EndpointHealthStatus string + +const ( + // EndpointHealthStatusDead ... + EndpointHealthStatusDead EndpointHealthStatus = "dead" + // EndpointHealthStatusDegraded ... + EndpointHealthStatusDegraded EndpointHealthStatus = "degraded" + // EndpointHealthStatusHealthy ... + EndpointHealthStatusHealthy EndpointHealthStatus = "healthy" + // EndpointHealthStatusUnhealthy ... + EndpointHealthStatusUnhealthy EndpointHealthStatus = "unhealthy" + // EndpointHealthStatusUnknown ... + EndpointHealthStatusUnknown EndpointHealthStatus = "unknown" +) + +// PossibleEndpointHealthStatusValues returns an array of possible values for the EndpointHealthStatus const type. +func PossibleEndpointHealthStatusValues() []EndpointHealthStatus { + return []EndpointHealthStatus{EndpointHealthStatusDead, EndpointHealthStatusDegraded, EndpointHealthStatusHealthy, EndpointHealthStatusUnhealthy, EndpointHealthStatusUnknown} +} + +// IotHubNameUnavailabilityReason enumerates the values for iot hub name unavailability reason. +type IotHubNameUnavailabilityReason string + +const ( + // IotHubNameUnavailabilityReasonAlreadyExists ... + IotHubNameUnavailabilityReasonAlreadyExists IotHubNameUnavailabilityReason = "AlreadyExists" + // IotHubNameUnavailabilityReasonInvalid ... + IotHubNameUnavailabilityReasonInvalid IotHubNameUnavailabilityReason = "Invalid" +) + +// PossibleIotHubNameUnavailabilityReasonValues returns an array of possible values for the IotHubNameUnavailabilityReason const type. +func PossibleIotHubNameUnavailabilityReasonValues() []IotHubNameUnavailabilityReason { + return []IotHubNameUnavailabilityReason{IotHubNameUnavailabilityReasonAlreadyExists, IotHubNameUnavailabilityReasonInvalid} +} + +// IotHubReplicaRoleType enumerates the values for iot hub replica role type. +type IotHubReplicaRoleType string + +const ( + // IotHubReplicaRoleTypePrimary ... + IotHubReplicaRoleTypePrimary IotHubReplicaRoleType = "primary" + // IotHubReplicaRoleTypeSecondary ... + IotHubReplicaRoleTypeSecondary IotHubReplicaRoleType = "secondary" +) + +// PossibleIotHubReplicaRoleTypeValues returns an array of possible values for the IotHubReplicaRoleType const type. +func PossibleIotHubReplicaRoleTypeValues() []IotHubReplicaRoleType { + return []IotHubReplicaRoleType{IotHubReplicaRoleTypePrimary, IotHubReplicaRoleTypeSecondary} +} + +// IotHubScaleType enumerates the values for iot hub scale type. +type IotHubScaleType string + +const ( + // IotHubScaleTypeAutomatic ... + IotHubScaleTypeAutomatic IotHubScaleType = "Automatic" + // IotHubScaleTypeManual ... + IotHubScaleTypeManual IotHubScaleType = "Manual" + // IotHubScaleTypeNone ... + IotHubScaleTypeNone IotHubScaleType = "None" +) + +// PossibleIotHubScaleTypeValues returns an array of possible values for the IotHubScaleType const type. +func PossibleIotHubScaleTypeValues() []IotHubScaleType { + return []IotHubScaleType{IotHubScaleTypeAutomatic, IotHubScaleTypeManual, IotHubScaleTypeNone} +} + +// IotHubSku enumerates the values for iot hub sku. +type IotHubSku string + +const ( + // IotHubSkuB1 ... + IotHubSkuB1 IotHubSku = "B1" + // IotHubSkuB2 ... + IotHubSkuB2 IotHubSku = "B2" + // IotHubSkuB3 ... + IotHubSkuB3 IotHubSku = "B3" + // IotHubSkuF1 ... + IotHubSkuF1 IotHubSku = "F1" + // IotHubSkuS1 ... + IotHubSkuS1 IotHubSku = "S1" + // IotHubSkuS2 ... + IotHubSkuS2 IotHubSku = "S2" + // IotHubSkuS3 ... + IotHubSkuS3 IotHubSku = "S3" +) + +// PossibleIotHubSkuValues returns an array of possible values for the IotHubSku const type. +func PossibleIotHubSkuValues() []IotHubSku { + return []IotHubSku{IotHubSkuB1, IotHubSkuB2, IotHubSkuB3, IotHubSkuF1, IotHubSkuS1, IotHubSkuS2, IotHubSkuS3} +} + +// IotHubSkuTier enumerates the values for iot hub sku tier. +type IotHubSkuTier string + +const ( + // IotHubSkuTierBasic ... + IotHubSkuTierBasic IotHubSkuTier = "Basic" + // IotHubSkuTierFree ... + IotHubSkuTierFree IotHubSkuTier = "Free" + // IotHubSkuTierStandard ... + IotHubSkuTierStandard IotHubSkuTier = "Standard" +) + +// PossibleIotHubSkuTierValues returns an array of possible values for the IotHubSkuTier const type. +func PossibleIotHubSkuTierValues() []IotHubSkuTier { + return []IotHubSkuTier{IotHubSkuTierBasic, IotHubSkuTierFree, IotHubSkuTierStandard} +} + +// IPFilterActionType enumerates the values for ip filter action type. +type IPFilterActionType string + +const ( + // IPFilterActionTypeAccept ... + IPFilterActionTypeAccept IPFilterActionType = "Accept" + // IPFilterActionTypeReject ... + IPFilterActionTypeReject IPFilterActionType = "Reject" +) + +// PossibleIPFilterActionTypeValues returns an array of possible values for the IPFilterActionType const type. +func PossibleIPFilterActionTypeValues() []IPFilterActionType { + return []IPFilterActionType{IPFilterActionTypeAccept, IPFilterActionTypeReject} +} + +// JobStatus enumerates the values for job status. +type JobStatus string + +const ( + // JobStatusCancelled ... + JobStatusCancelled JobStatus = "cancelled" + // JobStatusCompleted ... + JobStatusCompleted JobStatus = "completed" + // JobStatusEnqueued ... + JobStatusEnqueued JobStatus = "enqueued" + // JobStatusFailed ... + JobStatusFailed JobStatus = "failed" + // JobStatusRunning ... + JobStatusRunning JobStatus = "running" + // JobStatusUnknown ... + JobStatusUnknown JobStatus = "unknown" +) + +// PossibleJobStatusValues returns an array of possible values for the JobStatus const type. +func PossibleJobStatusValues() []JobStatus { + return []JobStatus{JobStatusCancelled, JobStatusCompleted, JobStatusEnqueued, JobStatusFailed, JobStatusRunning, JobStatusUnknown} +} + +// JobType enumerates the values for job type. +type JobType string + +const ( + // JobTypeBackup ... + JobTypeBackup JobType = "backup" + // JobTypeExport ... + JobTypeExport JobType = "export" + // JobTypeFactoryResetDevice ... + JobTypeFactoryResetDevice JobType = "factoryResetDevice" + // JobTypeFirmwareUpdate ... + JobTypeFirmwareUpdate JobType = "firmwareUpdate" + // JobTypeImport ... + JobTypeImport JobType = "import" + // JobTypeReadDeviceProperties ... + JobTypeReadDeviceProperties JobType = "readDeviceProperties" + // JobTypeRebootDevice ... + JobTypeRebootDevice JobType = "rebootDevice" + // JobTypeUnknown ... + JobTypeUnknown JobType = "unknown" + // JobTypeUpdateDeviceConfiguration ... + JobTypeUpdateDeviceConfiguration JobType = "updateDeviceConfiguration" + // JobTypeWriteDeviceProperties ... + JobTypeWriteDeviceProperties JobType = "writeDeviceProperties" +) + +// PossibleJobTypeValues returns an array of possible values for the JobType const type. +func PossibleJobTypeValues() []JobType { + return []JobType{JobTypeBackup, JobTypeExport, JobTypeFactoryResetDevice, JobTypeFirmwareUpdate, JobTypeImport, JobTypeReadDeviceProperties, JobTypeRebootDevice, JobTypeUnknown, JobTypeUpdateDeviceConfiguration, JobTypeWriteDeviceProperties} +} + +// NetworkRuleIPAction enumerates the values for network rule ip action. +type NetworkRuleIPAction string + +const ( + // NetworkRuleIPActionAllow ... + NetworkRuleIPActionAllow NetworkRuleIPAction = "Allow" +) + +// PossibleNetworkRuleIPActionValues returns an array of possible values for the NetworkRuleIPAction const type. +func PossibleNetworkRuleIPActionValues() []NetworkRuleIPAction { + return []NetworkRuleIPAction{NetworkRuleIPActionAllow} +} + +// PrivateLinkServiceConnectionStatus enumerates the values for private link service connection status. +type PrivateLinkServiceConnectionStatus string + +const ( + // PrivateLinkServiceConnectionStatusApproved ... + PrivateLinkServiceConnectionStatusApproved PrivateLinkServiceConnectionStatus = "Approved" + // PrivateLinkServiceConnectionStatusDisconnected ... + PrivateLinkServiceConnectionStatusDisconnected PrivateLinkServiceConnectionStatus = "Disconnected" + // PrivateLinkServiceConnectionStatusPending ... + PrivateLinkServiceConnectionStatusPending PrivateLinkServiceConnectionStatus = "Pending" + // PrivateLinkServiceConnectionStatusRejected ... + PrivateLinkServiceConnectionStatusRejected PrivateLinkServiceConnectionStatus = "Rejected" +) + +// PossiblePrivateLinkServiceConnectionStatusValues returns an array of possible values for the PrivateLinkServiceConnectionStatus const type. +func PossiblePrivateLinkServiceConnectionStatusValues() []PrivateLinkServiceConnectionStatus { + return []PrivateLinkServiceConnectionStatus{PrivateLinkServiceConnectionStatusApproved, PrivateLinkServiceConnectionStatusDisconnected, PrivateLinkServiceConnectionStatusPending, PrivateLinkServiceConnectionStatusRejected} +} + +// PublicNetworkAccess enumerates the values for public network access. +type PublicNetworkAccess string + +const ( + // PublicNetworkAccessDisabled ... + PublicNetworkAccessDisabled PublicNetworkAccess = "Disabled" + // PublicNetworkAccessEnabled ... + PublicNetworkAccessEnabled PublicNetworkAccess = "Enabled" +) + +// PossiblePublicNetworkAccessValues returns an array of possible values for the PublicNetworkAccess const type. +func PossiblePublicNetworkAccessValues() []PublicNetworkAccess { + return []PublicNetworkAccess{PublicNetworkAccessDisabled, PublicNetworkAccessEnabled} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeNone ... + ResourceIdentityTypeNone ResourceIdentityType = "None" + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" + // ResourceIdentityTypeSystemAssignedUserAssigned ... + ResourceIdentityTypeSystemAssignedUserAssigned ResourceIdentityType = "SystemAssigned, UserAssigned" + // ResourceIdentityTypeUserAssigned ... + ResourceIdentityTypeUserAssigned ResourceIdentityType = "UserAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeNone, ResourceIdentityTypeSystemAssigned, ResourceIdentityTypeSystemAssignedUserAssigned, ResourceIdentityTypeUserAssigned} +} + +// RouteErrorSeverity enumerates the values for route error severity. +type RouteErrorSeverity string + +const ( + // RouteErrorSeverityError ... + RouteErrorSeverityError RouteErrorSeverity = "error" + // RouteErrorSeverityWarning ... + RouteErrorSeverityWarning RouteErrorSeverity = "warning" +) + +// PossibleRouteErrorSeverityValues returns an array of possible values for the RouteErrorSeverity const type. +func PossibleRouteErrorSeverityValues() []RouteErrorSeverity { + return []RouteErrorSeverity{RouteErrorSeverityError, RouteErrorSeverityWarning} +} + +// RoutingSource enumerates the values for routing source. +type RoutingSource string + +const ( + // RoutingSourceDeviceConnectionStateEvents ... + RoutingSourceDeviceConnectionStateEvents RoutingSource = "DeviceConnectionStateEvents" + // RoutingSourceDeviceJobLifecycleEvents ... + RoutingSourceDeviceJobLifecycleEvents RoutingSource = "DeviceJobLifecycleEvents" + // RoutingSourceDeviceLifecycleEvents ... + RoutingSourceDeviceLifecycleEvents RoutingSource = "DeviceLifecycleEvents" + // RoutingSourceDeviceMessages ... + RoutingSourceDeviceMessages RoutingSource = "DeviceMessages" + // RoutingSourceInvalid ... + RoutingSourceInvalid RoutingSource = "Invalid" + // RoutingSourceTwinChangeEvents ... + RoutingSourceTwinChangeEvents RoutingSource = "TwinChangeEvents" +) + +// PossibleRoutingSourceValues returns an array of possible values for the RoutingSource const type. +func PossibleRoutingSourceValues() []RoutingSource { + return []RoutingSource{RoutingSourceDeviceConnectionStateEvents, RoutingSourceDeviceJobLifecycleEvents, RoutingSourceDeviceLifecycleEvents, RoutingSourceDeviceMessages, RoutingSourceInvalid, RoutingSourceTwinChangeEvents} +} + +// TestResultStatus enumerates the values for test result status. +type TestResultStatus string + +const ( + // TestResultStatusFalse ... + TestResultStatusFalse TestResultStatus = "false" + // TestResultStatusTrue ... + TestResultStatusTrue TestResultStatus = "true" + // TestResultStatusUndefined ... + TestResultStatusUndefined TestResultStatus = "undefined" +) + +// PossibleTestResultStatusValues returns an array of possible values for the TestResultStatus const type. +func PossibleTestResultStatusValues() []TestResultStatus { + return []TestResultStatus{TestResultStatusFalse, TestResultStatusTrue, TestResultStatusUndefined} +} diff --git a/services/iothub/mgmt/2021-07-02/devices/iothub.go b/services/iothub/mgmt/2021-07-02/devices/iothub.go new file mode 100644 index 000000000000..add935d0afbc --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/iothub.go @@ -0,0 +1,121 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IotHubClient is the use this API to manage the IoT hubs in your Azure subscription. +type IotHubClient struct { + BaseClient +} + +// NewIotHubClient creates an instance of the IotHubClient client. +func NewIotHubClient(subscriptionID string) IotHubClient { + return NewIotHubClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIotHubClientWithBaseURI creates an instance of the IotHubClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewIotHubClientWithBaseURI(baseURI string, subscriptionID string) IotHubClient { + return IotHubClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ManualFailover manually initiate a failover for the IoT Hub to its secondary region. To learn more, see +// https://aka.ms/manualfailover +// Parameters: +// iotHubName - name of the IoT hub to failover +// failoverInput - region to failover to. Must be the Azure paired region. Get the value from the secondary +// location in the locations property. To learn more, see https://aka.ms/manualfailover/region +// resourceGroupName - name of the resource group containing the IoT hub resource +func (client IotHubClient) ManualFailover(ctx context.Context, iotHubName string, failoverInput FailoverInput, resourceGroupName string) (result IotHubManualFailoverFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubClient.ManualFailover") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: failoverInput, + Constraints: []validation.Constraint{{Target: "failoverInput.FailoverRegion", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.IotHubClient", "ManualFailover", err.Error()) + } + + req, err := client.ManualFailoverPreparer(ctx, iotHubName, failoverInput, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubClient", "ManualFailover", nil, "Failure preparing request") + return + } + + result, err = client.ManualFailoverSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubClient", "ManualFailover", result.Response(), "Failure sending request") + return + } + + return +} + +// ManualFailoverPreparer prepares the ManualFailover request. +func (client IotHubClient) ManualFailoverPreparer(ctx context.Context, iotHubName string, failoverInput FailoverInput, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotHubName": autorest.Encode("path", iotHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/failover", pathParameters), + autorest.WithJSON(failoverInput), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ManualFailoverSender sends the ManualFailover request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubClient) ManualFailoverSender(req *http.Request) (future IotHubManualFailoverFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ManualFailoverResponder handles the response to the ManualFailover request. The method always +// closes the http.Response Body. +func (client IotHubClient) ManualFailoverResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/iothubresource.go b/services/iothub/mgmt/2021-07-02/devices/iothubresource.go new file mode 100644 index 000000000000..c4a85aae58b3 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/iothubresource.go @@ -0,0 +1,2247 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// IotHubResourceClient is the use this API to manage the IoT hubs in your Azure subscription. +type IotHubResourceClient struct { + BaseClient +} + +// NewIotHubResourceClient creates an instance of the IotHubResourceClient client. +func NewIotHubResourceClient(subscriptionID string) IotHubResourceClient { + return NewIotHubResourceClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewIotHubResourceClientWithBaseURI creates an instance of the IotHubResourceClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewIotHubResourceClientWithBaseURI(baseURI string, subscriptionID string) IotHubResourceClient { + return IotHubResourceClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CheckNameAvailability check if an IoT hub name is available. +// Parameters: +// operationInputs - set the name parameter in the OperationInputs structure to the name of the IoT hub to +// check. +func (client IotHubResourceClient) CheckNameAvailability(ctx context.Context, operationInputs OperationInputs) (result IotHubNameAvailabilityInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.CheckNameAvailability") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: operationInputs, + Constraints: []validation.Constraint{{Target: "operationInputs.Name", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.IotHubResourceClient", "CheckNameAvailability", err.Error()) + } + + req, err := client.CheckNameAvailabilityPreparer(ctx, operationInputs) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CheckNameAvailability", nil, "Failure preparing request") + return + } + + resp, err := client.CheckNameAvailabilitySender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CheckNameAvailability", resp, "Failure sending request") + return + } + + result, err = client.CheckNameAvailabilityResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CheckNameAvailability", resp, "Failure responding to request") + return + } + + return +} + +// CheckNameAvailabilityPreparer prepares the CheckNameAvailability request. +func (client IotHubResourceClient) CheckNameAvailabilityPreparer(ctx context.Context, operationInputs OperationInputs) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/checkNameAvailability", pathParameters), + autorest.WithJSON(operationInputs), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CheckNameAvailabilitySender sends the CheckNameAvailability request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) CheckNameAvailabilitySender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CheckNameAvailabilityResponder handles the response to the CheckNameAvailability request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) CheckNameAvailabilityResponder(resp *http.Response) (result IotHubNameAvailabilityInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateEventHubConsumerGroup add a consumer group to an Event Hub-compatible endpoint in an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// eventHubEndpointName - the name of the Event Hub-compatible endpoint in the IoT hub. +// name - the name of the consumer group to add. +// consumerGroupBody - the consumer group to add. +func (client IotHubResourceClient) CreateEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string, consumerGroupBody EventHubConsumerGroupBodyDescription) (result EventHubConsumerGroupInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.CreateEventHubConsumerGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: consumerGroupBody, + Constraints: []validation.Constraint{{Target: "consumerGroupBody.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "consumerGroupBody.Properties.Name", Name: validation.Null, Rule: true, Chain: nil}}}}}}); err != nil { + return result, validation.NewError("devices.IotHubResourceClient", "CreateEventHubConsumerGroup", err.Error()) + } + + req, err := client.CreateEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name, consumerGroupBody) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CreateEventHubConsumerGroup", nil, "Failure preparing request") + return + } + + resp, err := client.CreateEventHubConsumerGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CreateEventHubConsumerGroup", resp, "Failure sending request") + return + } + + result, err = client.CreateEventHubConsumerGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CreateEventHubConsumerGroup", resp, "Failure responding to request") + return + } + + return +} + +// CreateEventHubConsumerGroupPreparer prepares the CreateEventHubConsumerGroup request. +func (client IotHubResourceClient) CreateEventHubConsumerGroupPreparer(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string, consumerGroupBody EventHubConsumerGroupBodyDescription) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventHubEndpointName": autorest.Encode("path", eventHubEndpointName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", pathParameters), + autorest.WithJSON(consumerGroupBody), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateEventHubConsumerGroupSender sends the CreateEventHubConsumerGroup request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) CreateEventHubConsumerGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateEventHubConsumerGroupResponder handles the response to the CreateEventHubConsumerGroup request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) CreateEventHubConsumerGroupResponder(resp *http.Response) (result EventHubConsumerGroupInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// CreateOrUpdate create or update the metadata of an Iot hub. The usual pattern to modify a property is to retrieve +// the IoT hub metadata and security metadata, and then combine them with the modified values in a new body to update +// the IoT hub. If certain properties are missing in the JSON, updating IoT Hub may cause these values to fallback to +// default, which may lead to unexpected behavior. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// iotHubDescription - the IoT hub metadata and security metadata. +// ifMatch - eTag of the IoT Hub. Do not specify for creating a brand new IoT Hub. Required to update an +// existing IoT Hub. +func (client IotHubResourceClient) CreateOrUpdate(ctx context.Context, resourceGroupName string, resourceName string, iotHubDescription IotHubDescription, ifMatch string) (result IotHubResourceCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: iotHubDescription, + Constraints: []validation.Constraint{{Target: "iotHubDescription.Properties", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.NetworkRuleSets", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.NetworkRuleSets.ApplyToBuiltInEventHubEndpoint", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotHubDescription.Properties.NetworkRuleSets.IPRules", Name: validation.Null, Rule: true, Chain: nil}, + }}, + {Target: "iotHubDescription.Properties.Routing", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.Routing.FallbackRoute", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.Routing.FallbackRoute.Source", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "iotHubDescription.Properties.Routing.FallbackRoute.EndpointNames", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.Routing.FallbackRoute.EndpointNames", Name: validation.MaxItems, Rule: 1, Chain: nil}, + {Target: "iotHubDescription.Properties.Routing.FallbackRoute.EndpointNames", Name: validation.MinItems, Rule: 1, Chain: nil}, + }}, + {Target: "iotHubDescription.Properties.Routing.FallbackRoute.IsEnabled", Name: validation.Null, Rule: true, Chain: nil}, + }}, + }}, + {Target: "iotHubDescription.Properties.CloudToDevice", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "iotHubDescription.Properties.CloudToDevice.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + {Target: "iotHubDescription.Properties.CloudToDevice.Feedback", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.Null, Rule: false, + Chain: []validation.Constraint{{Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMaximum, Rule: int64(100), Chain: nil}, + {Target: "iotHubDescription.Properties.CloudToDevice.Feedback.MaxDeliveryCount", Name: validation.InclusiveMinimum, Rule: int64(1), Chain: nil}, + }}, + }}, + }}, + }}, + {Target: "iotHubDescription.Sku", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.IotHubResourceClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, resourceGroupName, resourceName, iotHubDescription, ifMatch) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client IotHubResourceClient) CreateOrUpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, iotHubDescription IotHubDescription, ifMatch string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + iotHubDescription.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", pathParameters), + autorest.WithJSON(iotHubDescription), + autorest.WithQueryParameters(queryParameters)) + if len(ifMatch) > 0 { + preparer = autorest.DecoratePreparer(preparer, + autorest.WithHeader("If-Match", autorest.String(ifMatch))) + } + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) CreateOrUpdateSender(req *http.Request) (future IotHubResourceCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) CreateOrUpdateResponder(resp *http.Response) (result IotHubDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete delete an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) Delete(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubResourceDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client IotHubResourceClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) DeleteSender(req *http.Request) (future IotHubResourceDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) DeleteResponder(resp *http.Response) (result SetObject, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent, http.StatusNotFound), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// DeleteEventHubConsumerGroup delete a consumer group from an Event Hub-compatible endpoint in an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// eventHubEndpointName - the name of the Event Hub-compatible endpoint in the IoT hub. +// name - the name of the consumer group to delete. +func (client IotHubResourceClient) DeleteEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result autorest.Response, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.DeleteEventHubConsumerGroup") + defer func() { + sc := -1 + if result.Response != nil { + sc = result.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeleteEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "DeleteEventHubConsumerGroup", nil, "Failure preparing request") + return + } + + resp, err := client.DeleteEventHubConsumerGroupSender(req) + if err != nil { + result.Response = resp + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "DeleteEventHubConsumerGroup", resp, "Failure sending request") + return + } + + result, err = client.DeleteEventHubConsumerGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "DeleteEventHubConsumerGroup", resp, "Failure responding to request") + return + } + + return +} + +// DeleteEventHubConsumerGroupPreparer prepares the DeleteEventHubConsumerGroup request. +func (client IotHubResourceClient) DeleteEventHubConsumerGroupPreparer(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventHubEndpointName": autorest.Encode("path", eventHubEndpointName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteEventHubConsumerGroupSender sends the DeleteEventHubConsumerGroup request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) DeleteEventHubConsumerGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// DeleteEventHubConsumerGroupResponder handles the response to the DeleteEventHubConsumerGroup request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) DeleteEventHubConsumerGroupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByClosing()) + result.Response = resp + return +} + +// ExportDevices exports all the device identities in the IoT hub identity registry to an Azure Storage blob container. +// For more information, see: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// exportDevicesParameters - the parameters that specify the export devices operation. +func (client IotHubResourceClient) ExportDevices(ctx context.Context, resourceGroupName string, resourceName string, exportDevicesParameters ExportDevicesRequest) (result JobResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ExportDevices") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: exportDevicesParameters, + Constraints: []validation.Constraint{{Target: "exportDevicesParameters.ExportBlobContainerURI", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "exportDevicesParameters.ExcludeKeys", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.IotHubResourceClient", "ExportDevices", err.Error()) + } + + req, err := client.ExportDevicesPreparer(ctx, resourceGroupName, resourceName, exportDevicesParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ExportDevices", nil, "Failure preparing request") + return + } + + resp, err := client.ExportDevicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ExportDevices", resp, "Failure sending request") + return + } + + result, err = client.ExportDevicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ExportDevices", resp, "Failure responding to request") + return + } + + return +} + +// ExportDevicesPreparer prepares the ExportDevices request. +func (client IotHubResourceClient) ExportDevicesPreparer(ctx context.Context, resourceGroupName string, resourceName string, exportDevicesParameters ExportDevicesRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/exportDevices", pathParameters), + autorest.WithJSON(exportDevicesParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ExportDevicesSender sends the ExportDevices request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ExportDevicesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ExportDevicesResponder handles the response to the ExportDevices request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ExportDevicesResponder(resp *http.Response) (result JobResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get the non-security related metadata of an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) Get(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubDescription, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client IotHubResourceClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetResponder(resp *http.Response) (result IotHubDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetEndpointHealth get the health for routing endpoints. +func (client IotHubResourceClient) GetEndpointHealth(ctx context.Context, resourceGroupName string, iotHubName string) (result EndpointHealthDataListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetEndpointHealth") + defer func() { + sc := -1 + if result.ehdlr.Response.Response != nil { + sc = result.ehdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getEndpointHealthNextResults + req, err := client.GetEndpointHealthPreparer(ctx, resourceGroupName, iotHubName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetEndpointHealth", nil, "Failure preparing request") + return + } + + resp, err := client.GetEndpointHealthSender(req) + if err != nil { + result.ehdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetEndpointHealth", resp, "Failure sending request") + return + } + + result.ehdlr, err = client.GetEndpointHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetEndpointHealth", resp, "Failure responding to request") + return + } + if result.ehdlr.hasNextLink() && result.ehdlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetEndpointHealthPreparer prepares the GetEndpointHealth request. +func (client IotHubResourceClient) GetEndpointHealthPreparer(ctx context.Context, resourceGroupName string, iotHubName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotHubName": autorest.Encode("path", iotHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routingEndpointsHealth", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEndpointHealthSender sends the GetEndpointHealth request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetEndpointHealthSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEndpointHealthResponder handles the response to the GetEndpointHealth request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetEndpointHealthResponder(resp *http.Response) (result EndpointHealthDataListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getEndpointHealthNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) getEndpointHealthNextResults(ctx context.Context, lastResults EndpointHealthDataListResult) (result EndpointHealthDataListResult, err error) { + req, err := lastResults.endpointHealthDataListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getEndpointHealthNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetEndpointHealthSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getEndpointHealthNextResults", resp, "Failure sending next results request") + } + result, err = client.GetEndpointHealthResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getEndpointHealthNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetEndpointHealthComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) GetEndpointHealthComplete(ctx context.Context, resourceGroupName string, iotHubName string) (result EndpointHealthDataListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetEndpointHealth") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetEndpointHealth(ctx, resourceGroupName, iotHubName) + return +} + +// GetEventHubConsumerGroup get a consumer group from the Event Hub-compatible device-to-cloud endpoint for an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// eventHubEndpointName - the name of the Event Hub-compatible endpoint in the IoT hub. +// name - the name of the consumer group to retrieve. +func (client IotHubResourceClient) GetEventHubConsumerGroup(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (result EventHubConsumerGroupInfo, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetEventHubConsumerGroup") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetEventHubConsumerGroupPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName, name) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetEventHubConsumerGroup", nil, "Failure preparing request") + return + } + + resp, err := client.GetEventHubConsumerGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetEventHubConsumerGroup", resp, "Failure sending request") + return + } + + result, err = client.GetEventHubConsumerGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetEventHubConsumerGroup", resp, "Failure responding to request") + return + } + + return +} + +// GetEventHubConsumerGroupPreparer prepares the GetEventHubConsumerGroup request. +func (client IotHubResourceClient) GetEventHubConsumerGroupPreparer(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string, name string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventHubEndpointName": autorest.Encode("path", eventHubEndpointName), + "name": autorest.Encode("path", name), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups/{name}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetEventHubConsumerGroupSender sends the GetEventHubConsumerGroup request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetEventHubConsumerGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetEventHubConsumerGroupResponder handles the response to the GetEventHubConsumerGroup request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetEventHubConsumerGroupResponder(resp *http.Response) (result EventHubConsumerGroupInfo, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetJob get the details of a job from an IoT hub. For more information, see: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// jobID - the job identifier. +func (client IotHubResourceClient) GetJob(ctx context.Context, resourceGroupName string, resourceName string, jobID string) (result JobResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetJob") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetJobPreparer(ctx, resourceGroupName, resourceName, jobID) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetJob", nil, "Failure preparing request") + return + } + + resp, err := client.GetJobSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetJob", resp, "Failure sending request") + return + } + + result, err = client.GetJobResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetJob", resp, "Failure responding to request") + return + } + + return +} + +// GetJobPreparer prepares the GetJob request. +func (client IotHubResourceClient) GetJobPreparer(ctx context.Context, resourceGroupName string, resourceName string, jobID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "jobId": autorest.Encode("path", jobID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs/{jobId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetJobSender sends the GetJob request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetJobSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetJobResponder handles the response to the GetJob request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetJobResponder(resp *http.Response) (result JobResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetKeysForKeyName get a shared access policy by name from an IoT hub. For more information, see: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// keyName - the name of the shared access policy. +func (client IotHubResourceClient) GetKeysForKeyName(ctx context.Context, resourceGroupName string, resourceName string, keyName string) (result SharedAccessSignatureAuthorizationRule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetKeysForKeyName") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetKeysForKeyNamePreparer(ctx, resourceGroupName, resourceName, keyName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetKeysForKeyName", nil, "Failure preparing request") + return + } + + resp, err := client.GetKeysForKeyNameSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetKeysForKeyName", resp, "Failure sending request") + return + } + + result, err = client.GetKeysForKeyNameResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetKeysForKeyName", resp, "Failure responding to request") + return + } + + return +} + +// GetKeysForKeyNamePreparer prepares the GetKeysForKeyName request. +func (client IotHubResourceClient) GetKeysForKeyNamePreparer(ctx context.Context, resourceGroupName string, resourceName string, keyName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "keyName": autorest.Encode("path", keyName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubKeys/{keyName}/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetKeysForKeyNameSender sends the GetKeysForKeyName request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetKeysForKeyNameSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetKeysForKeyNameResponder handles the response to the GetKeysForKeyName request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetKeysForKeyNameResponder(resp *http.Response) (result SharedAccessSignatureAuthorizationRule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetQuotaMetrics get the quota metrics for an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) GetQuotaMetrics(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubQuotaMetricInfoListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetQuotaMetrics") + defer func() { + sc := -1 + if result.ihqmilr.Response.Response != nil { + sc = result.ihqmilr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getQuotaMetricsNextResults + req, err := client.GetQuotaMetricsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetQuotaMetrics", nil, "Failure preparing request") + return + } + + resp, err := client.GetQuotaMetricsSender(req) + if err != nil { + result.ihqmilr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetQuotaMetrics", resp, "Failure sending request") + return + } + + result.ihqmilr, err = client.GetQuotaMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetQuotaMetrics", resp, "Failure responding to request") + return + } + if result.ihqmilr.hasNextLink() && result.ihqmilr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetQuotaMetricsPreparer prepares the GetQuotaMetrics request. +func (client IotHubResourceClient) GetQuotaMetricsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/quotaMetrics", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetQuotaMetricsSender sends the GetQuotaMetrics request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetQuotaMetricsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetQuotaMetricsResponder handles the response to the GetQuotaMetrics request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetQuotaMetricsResponder(resp *http.Response) (result IotHubQuotaMetricInfoListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getQuotaMetricsNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) getQuotaMetricsNextResults(ctx context.Context, lastResults IotHubQuotaMetricInfoListResult) (result IotHubQuotaMetricInfoListResult, err error) { + req, err := lastResults.iotHubQuotaMetricInfoListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getQuotaMetricsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetQuotaMetricsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getQuotaMetricsNextResults", resp, "Failure sending next results request") + } + result, err = client.GetQuotaMetricsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getQuotaMetricsNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetQuotaMetricsComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) GetQuotaMetricsComplete(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubQuotaMetricInfoListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetQuotaMetrics") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetQuotaMetrics(ctx, resourceGroupName, resourceName) + return +} + +// GetStats get the statistics from an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) GetStats(ctx context.Context, resourceGroupName string, resourceName string) (result RegistryStatistics, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetStats") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetStatsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetStats", nil, "Failure preparing request") + return + } + + resp, err := client.GetStatsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetStats", resp, "Failure sending request") + return + } + + result, err = client.GetStatsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetStats", resp, "Failure responding to request") + return + } + + return +} + +// GetStatsPreparer prepares the GetStats request. +func (client IotHubResourceClient) GetStatsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/IotHubStats", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetStatsSender sends the GetStats request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetStatsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetStatsResponder handles the response to the GetStats request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetStatsResponder(resp *http.Response) (result RegistryStatistics, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// GetValidSkus get the list of valid SKUs for an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) GetValidSkus(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubSkuDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetValidSkus") + defer func() { + sc := -1 + if result.ihsdlr.Response.Response != nil { + sc = result.ihsdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.getValidSkusNextResults + req, err := client.GetValidSkusPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetValidSkus", nil, "Failure preparing request") + return + } + + resp, err := client.GetValidSkusSender(req) + if err != nil { + result.ihsdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetValidSkus", resp, "Failure sending request") + return + } + + result.ihsdlr, err = client.GetValidSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "GetValidSkus", resp, "Failure responding to request") + return + } + if result.ihsdlr.hasNextLink() && result.ihsdlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// GetValidSkusPreparer prepares the GetValidSkus request. +func (client IotHubResourceClient) GetValidSkusPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetValidSkusSender sends the GetValidSkus request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) GetValidSkusSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetValidSkusResponder handles the response to the GetValidSkus request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) GetValidSkusResponder(resp *http.Response) (result IotHubSkuDescriptionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// getValidSkusNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) getValidSkusNextResults(ctx context.Context, lastResults IotHubSkuDescriptionListResult) (result IotHubSkuDescriptionListResult, err error) { + req, err := lastResults.iotHubSkuDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getValidSkusNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.GetValidSkusSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getValidSkusNextResults", resp, "Failure sending next results request") + } + result, err = client.GetValidSkusResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "getValidSkusNextResults", resp, "Failure responding to next results request") + } + return +} + +// GetValidSkusComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) GetValidSkusComplete(ctx context.Context, resourceGroupName string, resourceName string) (result IotHubSkuDescriptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.GetValidSkus") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.GetValidSkus(ctx, resourceGroupName, resourceName) + return +} + +// ImportDevices import, update, or delete device identities in the IoT hub identity registry from a blob. For more +// information, see: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry#import-and-export-device-identities. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// importDevicesParameters - the parameters that specify the import devices operation. +func (client IotHubResourceClient) ImportDevices(ctx context.Context, resourceGroupName string, resourceName string, importDevicesParameters ImportDevicesRequest) (result JobResponse, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ImportDevices") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: importDevicesParameters, + Constraints: []validation.Constraint{{Target: "importDevicesParameters.InputBlobContainerURI", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "importDevicesParameters.OutputBlobContainerURI", Name: validation.Null, Rule: true, Chain: nil}}}}); err != nil { + return result, validation.NewError("devices.IotHubResourceClient", "ImportDevices", err.Error()) + } + + req, err := client.ImportDevicesPreparer(ctx, resourceGroupName, resourceName, importDevicesParameters) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ImportDevices", nil, "Failure preparing request") + return + } + + resp, err := client.ImportDevicesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ImportDevices", resp, "Failure sending request") + return + } + + result, err = client.ImportDevicesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ImportDevices", resp, "Failure responding to request") + return + } + + return +} + +// ImportDevicesPreparer prepares the ImportDevices request. +func (client IotHubResourceClient) ImportDevicesPreparer(ctx context.Context, resourceGroupName string, resourceName string, importDevicesParameters ImportDevicesRequest) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/importDevices", pathParameters), + autorest.WithJSON(importDevicesParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ImportDevicesSender sends the ImportDevices request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ImportDevicesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ImportDevicesResponder handles the response to the ImportDevices request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ImportDevicesResponder(resp *http.Response) (result JobResponse, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup get all the IoT hubs in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +func (client IotHubResourceClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result IotHubDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.ihdlr.Response.Response != nil { + sc = result.ihdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.ihdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.ihdlr, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.ihdlr.hasNextLink() && result.ihdlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client IotHubResourceClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ListByResourceGroupResponder(resp *http.Response) (result IotHubDescriptionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) listByResourceGroupNextResults(ctx context.Context, lastResults IotHubDescriptionListResult) (result IotHubDescriptionListResult, err error) { + req, err := lastResults.iotHubDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result IotHubDescriptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription get all the IoT hubs in a subscription. +func (client IotHubResourceClient) ListBySubscription(ctx context.Context) (result IotHubDescriptionListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListBySubscription") + defer func() { + sc := -1 + if result.ihdlr.Response.Response != nil { + sc = result.ihdlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.ihdlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.ihdlr, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.ihdlr.hasNextLink() && result.ihdlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client IotHubResourceClient) ListBySubscriptionPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/IotHubs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ListBySubscriptionResponder(resp *http.Response) (result IotHubDescriptionListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) listBySubscriptionNextResults(ctx context.Context, lastResults IotHubDescriptionListResult) (result IotHubDescriptionListResult, err error) { + req, err := lastResults.iotHubDescriptionListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) ListBySubscriptionComplete(ctx context.Context) (result IotHubDescriptionListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx) + return +} + +// ListEventHubConsumerGroups get a list of the consumer groups in the Event Hub-compatible device-to-cloud endpoint in +// an IoT hub. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// eventHubEndpointName - the name of the Event Hub-compatible endpoint. +func (client IotHubResourceClient) ListEventHubConsumerGroups(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string) (result EventHubConsumerGroupsListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListEventHubConsumerGroups") + defer func() { + sc := -1 + if result.ehcglr.Response.Response != nil { + sc = result.ehcglr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listEventHubConsumerGroupsNextResults + req, err := client.ListEventHubConsumerGroupsPreparer(ctx, resourceGroupName, resourceName, eventHubEndpointName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListEventHubConsumerGroups", nil, "Failure preparing request") + return + } + + resp, err := client.ListEventHubConsumerGroupsSender(req) + if err != nil { + result.ehcglr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListEventHubConsumerGroups", resp, "Failure sending request") + return + } + + result.ehcglr, err = client.ListEventHubConsumerGroupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListEventHubConsumerGroups", resp, "Failure responding to request") + return + } + if result.ehcglr.hasNextLink() && result.ehcglr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListEventHubConsumerGroupsPreparer prepares the ListEventHubConsumerGroups request. +func (client IotHubResourceClient) ListEventHubConsumerGroupsPreparer(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "eventHubEndpointName": autorest.Encode("path", eventHubEndpointName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/eventHubEndpoints/{eventHubEndpointName}/ConsumerGroups", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListEventHubConsumerGroupsSender sends the ListEventHubConsumerGroups request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ListEventHubConsumerGroupsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListEventHubConsumerGroupsResponder handles the response to the ListEventHubConsumerGroups request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ListEventHubConsumerGroupsResponder(resp *http.Response) (result EventHubConsumerGroupsListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listEventHubConsumerGroupsNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) listEventHubConsumerGroupsNextResults(ctx context.Context, lastResults EventHubConsumerGroupsListResult) (result EventHubConsumerGroupsListResult, err error) { + req, err := lastResults.eventHubConsumerGroupsListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listEventHubConsumerGroupsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListEventHubConsumerGroupsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listEventHubConsumerGroupsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListEventHubConsumerGroupsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listEventHubConsumerGroupsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListEventHubConsumerGroupsComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) ListEventHubConsumerGroupsComplete(ctx context.Context, resourceGroupName string, resourceName string, eventHubEndpointName string) (result EventHubConsumerGroupsListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListEventHubConsumerGroups") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListEventHubConsumerGroups(ctx, resourceGroupName, resourceName, eventHubEndpointName) + return +} + +// ListJobs get a list of all the jobs in an IoT hub. For more information, see: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-identity-registry. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) ListJobs(ctx context.Context, resourceGroupName string, resourceName string) (result JobResponseListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListJobs") + defer func() { + sc := -1 + if result.jrlr.Response.Response != nil { + sc = result.jrlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listJobsNextResults + req, err := client.ListJobsPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListJobs", nil, "Failure preparing request") + return + } + + resp, err := client.ListJobsSender(req) + if err != nil { + result.jrlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListJobs", resp, "Failure sending request") + return + } + + result.jrlr, err = client.ListJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListJobs", resp, "Failure responding to request") + return + } + if result.jrlr.hasNextLink() && result.jrlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListJobsPreparer prepares the ListJobs request. +func (client IotHubResourceClient) ListJobsPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/jobs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListJobsSender sends the ListJobs request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ListJobsSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListJobsResponder handles the response to the ListJobs request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ListJobsResponder(resp *http.Response) (result JobResponseListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listJobsNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) listJobsNextResults(ctx context.Context, lastResults JobResponseListResult) (result JobResponseListResult, err error) { + req, err := lastResults.jobResponseListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listJobsNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListJobsSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listJobsNextResults", resp, "Failure sending next results request") + } + result, err = client.ListJobsResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listJobsNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListJobsComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) ListJobsComplete(ctx context.Context, resourceGroupName string, resourceName string) (result JobResponseListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListJobs") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListJobs(ctx, resourceGroupName, resourceName) + return +} + +// ListKeys get the security metadata for an IoT hub. For more information, see: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-security. +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client IotHubResourceClient) ListKeys(ctx context.Context, resourceGroupName string, resourceName string) (result SharedAccessSignatureAuthorizationRuleListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListKeys") + defer func() { + sc := -1 + if result.sasarlr.Response.Response != nil { + sc = result.sasarlr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listKeysNextResults + req, err := client.ListKeysPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListKeys", nil, "Failure preparing request") + return + } + + resp, err := client.ListKeysSender(req) + if err != nil { + result.sasarlr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListKeys", resp, "Failure sending request") + return + } + + result.sasarlr, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "ListKeys", resp, "Failure responding to request") + return + } + if result.sasarlr.hasNextLink() && result.sasarlr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListKeysPreparer prepares the ListKeys request. +func (client IotHubResourceClient) ListKeysPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}/listkeys", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListKeysSender sends the ListKeys request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) ListKeysSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListKeysResponder handles the response to the ListKeys request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) ListKeysResponder(resp *http.Response) (result SharedAccessSignatureAuthorizationRuleListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listKeysNextResults retrieves the next set of results, if any. +func (client IotHubResourceClient) listKeysNextResults(ctx context.Context, lastResults SharedAccessSignatureAuthorizationRuleListResult) (result SharedAccessSignatureAuthorizationRuleListResult, err error) { + req, err := lastResults.sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listKeysNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListKeysSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listKeysNextResults", resp, "Failure sending next results request") + } + result, err = client.ListKeysResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "listKeysNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListKeysComplete enumerates all values, automatically crossing page boundaries as required. +func (client IotHubResourceClient) ListKeysComplete(ctx context.Context, resourceGroupName string, resourceName string) (result SharedAccessSignatureAuthorizationRuleListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.ListKeys") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListKeys(ctx, resourceGroupName, resourceName) + return +} + +// TestAllRoutes test all routes configured in this Iot Hub +// Parameters: +// input - input for testing all routes +// iotHubName - iotHub to be tested +// resourceGroupName - resource group which Iot Hub belongs to +func (client IotHubResourceClient) TestAllRoutes(ctx context.Context, input TestAllRoutesInput, iotHubName string, resourceGroupName string) (result TestAllRoutesResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.TestAllRoutes") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.TestAllRoutesPreparer(ctx, input, iotHubName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "TestAllRoutes", nil, "Failure preparing request") + return + } + + resp, err := client.TestAllRoutesSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "TestAllRoutes", resp, "Failure sending request") + return + } + + result, err = client.TestAllRoutesResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "TestAllRoutes", resp, "Failure responding to request") + return + } + + return +} + +// TestAllRoutesPreparer prepares the TestAllRoutes request. +func (client IotHubResourceClient) TestAllRoutesPreparer(ctx context.Context, input TestAllRoutesInput, iotHubName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotHubName": autorest.Encode("path", iotHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testall", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestAllRoutesSender sends the TestAllRoutes request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) TestAllRoutesSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// TestAllRoutesResponder handles the response to the TestAllRoutes request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) TestAllRoutesResponder(resp *http.Response) (result TestAllRoutesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// TestRoute test the new route for this Iot Hub +// Parameters: +// input - route that needs to be tested +// iotHubName - iotHub to be tested +// resourceGroupName - resource group which Iot Hub belongs to +func (client IotHubResourceClient) TestRoute(ctx context.Context, input TestRouteInput, iotHubName string, resourceGroupName string) (result TestRouteResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.TestRoute") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: input, + Constraints: []validation.Constraint{{Target: "input.Route", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Route.Name", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Route.Name", Name: validation.Pattern, Rule: `^[A-Za-z0-9-._]{1,64}$`, Chain: nil}}}, + {Target: "input.Route.EndpointNames", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "input.Route.EndpointNames", Name: validation.MaxItems, Rule: 1, Chain: nil}, + {Target: "input.Route.EndpointNames", Name: validation.MinItems, Rule: 1, Chain: nil}, + }}, + {Target: "input.Route.IsEnabled", Name: validation.Null, Rule: true, Chain: nil}, + }}}}}); err != nil { + return result, validation.NewError("devices.IotHubResourceClient", "TestRoute", err.Error()) + } + + req, err := client.TestRoutePreparer(ctx, input, iotHubName, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "TestRoute", nil, "Failure preparing request") + return + } + + resp, err := client.TestRouteSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "TestRoute", resp, "Failure sending request") + return + } + + result, err = client.TestRouteResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "TestRoute", resp, "Failure responding to request") + return + } + + return +} + +// TestRoutePreparer prepares the TestRoute request. +func (client IotHubResourceClient) TestRoutePreparer(ctx context.Context, input TestRouteInput, iotHubName string, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "iotHubName": autorest.Encode("path", iotHubName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{iotHubName}/routing/routes/$testnew", pathParameters), + autorest.WithJSON(input), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// TestRouteSender sends the TestRoute request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) TestRouteSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// TestRouteResponder handles the response to the TestRoute request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) TestRouteResponder(resp *http.Response) (result TestRouteResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update an existing IoT Hub tags. to update other fields use the CreateOrUpdate method +// Parameters: +// resourceGroupName - resource group identifier. +// resourceName - name of iot hub to update. +// iotHubTags - updated tag information to set into the iot hub instance. +func (client IotHubResourceClient) Update(ctx context.Context, resourceGroupName string, resourceName string, iotHubTags TagsResource) (result IotHubResourceUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubResourceClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, iotHubTags) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client IotHubResourceClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, iotHubTags TagsResource) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/IotHubs/{resourceName}", pathParameters), + autorest.WithJSON(iotHubTags), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client IotHubResourceClient) UpdateSender(req *http.Request) (future IotHubResourceUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client IotHubResourceClient) UpdateResponder(resp *http.Response) (result IotHubDescription, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/models.go b/services/iothub/mgmt/2021-07-02/devices/models.go new file mode 100644 index 000000000000..46582690346a --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/models.go @@ -0,0 +1,2844 @@ +package devices + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices" + +// ArmIdentity ... +type ArmIdentity struct { + // PrincipalID - READ-ONLY; Principal Id + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; Tenant Id + TenantID *string `json:"tenantId,omitempty"` + // Type - The type of identity used for the resource. The type 'SystemAssigned, UserAssigned' includes both an implicitly created identity and a set of user assigned identities. The type 'None' will remove any identities from the service. Possible values include: 'ResourceIdentityTypeSystemAssigned', 'ResourceIdentityTypeUserAssigned', 'ResourceIdentityTypeSystemAssignedUserAssigned', 'ResourceIdentityTypeNone' + Type ResourceIdentityType `json:"type,omitempty"` + UserAssignedIdentities map[string]*ArmUserIdentity `json:"userAssignedIdentities"` +} + +// MarshalJSON is the custom marshaler for ArmIdentity. +func (ai ArmIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ai.Type != "" { + objectMap["type"] = ai.Type + } + if ai.UserAssignedIdentities != nil { + objectMap["userAssignedIdentities"] = ai.UserAssignedIdentities + } + return json.Marshal(objectMap) +} + +// ArmUserIdentity ... +type ArmUserIdentity struct { + // PrincipalID - READ-ONLY + PrincipalID *string `json:"principalId,omitempty"` + // ClientID - READ-ONLY + ClientID *string `json:"clientId,omitempty"` +} + +// MarshalJSON is the custom marshaler for ArmUserIdentity. +func (aui ArmUserIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CertificateBodyDescription the JSON-serialized X509 Certificate. +type CertificateBodyDescription struct { + // Certificate - base-64 representation of the X509 leaf certificate .cer file or just .pem file content. + Certificate *string `json:"certificate,omitempty"` + // IsVerified - True indicates that the certificate will be created in verified state and proof of possession will not be required. + IsVerified *bool `json:"isVerified,omitempty"` +} + +// CertificateDescription the X509 Certificate. +type CertificateDescription struct { + autorest.Response `json:"-"` + Properties *CertificateProperties `json:"properties,omitempty"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the certificate. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; The entity tag. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateDescription. +func (cd CertificateDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cd.Properties != nil { + objectMap["properties"] = cd.Properties + } + return json.Marshal(objectMap) +} + +// CertificateListDescription the JSON-serialized array of Certificate objects. +type CertificateListDescription struct { + autorest.Response `json:"-"` + // Value - The array of Certificate objects. + Value *[]CertificateDescription `json:"value,omitempty"` +} + +// CertificateProperties the description of an X509 CA Certificate. +type CertificateProperties struct { + // Subject - READ-ONLY; The certificate's subject name. + Subject *string `json:"subject,omitempty"` + // Expiry - READ-ONLY; The certificate's expiration date and time. + Expiry *date.TimeRFC1123 `json:"expiry,omitempty"` + // Thumbprint - READ-ONLY; The certificate's thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + // IsVerified - Determines whether certificate has been verified. + IsVerified *bool `json:"isVerified,omitempty"` + // Created - READ-ONLY; The certificate's create date and time. + Created *date.TimeRFC1123 `json:"created,omitempty"` + // Updated - READ-ONLY; The certificate's last update date and time. + Updated *date.TimeRFC1123 `json:"updated,omitempty"` + // Certificate - The certificate content + Certificate *string `json:"certificate,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateProperties. +func (cp CertificateProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cp.IsVerified != nil { + objectMap["isVerified"] = cp.IsVerified + } + if cp.Certificate != nil { + objectMap["certificate"] = cp.Certificate + } + return json.Marshal(objectMap) +} + +// CertificatePropertiesWithNonce the description of an X509 CA Certificate including the challenge nonce +// issued for the Proof-Of-Possession flow. +type CertificatePropertiesWithNonce struct { + // Subject - READ-ONLY; The certificate's subject name. + Subject *string `json:"subject,omitempty"` + // Expiry - READ-ONLY; The certificate's expiration date and time. + Expiry *date.TimeRFC1123 `json:"expiry,omitempty"` + // Thumbprint - READ-ONLY; The certificate's thumbprint. + Thumbprint *string `json:"thumbprint,omitempty"` + // IsVerified - READ-ONLY; Determines whether certificate has been verified. + IsVerified *bool `json:"isVerified,omitempty"` + // Created - READ-ONLY; The certificate's create date and time. + Created *date.TimeRFC1123 `json:"created,omitempty"` + // Updated - READ-ONLY; The certificate's last update date and time. + Updated *date.TimeRFC1123 `json:"updated,omitempty"` + // VerificationCode - READ-ONLY; The certificate's verification code that will be used for proof of possession. + VerificationCode *string `json:"verificationCode,omitempty"` + // Certificate - READ-ONLY; The certificate content + Certificate *string `json:"certificate,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificatePropertiesWithNonce. +func (cpwn CertificatePropertiesWithNonce) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// CertificateVerificationDescription the JSON-serialized leaf certificate +type CertificateVerificationDescription struct { + // Certificate - base-64 representation of X509 certificate .cer file or just .pem file content. + Certificate *string `json:"certificate,omitempty"` +} + +// CertificateWithNonceDescription the X509 Certificate. +type CertificateWithNonceDescription struct { + autorest.Response `json:"-"` + Properties *CertificatePropertiesWithNonce `json:"properties,omitempty"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the certificate. + Name *string `json:"name,omitempty"` + // Etag - READ-ONLY; The entity tag. + Etag *string `json:"etag,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for CertificateWithNonceDescription. +func (cwnd CertificateWithNonceDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if cwnd.Properties != nil { + objectMap["properties"] = cwnd.Properties + } + return json.Marshal(objectMap) +} + +// CloudToDeviceProperties the IoT hub cloud-to-device messaging properties. +type CloudToDeviceProperties struct { + // MaxDeliveryCount - The max delivery count for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"` + // DefaultTTLAsIso8601 - The default time to live for cloud-to-device messages in the device queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + DefaultTTLAsIso8601 *string `json:"defaultTtlAsIso8601,omitempty"` + Feedback *FeedbackProperties `json:"feedback,omitempty"` +} + +// EndpointHealthData the health data for an endpoint +type EndpointHealthData struct { + // EndpointID - Id of the endpoint + EndpointID *string `json:"endpointId,omitempty"` + // HealthStatus - Health statuses have following meanings. The 'healthy' status shows that the endpoint is accepting messages as expected. The 'unhealthy' status shows that the endpoint is not accepting messages as expected and IoT Hub is retrying to send data to this endpoint. The status of an unhealthy endpoint will be updated to healthy when IoT Hub has established an eventually consistent state of health. The 'dead' status shows that the endpoint is not accepting messages, after IoT Hub retried sending messages for the retrial period. See IoT Hub metrics to identify errors and monitor issues with endpoints. The 'unknown' status shows that the IoT Hub has not established a connection with the endpoint. No messages have been delivered to or rejected from this endpoint. Possible values include: 'EndpointHealthStatusUnknown', 'EndpointHealthStatusHealthy', 'EndpointHealthStatusDegraded', 'EndpointHealthStatusUnhealthy', 'EndpointHealthStatusDead' + HealthStatus EndpointHealthStatus `json:"healthStatus,omitempty"` + // LastKnownError - Last error obtained when a message failed to be delivered to iot hub + LastKnownError *string `json:"lastKnownError,omitempty"` + // LastKnownErrorTime - Time at which the last known error occurred + LastKnownErrorTime *date.TimeRFC1123 `json:"lastKnownErrorTime,omitempty"` + // LastSuccessfulSendAttemptTime - Last time iot hub successfully sent a message to the endpoint + LastSuccessfulSendAttemptTime *date.TimeRFC1123 `json:"lastSuccessfulSendAttemptTime,omitempty"` + // LastSendAttemptTime - Last time iot hub tried to send a message to the endpoint + LastSendAttemptTime *date.TimeRFC1123 `json:"lastSendAttemptTime,omitempty"` +} + +// EndpointHealthDataListResult the JSON-serialized array of EndpointHealthData objects with a next link. +type EndpointHealthDataListResult struct { + autorest.Response `json:"-"` + // Value - JSON-serialized array of Endpoint health data + Value *[]EndpointHealthData `json:"value,omitempty"` + // NextLink - READ-ONLY; Link to more results + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for EndpointHealthDataListResult. +func (ehdlr EndpointHealthDataListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehdlr.Value != nil { + objectMap["value"] = ehdlr.Value + } + return json.Marshal(objectMap) +} + +// EndpointHealthDataListResultIterator provides access to a complete listing of EndpointHealthData values. +type EndpointHealthDataListResultIterator struct { + i int + page EndpointHealthDataListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EndpointHealthDataListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointHealthDataListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EndpointHealthDataListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EndpointHealthDataListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EndpointHealthDataListResultIterator) Response() EndpointHealthDataListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EndpointHealthDataListResultIterator) Value() EndpointHealthData { + if !iter.page.NotDone() { + return EndpointHealthData{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EndpointHealthDataListResultIterator type. +func NewEndpointHealthDataListResultIterator(page EndpointHealthDataListResultPage) EndpointHealthDataListResultIterator { + return EndpointHealthDataListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ehdlr EndpointHealthDataListResult) IsEmpty() bool { + return ehdlr.Value == nil || len(*ehdlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ehdlr EndpointHealthDataListResult) hasNextLink() bool { + return ehdlr.NextLink != nil && len(*ehdlr.NextLink) != 0 +} + +// endpointHealthDataListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ehdlr EndpointHealthDataListResult) endpointHealthDataListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ehdlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ehdlr.NextLink))) +} + +// EndpointHealthDataListResultPage contains a page of EndpointHealthData values. +type EndpointHealthDataListResultPage struct { + fn func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error) + ehdlr EndpointHealthDataListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EndpointHealthDataListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EndpointHealthDataListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ehdlr) + if err != nil { + return err + } + page.ehdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EndpointHealthDataListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EndpointHealthDataListResultPage) NotDone() bool { + return !page.ehdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EndpointHealthDataListResultPage) Response() EndpointHealthDataListResult { + return page.ehdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EndpointHealthDataListResultPage) Values() []EndpointHealthData { + if page.ehdlr.IsEmpty() { + return nil + } + return *page.ehdlr.Value +} + +// Creates a new instance of the EndpointHealthDataListResultPage type. +func NewEndpointHealthDataListResultPage(cur EndpointHealthDataListResult, getNextPage func(context.Context, EndpointHealthDataListResult) (EndpointHealthDataListResult, error)) EndpointHealthDataListResultPage { + return EndpointHealthDataListResultPage{ + fn: getNextPage, + ehdlr: cur, + } +} + +// EnrichmentProperties the properties of an enrichment that your IoT hub applies to messages delivered to +// endpoints. +type EnrichmentProperties struct { + // Key - The key or name for the enrichment property. + Key *string `json:"key,omitempty"` + // Value - The value for the enrichment property. + Value *string `json:"value,omitempty"` + // EndpointNames - The list of endpoints for which the enrichment is applied to the message. + EndpointNames *[]string `json:"endpointNames,omitempty"` +} + +// ErrorDetails error details. +type ErrorDetails struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // HTTPStatusCode - READ-ONLY; The HTTP status code. + HTTPStatusCode *string `json:"httpStatusCode,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Details - READ-ONLY; The error details. + Details *string `json:"details,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetails. +func (ed ErrorDetails) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// EventHubConsumerGroupBodyDescription the EventHub consumer group. +type EventHubConsumerGroupBodyDescription struct { + Properties *EventHubConsumerGroupName `json:"properties,omitempty"` +} + +// EventHubConsumerGroupInfo the properties of the EventHubConsumerGroupInfo object. +type EventHubConsumerGroupInfo struct { + autorest.Response `json:"-"` + // Properties - The tags. + Properties map[string]interface{} `json:"properties"` + // ID - READ-ONLY; The Event Hub-compatible consumer group identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The Event Hub-compatible consumer group name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; the resource type. + Type *string `json:"type,omitempty"` + // Etag - READ-ONLY; The etag. + Etag *string `json:"etag,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventHubConsumerGroupInfo. +func (ehcgi EventHubConsumerGroupInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehcgi.Properties != nil { + objectMap["properties"] = ehcgi.Properties + } + return json.Marshal(objectMap) +} + +// EventHubConsumerGroupName the EventHub consumer group name. +type EventHubConsumerGroupName struct { + // Name - EventHub consumer group name + Name *string `json:"name,omitempty"` +} + +// EventHubConsumerGroupsListResult the JSON-serialized array of Event Hub-compatible consumer group names +// with a next link. +type EventHubConsumerGroupsListResult struct { + autorest.Response `json:"-"` + // Value - List of consumer groups objects + Value *[]EventHubConsumerGroupInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventHubConsumerGroupsListResult. +func (ehcglr EventHubConsumerGroupsListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehcglr.Value != nil { + objectMap["value"] = ehcglr.Value + } + return json.Marshal(objectMap) +} + +// EventHubConsumerGroupsListResultIterator provides access to a complete listing of +// EventHubConsumerGroupInfo values. +type EventHubConsumerGroupsListResultIterator struct { + i int + page EventHubConsumerGroupsListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *EventHubConsumerGroupsListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *EventHubConsumerGroupsListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter EventHubConsumerGroupsListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter EventHubConsumerGroupsListResultIterator) Response() EventHubConsumerGroupsListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter EventHubConsumerGroupsListResultIterator) Value() EventHubConsumerGroupInfo { + if !iter.page.NotDone() { + return EventHubConsumerGroupInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the EventHubConsumerGroupsListResultIterator type. +func NewEventHubConsumerGroupsListResultIterator(page EventHubConsumerGroupsListResultPage) EventHubConsumerGroupsListResultIterator { + return EventHubConsumerGroupsListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ehcglr EventHubConsumerGroupsListResult) IsEmpty() bool { + return ehcglr.Value == nil || len(*ehcglr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ehcglr EventHubConsumerGroupsListResult) hasNextLink() bool { + return ehcglr.NextLink != nil && len(*ehcglr.NextLink) != 0 +} + +// eventHubConsumerGroupsListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ehcglr EventHubConsumerGroupsListResult) eventHubConsumerGroupsListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ehcglr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ehcglr.NextLink))) +} + +// EventHubConsumerGroupsListResultPage contains a page of EventHubConsumerGroupInfo values. +type EventHubConsumerGroupsListResultPage struct { + fn func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error) + ehcglr EventHubConsumerGroupsListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *EventHubConsumerGroupsListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/EventHubConsumerGroupsListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ehcglr) + if err != nil { + return err + } + page.ehcglr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *EventHubConsumerGroupsListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page EventHubConsumerGroupsListResultPage) NotDone() bool { + return !page.ehcglr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page EventHubConsumerGroupsListResultPage) Response() EventHubConsumerGroupsListResult { + return page.ehcglr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page EventHubConsumerGroupsListResultPage) Values() []EventHubConsumerGroupInfo { + if page.ehcglr.IsEmpty() { + return nil + } + return *page.ehcglr.Value +} + +// Creates a new instance of the EventHubConsumerGroupsListResultPage type. +func NewEventHubConsumerGroupsListResultPage(cur EventHubConsumerGroupsListResult, getNextPage func(context.Context, EventHubConsumerGroupsListResult) (EventHubConsumerGroupsListResult, error)) EventHubConsumerGroupsListResultPage { + return EventHubConsumerGroupsListResultPage{ + fn: getNextPage, + ehcglr: cur, + } +} + +// EventHubProperties the properties of the provisioned Event Hub-compatible endpoint used by the IoT hub. +type EventHubProperties struct { + // RetentionTimeInDays - The retention time for device-to-cloud messages in days. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages + RetentionTimeInDays *int64 `json:"retentionTimeInDays,omitempty"` + // PartitionCount - The number of partitions for receiving device-to-cloud messages in the Event Hub-compatible endpoint. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#device-to-cloud-messages. + PartitionCount *int32 `json:"partitionCount,omitempty"` + // PartitionIds - READ-ONLY; The partition ids in the Event Hub-compatible endpoint. + PartitionIds *[]string `json:"partitionIds,omitempty"` + // Path - READ-ONLY; The Event Hub-compatible name. + Path *string `json:"path,omitempty"` + // Endpoint - READ-ONLY; The Event Hub-compatible endpoint. + Endpoint *string `json:"endpoint,omitempty"` +} + +// MarshalJSON is the custom marshaler for EventHubProperties. +func (ehp EventHubProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ehp.RetentionTimeInDays != nil { + objectMap["retentionTimeInDays"] = ehp.RetentionTimeInDays + } + if ehp.PartitionCount != nil { + objectMap["partitionCount"] = ehp.PartitionCount + } + return json.Marshal(objectMap) +} + +// ExportDevicesRequest use to provide parameters when requesting an export of all devices in the IoT hub. +type ExportDevicesRequest struct { + // ExportBlobContainerURI - The export blob container URI. + ExportBlobContainerURI *string `json:"exportBlobContainerUri,omitempty"` + // ExcludeKeys - The value indicating whether keys should be excluded during export. + ExcludeKeys *bool `json:"excludeKeys,omitempty"` + // ExportBlobName - The name of the blob that will be created in the provided output blob container. This blob will contain the exported device registry information for the IoT Hub. + ExportBlobName *string `json:"exportBlobName,omitempty"` + // AuthenticationType - Specifies authentication type being used for connecting to the storage account. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of storage endpoint for export devices. + Identity *ManagedIdentity `json:"identity,omitempty"` + // IncludeConfigurations - The value indicating whether configurations should be exported. + IncludeConfigurations *bool `json:"includeConfigurations,omitempty"` + // ConfigurationsBlobName - The name of the blob that will be created in the provided output blob container. This blob will contain the exported configurations for the Iot Hub. + ConfigurationsBlobName *string `json:"configurationsBlobName,omitempty"` +} + +// FailoverInput use to provide failover region when requesting manual Failover for a hub. +type FailoverInput struct { + // FailoverRegion - Region the hub will be failed over to + FailoverRegion *string `json:"failoverRegion,omitempty"` +} + +// FallbackRouteProperties the properties of the fallback route. IoT Hub uses these properties when it +// routes messages to the fallback endpoint. +type FallbackRouteProperties struct { + // Name - The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. + Name *string `json:"name,omitempty"` + // Source - The source to which the routing rule is to be applied to. For example, DeviceMessages + Source *string `json:"source,omitempty"` + // Condition - The condition which is evaluated in order to apply the fallback route. If the condition is not provided it will evaluate to true by default. For grammar, See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language + Condition *string `json:"condition,omitempty"` + // EndpointNames - The list of endpoints to which the messages that satisfy the condition are routed to. Currently only 1 endpoint is allowed. + EndpointNames *[]string `json:"endpointNames,omitempty"` + // IsEnabled - Used to specify whether the fallback route is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// FeedbackProperties the properties of the feedback queue for cloud-to-device messages. +type FeedbackProperties struct { + // LockDurationAsIso8601 - The lock duration for the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"` + // TTLAsIso8601 - The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"` + // MaxDeliveryCount - The number of times the IoT hub attempts to deliver a message on the feedback queue. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging#cloud-to-device-messages. + MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"` +} + +// GroupIDInformation the group information for creating a private endpoint on an IotHub +type GroupIDInformation struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + Properties *GroupIDInformationProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for GroupIDInformation. +func (gii GroupIDInformation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if gii.Properties != nil { + objectMap["properties"] = gii.Properties + } + return json.Marshal(objectMap) +} + +// GroupIDInformationProperties the properties for a group information object +type GroupIDInformationProperties struct { + // GroupID - The group id + GroupID *string `json:"groupId,omitempty"` + // RequiredMembers - The required members for a specific group id + RequiredMembers *[]string `json:"requiredMembers,omitempty"` + // RequiredZoneNames - The required DNS zones for a specific group id + RequiredZoneNames *[]string `json:"requiredZoneNames,omitempty"` +} + +// ImportDevicesRequest use to provide parameters when requesting an import of all devices in the hub. +type ImportDevicesRequest struct { + // InputBlobContainerURI - The input blob container URI. + InputBlobContainerURI *string `json:"inputBlobContainerUri,omitempty"` + // OutputBlobContainerURI - The output blob container URI. + OutputBlobContainerURI *string `json:"outputBlobContainerUri,omitempty"` + // InputBlobName - The blob name to be used when importing from the provided input blob container. + InputBlobName *string `json:"inputBlobName,omitempty"` + // OutputBlobName - The blob name to use for storing the status of the import job. + OutputBlobName *string `json:"outputBlobName,omitempty"` + // AuthenticationType - Specifies authentication type being used for connecting to the storage account. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of storage endpoint for import devices. + Identity *ManagedIdentity `json:"identity,omitempty"` + // IncludeConfigurations - The value indicating whether configurations should be imported. + IncludeConfigurations *bool `json:"includeConfigurations,omitempty"` + // ConfigurationsBlobName - The blob name to be used when importing configurations from the provided input blob container. + ConfigurationsBlobName *string `json:"configurationsBlobName,omitempty"` +} + +// IotHubCapacity ioT Hub capacity information. +type IotHubCapacity struct { + // Minimum - READ-ONLY; The minimum number of units. + Minimum *int64 `json:"minimum,omitempty"` + // Maximum - READ-ONLY; The maximum number of units. + Maximum *int64 `json:"maximum,omitempty"` + // Default - READ-ONLY; The default number of units. + Default *int64 `json:"default,omitempty"` + // ScaleType - READ-ONLY; The type of the scaling enabled. Possible values include: 'IotHubScaleTypeAutomatic', 'IotHubScaleTypeManual', 'IotHubScaleTypeNone' + ScaleType IotHubScaleType `json:"scaleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubCapacity. +func (ihc IotHubCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IotHubDescription the description of the IoT hub. +type IotHubDescription struct { + autorest.Response `json:"-"` + // Etag - The Etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal ETag convention. + Etag *string `json:"etag,omitempty"` + // Properties - IotHub properties + Properties *IotHubProperties `json:"properties,omitempty"` + // Sku - IotHub SKU info + Sku *IotHubSkuInfo `json:"sku,omitempty"` + // Identity - The managed identities for the IotHub. + Identity *ArmIdentity `json:"identity,omitempty"` + // SystemData - READ-ONLY; The system meta data relating to this resource. + SystemData *SystemData `json:"systemData,omitempty"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for IotHubDescription. +func (ihd IotHubDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihd.Etag != nil { + objectMap["etag"] = ihd.Etag + } + if ihd.Properties != nil { + objectMap["properties"] = ihd.Properties + } + if ihd.Sku != nil { + objectMap["sku"] = ihd.Sku + } + if ihd.Identity != nil { + objectMap["identity"] = ihd.Identity + } + if ihd.Location != nil { + objectMap["location"] = ihd.Location + } + if ihd.Tags != nil { + objectMap["tags"] = ihd.Tags + } + return json.Marshal(objectMap) +} + +// IotHubDescriptionListResult the JSON-serialized array of IotHubDescription objects with a next link. +type IotHubDescriptionListResult struct { + autorest.Response `json:"-"` + // Value - The array of IotHubDescription objects. + Value *[]IotHubDescription `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubDescriptionListResult. +func (ihdlr IotHubDescriptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihdlr.Value != nil { + objectMap["value"] = ihdlr.Value + } + return json.Marshal(objectMap) +} + +// IotHubDescriptionListResultIterator provides access to a complete listing of IotHubDescription values. +type IotHubDescriptionListResultIterator struct { + i int + page IotHubDescriptionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IotHubDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IotHubDescriptionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotHubDescriptionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IotHubDescriptionListResultIterator) Response() IotHubDescriptionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IotHubDescriptionListResultIterator) Value() IotHubDescription { + if !iter.page.NotDone() { + return IotHubDescription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotHubDescriptionListResultIterator type. +func NewIotHubDescriptionListResultIterator(page IotHubDescriptionListResultPage) IotHubDescriptionListResultIterator { + return IotHubDescriptionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ihdlr IotHubDescriptionListResult) IsEmpty() bool { + return ihdlr.Value == nil || len(*ihdlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ihdlr IotHubDescriptionListResult) hasNextLink() bool { + return ihdlr.NextLink != nil && len(*ihdlr.NextLink) != 0 +} + +// iotHubDescriptionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ihdlr IotHubDescriptionListResult) iotHubDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ihdlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ihdlr.NextLink))) +} + +// IotHubDescriptionListResultPage contains a page of IotHubDescription values. +type IotHubDescriptionListResultPage struct { + fn func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error) + ihdlr IotHubDescriptionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IotHubDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubDescriptionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ihdlr) + if err != nil { + return err + } + page.ihdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IotHubDescriptionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotHubDescriptionListResultPage) NotDone() bool { + return !page.ihdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotHubDescriptionListResultPage) Response() IotHubDescriptionListResult { + return page.ihdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotHubDescriptionListResultPage) Values() []IotHubDescription { + if page.ihdlr.IsEmpty() { + return nil + } + return *page.ihdlr.Value +} + +// Creates a new instance of the IotHubDescriptionListResultPage type. +func NewIotHubDescriptionListResultPage(cur IotHubDescriptionListResult, getNextPage func(context.Context, IotHubDescriptionListResult) (IotHubDescriptionListResult, error)) IotHubDescriptionListResultPage { + return IotHubDescriptionListResultPage{ + fn: getNextPage, + ihdlr: cur, + } +} + +// IotHubLocationDescription public representation of one of the locations where a resource is provisioned. +type IotHubLocationDescription struct { + // Location - The name of the Azure region + Location *string `json:"location,omitempty"` + // Role - The role of the region, can be either primary or secondary. The primary region is where the IoT hub is currently provisioned. The secondary region is the Azure disaster recovery (DR) paired region and also the region where the IoT hub can failover to. Possible values include: 'IotHubReplicaRoleTypePrimary', 'IotHubReplicaRoleTypeSecondary' + Role IotHubReplicaRoleType `json:"role,omitempty"` +} + +// IotHubManualFailoverFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotHubManualFailoverFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotHubClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotHubManualFailoverFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotHubManualFailoverFuture.Result. +func (future *IotHubManualFailoverFuture) result(client IotHubClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubManualFailoverFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("devices.IotHubManualFailoverFuture") + return + } + ar.Response = future.Response() + return +} + +// IotHubNameAvailabilityInfo the properties indicating whether a given IoT hub name is available. +type IotHubNameAvailabilityInfo struct { + autorest.Response `json:"-"` + // NameAvailable - READ-ONLY; The value which indicates whether the provided name is available. + NameAvailable *bool `json:"nameAvailable,omitempty"` + // Reason - READ-ONLY; The reason for unavailability. Possible values include: 'IotHubNameUnavailabilityReasonInvalid', 'IotHubNameUnavailabilityReasonAlreadyExists' + Reason IotHubNameUnavailabilityReason `json:"reason,omitempty"` + // Message - The detailed reason message. + Message *string `json:"message,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubNameAvailabilityInfo. +func (ihnai IotHubNameAvailabilityInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihnai.Message != nil { + objectMap["message"] = ihnai.Message + } + return json.Marshal(objectMap) +} + +// IotHubProperties the properties of an IoT hub. +type IotHubProperties struct { + // AuthorizationPolicies - The shared access policies you can use to secure a connection to the IoT hub. + AuthorizationPolicies *[]SharedAccessSignatureAuthorizationRule `json:"authorizationPolicies,omitempty"` + // DisableLocalAuth - If true, SAS tokens with Iot hub scoped SAS keys cannot be used for authentication. + DisableLocalAuth *bool `json:"disableLocalAuth,omitempty"` + // DisableDeviceSAS - If true, all device(including Edge devices but excluding modules) scoped SAS keys cannot be used for authentication. + DisableDeviceSAS *bool `json:"disableDeviceSAS,omitempty"` + // DisableModuleSAS - If true, all module scoped SAS keys cannot be used for authentication. + DisableModuleSAS *bool `json:"disableModuleSAS,omitempty"` + // RestrictOutboundNetworkAccess - If true, egress from IotHub will be restricted to only the allowed FQDNs that are configured via allowedFqdnList. + RestrictOutboundNetworkAccess *bool `json:"restrictOutboundNetworkAccess,omitempty"` + // AllowedFqdnList - List of allowed FQDNs(Fully Qualified Domain Name) for egress from Iot Hub. + AllowedFqdnList *[]string `json:"allowedFqdnList,omitempty"` + // PublicNetworkAccess - Whether requests from Public Network are allowed. Possible values include: 'PublicNetworkAccessEnabled', 'PublicNetworkAccessDisabled' + PublicNetworkAccess PublicNetworkAccess `json:"publicNetworkAccess,omitempty"` + // IPFilterRules - The IP filter rules. + IPFilterRules *[]IPFilterRule `json:"ipFilterRules,omitempty"` + NetworkRuleSets *NetworkRuleSetProperties `json:"networkRuleSets,omitempty"` + // MinTLSVersion - Specifies the minimum TLS version to support for this hub. Can be set to "1.2" to have clients that use a TLS version below 1.2 to be rejected. + MinTLSVersion *string `json:"minTlsVersion,omitempty"` + // PrivateEndpointConnections - Private endpoint connections created on this IotHub + PrivateEndpointConnections *[]PrivateEndpointConnection `json:"privateEndpointConnections,omitempty"` + // ProvisioningState - READ-ONLY; The provisioning state. + ProvisioningState *string `json:"provisioningState,omitempty"` + // State - READ-ONLY; The hub state. + State *string `json:"state,omitempty"` + // HostName - READ-ONLY; The name of the host. + HostName *string `json:"hostName,omitempty"` + // EventHubEndpoints - The Event Hub-compatible endpoint properties. The only possible keys to this dictionary is events. This key has to be present in the dictionary while making create or update calls for the IoT hub. + EventHubEndpoints map[string]*EventHubProperties `json:"eventHubEndpoints"` + Routing *RoutingProperties `json:"routing,omitempty"` + // StorageEndpoints - The list of Azure Storage endpoints where you can upload files. Currently you can configure only one Azure Storage account and that MUST have its key as $default. Specifying more than one storage account causes an error to be thrown. Not specifying a value for this property when the enableFileUploadNotifications property is set to True, causes an error to be thrown. + StorageEndpoints map[string]*StorageEndpointProperties `json:"storageEndpoints"` + // MessagingEndpoints - The messaging endpoint properties for the file upload notification queue. + MessagingEndpoints map[string]*MessagingEndpointProperties `json:"messagingEndpoints"` + // EnableFileUploadNotifications - If True, file upload notifications are enabled. + EnableFileUploadNotifications *bool `json:"enableFileUploadNotifications,omitempty"` + CloudToDevice *CloudToDeviceProperties `json:"cloudToDevice,omitempty"` + // Comments - IoT hub comments. + Comments *string `json:"comments,omitempty"` + // Features - The capabilities and features enabled for the IoT hub. Possible values include: 'CapabilitiesNone', 'CapabilitiesDeviceManagement' + Features Capabilities `json:"features,omitempty"` + // Locations - READ-ONLY; Primary and secondary location for iot hub + Locations *[]IotHubLocationDescription `json:"locations,omitempty"` + // EnableDataResidency - This property when set to true, will enable data residency, thus, disabling disaster recovery. + EnableDataResidency *bool `json:"enableDataResidency,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubProperties. +func (ihp IotHubProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihp.AuthorizationPolicies != nil { + objectMap["authorizationPolicies"] = ihp.AuthorizationPolicies + } + if ihp.DisableLocalAuth != nil { + objectMap["disableLocalAuth"] = ihp.DisableLocalAuth + } + if ihp.DisableDeviceSAS != nil { + objectMap["disableDeviceSAS"] = ihp.DisableDeviceSAS + } + if ihp.DisableModuleSAS != nil { + objectMap["disableModuleSAS"] = ihp.DisableModuleSAS + } + if ihp.RestrictOutboundNetworkAccess != nil { + objectMap["restrictOutboundNetworkAccess"] = ihp.RestrictOutboundNetworkAccess + } + if ihp.AllowedFqdnList != nil { + objectMap["allowedFqdnList"] = ihp.AllowedFqdnList + } + if ihp.PublicNetworkAccess != "" { + objectMap["publicNetworkAccess"] = ihp.PublicNetworkAccess + } + if ihp.IPFilterRules != nil { + objectMap["ipFilterRules"] = ihp.IPFilterRules + } + if ihp.NetworkRuleSets != nil { + objectMap["networkRuleSets"] = ihp.NetworkRuleSets + } + if ihp.MinTLSVersion != nil { + objectMap["minTlsVersion"] = ihp.MinTLSVersion + } + if ihp.PrivateEndpointConnections != nil { + objectMap["privateEndpointConnections"] = ihp.PrivateEndpointConnections + } + if ihp.EventHubEndpoints != nil { + objectMap["eventHubEndpoints"] = ihp.EventHubEndpoints + } + if ihp.Routing != nil { + objectMap["routing"] = ihp.Routing + } + if ihp.StorageEndpoints != nil { + objectMap["storageEndpoints"] = ihp.StorageEndpoints + } + if ihp.MessagingEndpoints != nil { + objectMap["messagingEndpoints"] = ihp.MessagingEndpoints + } + if ihp.EnableFileUploadNotifications != nil { + objectMap["enableFileUploadNotifications"] = ihp.EnableFileUploadNotifications + } + if ihp.CloudToDevice != nil { + objectMap["cloudToDevice"] = ihp.CloudToDevice + } + if ihp.Comments != nil { + objectMap["comments"] = ihp.Comments + } + if ihp.Features != "" { + objectMap["features"] = ihp.Features + } + if ihp.EnableDataResidency != nil { + objectMap["enableDataResidency"] = ihp.EnableDataResidency + } + return json.Marshal(objectMap) +} + +// IotHubQuotaMetricInfo quota metrics properties. +type IotHubQuotaMetricInfo struct { + // Name - READ-ONLY; The name of the quota metric. + Name *string `json:"name,omitempty"` + // CurrentValue - READ-ONLY; The current value for the quota metric. + CurrentValue *int64 `json:"currentValue,omitempty"` + // MaxValue - READ-ONLY; The maximum value of the quota metric. + MaxValue *int64 `json:"maxValue,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubQuotaMetricInfo. +func (ihqmi IotHubQuotaMetricInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// IotHubQuotaMetricInfoListResult the JSON-serialized array of IotHubQuotaMetricInfo objects with a next +// link. +type IotHubQuotaMetricInfoListResult struct { + autorest.Response `json:"-"` + // Value - The array of quota metrics objects. + Value *[]IotHubQuotaMetricInfo `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubQuotaMetricInfoListResult. +func (ihqmilr IotHubQuotaMetricInfoListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihqmilr.Value != nil { + objectMap["value"] = ihqmilr.Value + } + return json.Marshal(objectMap) +} + +// IotHubQuotaMetricInfoListResultIterator provides access to a complete listing of IotHubQuotaMetricInfo +// values. +type IotHubQuotaMetricInfoListResultIterator struct { + i int + page IotHubQuotaMetricInfoListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IotHubQuotaMetricInfoListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IotHubQuotaMetricInfoListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotHubQuotaMetricInfoListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IotHubQuotaMetricInfoListResultIterator) Response() IotHubQuotaMetricInfoListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IotHubQuotaMetricInfoListResultIterator) Value() IotHubQuotaMetricInfo { + if !iter.page.NotDone() { + return IotHubQuotaMetricInfo{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotHubQuotaMetricInfoListResultIterator type. +func NewIotHubQuotaMetricInfoListResultIterator(page IotHubQuotaMetricInfoListResultPage) IotHubQuotaMetricInfoListResultIterator { + return IotHubQuotaMetricInfoListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ihqmilr IotHubQuotaMetricInfoListResult) IsEmpty() bool { + return ihqmilr.Value == nil || len(*ihqmilr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ihqmilr IotHubQuotaMetricInfoListResult) hasNextLink() bool { + return ihqmilr.NextLink != nil && len(*ihqmilr.NextLink) != 0 +} + +// iotHubQuotaMetricInfoListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ihqmilr IotHubQuotaMetricInfoListResult) iotHubQuotaMetricInfoListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ihqmilr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ihqmilr.NextLink))) +} + +// IotHubQuotaMetricInfoListResultPage contains a page of IotHubQuotaMetricInfo values. +type IotHubQuotaMetricInfoListResultPage struct { + fn func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error) + ihqmilr IotHubQuotaMetricInfoListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IotHubQuotaMetricInfoListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubQuotaMetricInfoListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ihqmilr) + if err != nil { + return err + } + page.ihqmilr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IotHubQuotaMetricInfoListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotHubQuotaMetricInfoListResultPage) NotDone() bool { + return !page.ihqmilr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotHubQuotaMetricInfoListResultPage) Response() IotHubQuotaMetricInfoListResult { + return page.ihqmilr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotHubQuotaMetricInfoListResultPage) Values() []IotHubQuotaMetricInfo { + if page.ihqmilr.IsEmpty() { + return nil + } + return *page.ihqmilr.Value +} + +// Creates a new instance of the IotHubQuotaMetricInfoListResultPage type. +func NewIotHubQuotaMetricInfoListResultPage(cur IotHubQuotaMetricInfoListResult, getNextPage func(context.Context, IotHubQuotaMetricInfoListResult) (IotHubQuotaMetricInfoListResult, error)) IotHubQuotaMetricInfoListResultPage { + return IotHubQuotaMetricInfoListResultPage{ + fn: getNextPage, + ihqmilr: cur, + } +} + +// IotHubResourceCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type IotHubResourceCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotHubResourceClient) (IotHubDescription, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotHubResourceCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotHubResourceCreateOrUpdateFuture.Result. +func (future *IotHubResourceCreateOrUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ihd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent { + ihd, err = client.CreateOrUpdateResponder(ihd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceCreateOrUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request") + } + } + return +} + +// IotHubResourceDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotHubResourceDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotHubResourceClient) (SetObject, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotHubResourceDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotHubResourceDeleteFuture.Result. +func (future *IotHubResourceDeleteFuture) result(client IotHubResourceClient) (so SetObject, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + so.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if so.Response.Response, err = future.GetResult(sender); err == nil && so.Response.Response.StatusCode != http.StatusNoContent { + so, err = client.DeleteResponder(so.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceDeleteFuture", "Result", so.Response.Response, "Failure responding to request") + } + } + return +} + +// IotHubResourceUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type IotHubResourceUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(IotHubResourceClient) (IotHubDescription, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *IotHubResourceUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for IotHubResourceUpdateFuture.Result. +func (future *IotHubResourceUpdateFuture) result(client IotHubResourceClient) (ihd IotHubDescription, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ihd.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("devices.IotHubResourceUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if ihd.Response.Response, err = future.GetResult(sender); err == nil && ihd.Response.Response.StatusCode != http.StatusNoContent { + ihd, err = client.UpdateResponder(ihd.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.IotHubResourceUpdateFuture", "Result", ihd.Response.Response, "Failure responding to request") + } + } + return +} + +// IotHubSkuDescription SKU properties. +type IotHubSkuDescription struct { + // ResourceType - READ-ONLY; The type of the resource. + ResourceType *string `json:"resourceType,omitempty"` + // Sku - The type of the resource. + Sku *IotHubSkuInfo `json:"sku,omitempty"` + // Capacity - IotHub capacity + Capacity *IotHubCapacity `json:"capacity,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubSkuDescription. +func (ihsd IotHubSkuDescription) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihsd.Sku != nil { + objectMap["sku"] = ihsd.Sku + } + if ihsd.Capacity != nil { + objectMap["capacity"] = ihsd.Capacity + } + return json.Marshal(objectMap) +} + +// IotHubSkuDescriptionListResult the JSON-serialized array of IotHubSkuDescription objects with a next +// link. +type IotHubSkuDescriptionListResult struct { + autorest.Response `json:"-"` + // Value - The array of IotHubSkuDescription. + Value *[]IotHubSkuDescription `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubSkuDescriptionListResult. +func (ihsdlr IotHubSkuDescriptionListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihsdlr.Value != nil { + objectMap["value"] = ihsdlr.Value + } + return json.Marshal(objectMap) +} + +// IotHubSkuDescriptionListResultIterator provides access to a complete listing of IotHubSkuDescription +// values. +type IotHubSkuDescriptionListResultIterator struct { + i int + page IotHubSkuDescriptionListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *IotHubSkuDescriptionListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *IotHubSkuDescriptionListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter IotHubSkuDescriptionListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter IotHubSkuDescriptionListResultIterator) Response() IotHubSkuDescriptionListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter IotHubSkuDescriptionListResultIterator) Value() IotHubSkuDescription { + if !iter.page.NotDone() { + return IotHubSkuDescription{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the IotHubSkuDescriptionListResultIterator type. +func NewIotHubSkuDescriptionListResultIterator(page IotHubSkuDescriptionListResultPage) IotHubSkuDescriptionListResultIterator { + return IotHubSkuDescriptionListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ihsdlr IotHubSkuDescriptionListResult) IsEmpty() bool { + return ihsdlr.Value == nil || len(*ihsdlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ihsdlr IotHubSkuDescriptionListResult) hasNextLink() bool { + return ihsdlr.NextLink != nil && len(*ihsdlr.NextLink) != 0 +} + +// iotHubSkuDescriptionListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ihsdlr IotHubSkuDescriptionListResult) iotHubSkuDescriptionListResultPreparer(ctx context.Context) (*http.Request, error) { + if !ihsdlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ihsdlr.NextLink))) +} + +// IotHubSkuDescriptionListResultPage contains a page of IotHubSkuDescription values. +type IotHubSkuDescriptionListResultPage struct { + fn func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error) + ihsdlr IotHubSkuDescriptionListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *IotHubSkuDescriptionListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/IotHubSkuDescriptionListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ihsdlr) + if err != nil { + return err + } + page.ihsdlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *IotHubSkuDescriptionListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page IotHubSkuDescriptionListResultPage) NotDone() bool { + return !page.ihsdlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page IotHubSkuDescriptionListResultPage) Response() IotHubSkuDescriptionListResult { + return page.ihsdlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page IotHubSkuDescriptionListResultPage) Values() []IotHubSkuDescription { + if page.ihsdlr.IsEmpty() { + return nil + } + return *page.ihsdlr.Value +} + +// Creates a new instance of the IotHubSkuDescriptionListResultPage type. +func NewIotHubSkuDescriptionListResultPage(cur IotHubSkuDescriptionListResult, getNextPage func(context.Context, IotHubSkuDescriptionListResult) (IotHubSkuDescriptionListResult, error)) IotHubSkuDescriptionListResultPage { + return IotHubSkuDescriptionListResultPage{ + fn: getNextPage, + ihsdlr: cur, + } +} + +// IotHubSkuInfo information about the SKU of the IoT hub. +type IotHubSkuInfo struct { + // Name - The name of the SKU. Possible values include: 'IotHubSkuF1', 'IotHubSkuS1', 'IotHubSkuS2', 'IotHubSkuS3', 'IotHubSkuB1', 'IotHubSkuB2', 'IotHubSkuB3' + Name IotHubSku `json:"name,omitempty"` + // Tier - READ-ONLY; The billing tier for the IoT hub. Possible values include: 'IotHubSkuTierFree', 'IotHubSkuTierStandard', 'IotHubSkuTierBasic' + Tier IotHubSkuTier `json:"tier,omitempty"` + // Capacity - The number of provisioned IoT Hub units. See: https://docs.microsoft.com/azure/azure-subscription-service-limits#iot-hub-limits. + Capacity *int64 `json:"capacity,omitempty"` +} + +// MarshalJSON is the custom marshaler for IotHubSkuInfo. +func (ihsi IotHubSkuInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ihsi.Name != "" { + objectMap["name"] = ihsi.Name + } + if ihsi.Capacity != nil { + objectMap["capacity"] = ihsi.Capacity + } + return json.Marshal(objectMap) +} + +// IPFilterRule the IP filter rules for the IoT hub. +type IPFilterRule struct { + // FilterName - The name of the IP filter rule. + FilterName *string `json:"filterName,omitempty"` + // Action - The desired action for requests captured by this rule. Possible values include: 'IPFilterActionTypeAccept', 'IPFilterActionTypeReject' + Action IPFilterActionType `json:"action,omitempty"` + // IPMask - A string that contains the IP address range in CIDR notation for the rule. + IPMask *string `json:"ipMask,omitempty"` +} + +// JobResponse the properties of the Job Response object. +type JobResponse struct { + autorest.Response `json:"-"` + // JobID - READ-ONLY; The job identifier. + JobID *string `json:"jobId,omitempty"` + // StartTimeUtc - READ-ONLY; The start time of the job. + StartTimeUtc *date.TimeRFC1123 `json:"startTimeUtc,omitempty"` + // EndTimeUtc - READ-ONLY; The time the job stopped processing. + EndTimeUtc *date.TimeRFC1123 `json:"endTimeUtc,omitempty"` + // Type - READ-ONLY; The type of the job. Possible values include: 'JobTypeUnknown', 'JobTypeExport', 'JobTypeImport', 'JobTypeBackup', 'JobTypeReadDeviceProperties', 'JobTypeWriteDeviceProperties', 'JobTypeUpdateDeviceConfiguration', 'JobTypeRebootDevice', 'JobTypeFactoryResetDevice', 'JobTypeFirmwareUpdate' + Type JobType `json:"type,omitempty"` + // Status - READ-ONLY; The status of the job. Possible values include: 'JobStatusUnknown', 'JobStatusEnqueued', 'JobStatusRunning', 'JobStatusCompleted', 'JobStatusFailed', 'JobStatusCancelled' + Status JobStatus `json:"status,omitempty"` + // FailureReason - READ-ONLY; If status == failed, this string containing the reason for the failure. + FailureReason *string `json:"failureReason,omitempty"` + // StatusMessage - READ-ONLY; The status message for the job. + StatusMessage *string `json:"statusMessage,omitempty"` + // ParentJobID - READ-ONLY; The job identifier of the parent job, if any. + ParentJobID *string `json:"parentJobId,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobResponse. +func (jr JobResponse) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// JobResponseListResult the JSON-serialized array of JobResponse objects with a next link. +type JobResponseListResult struct { + autorest.Response `json:"-"` + // Value - The array of JobResponse objects. + Value *[]JobResponse `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for JobResponseListResult. +func (jrlr JobResponseListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if jrlr.Value != nil { + objectMap["value"] = jrlr.Value + } + return json.Marshal(objectMap) +} + +// JobResponseListResultIterator provides access to a complete listing of JobResponse values. +type JobResponseListResultIterator struct { + i int + page JobResponseListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *JobResponseListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *JobResponseListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter JobResponseListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter JobResponseListResultIterator) Response() JobResponseListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter JobResponseListResultIterator) Value() JobResponse { + if !iter.page.NotDone() { + return JobResponse{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the JobResponseListResultIterator type. +func NewJobResponseListResultIterator(page JobResponseListResultPage) JobResponseListResultIterator { + return JobResponseListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (jrlr JobResponseListResult) IsEmpty() bool { + return jrlr.Value == nil || len(*jrlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (jrlr JobResponseListResult) hasNextLink() bool { + return jrlr.NextLink != nil && len(*jrlr.NextLink) != 0 +} + +// jobResponseListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (jrlr JobResponseListResult) jobResponseListResultPreparer(ctx context.Context) (*http.Request, error) { + if !jrlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(jrlr.NextLink))) +} + +// JobResponseListResultPage contains a page of JobResponse values. +type JobResponseListResultPage struct { + fn func(context.Context, JobResponseListResult) (JobResponseListResult, error) + jrlr JobResponseListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *JobResponseListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/JobResponseListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.jrlr) + if err != nil { + return err + } + page.jrlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *JobResponseListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page JobResponseListResultPage) NotDone() bool { + return !page.jrlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page JobResponseListResultPage) Response() JobResponseListResult { + return page.jrlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page JobResponseListResultPage) Values() []JobResponse { + if page.jrlr.IsEmpty() { + return nil + } + return *page.jrlr.Value +} + +// Creates a new instance of the JobResponseListResultPage type. +func NewJobResponseListResultPage(cur JobResponseListResult, getNextPage func(context.Context, JobResponseListResult) (JobResponseListResult, error)) JobResponseListResultPage { + return JobResponseListResultPage{ + fn: getNextPage, + jrlr: cur, + } +} + +// ListPrivateEndpointConnection ... +type ListPrivateEndpointConnection struct { + autorest.Response `json:"-"` + Value *[]PrivateEndpointConnection `json:"value,omitempty"` +} + +// ManagedIdentity the properties of the Managed identity. +type ManagedIdentity struct { + // UserAssignedIdentity - The user assigned identity. + UserAssignedIdentity *string `json:"userAssignedIdentity,omitempty"` +} + +// MatchedRoute routes that matched +type MatchedRoute struct { + // Properties - Properties of routes that matched + Properties *RouteProperties `json:"properties,omitempty"` +} + +// MessagingEndpointProperties the properties of the messaging endpoints used by this IoT hub. +type MessagingEndpointProperties struct { + // LockDurationAsIso8601 - The lock duration. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + LockDurationAsIso8601 *string `json:"lockDurationAsIso8601,omitempty"` + // TTLAsIso8601 - The period of time for which a message is available to consume before it is expired by the IoT hub. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + TTLAsIso8601 *string `json:"ttlAsIso8601,omitempty"` + // MaxDeliveryCount - The number of times the IoT hub attempts to deliver a message. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload. + MaxDeliveryCount *int32 `json:"maxDeliveryCount,omitempty"` +} + +// Name name of Iot Hub type +type Name struct { + // Value - IotHub type + Value *string `json:"value,omitempty"` + // LocalizedValue - Localized value of name + LocalizedValue *string `json:"localizedValue,omitempty"` +} + +// NetworkRuleSetIPRule IP Rule to be applied as part of Network Rule Set +type NetworkRuleSetIPRule struct { + // FilterName - Name of the IP filter rule. + FilterName *string `json:"filterName,omitempty"` + // Action - IP Filter Action. Possible values include: 'NetworkRuleIPActionAllow' + Action NetworkRuleIPAction `json:"action,omitempty"` + // IPMask - A string that contains the IP address range in CIDR notation for the rule. + IPMask *string `json:"ipMask,omitempty"` +} + +// NetworkRuleSetProperties network Rule Set Properties of IotHub +type NetworkRuleSetProperties struct { + // DefaultAction - Default Action for Network Rule Set. Possible values include: 'DefaultActionDeny', 'DefaultActionAllow' + DefaultAction DefaultAction `json:"defaultAction,omitempty"` + // ApplyToBuiltInEventHubEndpoint - If True, then Network Rule Set is also applied to BuiltIn EventHub EndPoint of IotHub + ApplyToBuiltInEventHubEndpoint *bool `json:"applyToBuiltInEventHubEndpoint,omitempty"` + // IPRules - List of IP Rules + IPRules *[]NetworkRuleSetIPRule `json:"ipRules,omitempty"` +} + +// Operation ioT Hub REST API operation +type Operation struct { + // Name - READ-ONLY; Operation name: {provider}/{resource}/{read | write | action | delete} + Name *string `json:"name,omitempty"` + // Display - The object that represents the operation. + Display *OperationDisplay `json:"display,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + +// OperationDisplay the object that represents the operation. +type OperationDisplay struct { + // Provider - READ-ONLY; Service provider: Microsoft Devices + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; Resource Type: IotHubs + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; Name of the operation + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; Description of the operation + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationInputs input values. +type OperationInputs struct { + // Name - The name of the IoT hub to check. + Name *string `json:"name,omitempty"` +} + +// OperationListResult result of the request to list IoT Hub operations. It contains a list of operations +// and a URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of IoT Hub operations supported by the Microsoft.Devices resource provider. + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results if there are any. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// PrivateEndpoint the private endpoint property of a private endpoint connection +type PrivateEndpoint struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpoint. +func (peVar PrivateEndpoint) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PrivateEndpointConnection the private endpoint connection of an IotHub +type PrivateEndpointConnection struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + Properties *PrivateEndpointConnectionProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for PrivateEndpointConnection. +func (pec PrivateEndpointConnection) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if pec.Properties != nil { + objectMap["properties"] = pec.Properties + } + return json.Marshal(objectMap) +} + +// PrivateEndpointConnectionProperties the properties of a private endpoint connection +type PrivateEndpointConnectionProperties struct { + PrivateEndpoint *PrivateEndpoint `json:"privateEndpoint,omitempty"` + PrivateLinkServiceConnectionState *PrivateLinkServiceConnectionState `json:"privateLinkServiceConnectionState,omitempty"` +} + +// PrivateEndpointConnectionsDeleteFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsDeleteFuture.Result. +func (future *PrivateEndpointConnectionsDeleteFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("devices.PrivateEndpointConnectionsDeleteFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.DeleteResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsDeleteFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateEndpointConnectionsUpdateFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type PrivateEndpointConnectionsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(PrivateEndpointConnectionsClient) (PrivateEndpointConnection, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *PrivateEndpointConnectionsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for PrivateEndpointConnectionsUpdateFuture.Result. +func (future *PrivateEndpointConnectionsUpdateFuture) result(client PrivateEndpointConnectionsClient) (pec PrivateEndpointConnection, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + pec.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("devices.PrivateEndpointConnectionsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if pec.Response.Response, err = future.GetResult(sender); err == nil && pec.Response.Response.StatusCode != http.StatusNoContent { + pec, err = client.UpdateResponder(pec.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsUpdateFuture", "Result", pec.Response.Response, "Failure responding to request") + } + } + return +} + +// PrivateLinkResources the available private link resources for an IotHub +type PrivateLinkResources struct { + autorest.Response `json:"-"` + // Value - The list of available private link resources for an IotHub + Value *[]GroupIDInformation `json:"value,omitempty"` +} + +// PrivateLinkServiceConnectionState the current state of a private endpoint connection +type PrivateLinkServiceConnectionState struct { + // Status - The status of a private endpoint connection. Possible values include: 'PrivateLinkServiceConnectionStatusPending', 'PrivateLinkServiceConnectionStatusApproved', 'PrivateLinkServiceConnectionStatusRejected', 'PrivateLinkServiceConnectionStatusDisconnected' + Status PrivateLinkServiceConnectionStatus `json:"status,omitempty"` + // Description - The description for the current state of a private endpoint connection + Description *string `json:"description,omitempty"` + // ActionsRequired - Actions required for a private endpoint connection + ActionsRequired *string `json:"actionsRequired,omitempty"` +} + +// RegistryStatistics identity registry statistics. +type RegistryStatistics struct { + autorest.Response `json:"-"` + // TotalDeviceCount - READ-ONLY; The total count of devices in the identity registry. + TotalDeviceCount *int64 `json:"totalDeviceCount,omitempty"` + // EnabledDeviceCount - READ-ONLY; The count of enabled devices in the identity registry. + EnabledDeviceCount *int64 `json:"enabledDeviceCount,omitempty"` + // DisabledDeviceCount - READ-ONLY; The count of disabled devices in the identity registry. + DisabledDeviceCount *int64 `json:"disabledDeviceCount,omitempty"` +} + +// MarshalJSON is the custom marshaler for RegistryStatistics. +func (rs RegistryStatistics) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// Resource the common properties of an Azure resource. +type Resource struct { + // ID - READ-ONLY; The resource identifier. + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The resource name. + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The resource type. + Type *string `json:"type,omitempty"` + // Location - The resource location. + Location *string `json:"location,omitempty"` + // Tags - The resource tags. + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if r.Location != nil { + objectMap["location"] = r.Location + } + if r.Tags != nil { + objectMap["tags"] = r.Tags + } + return json.Marshal(objectMap) +} + +// RouteCompilationError compilation error when evaluating route +type RouteCompilationError struct { + // Message - Route error message + Message *string `json:"message,omitempty"` + // Severity - Severity of the route error. Possible values include: 'RouteErrorSeverityError', 'RouteErrorSeverityWarning' + Severity RouteErrorSeverity `json:"severity,omitempty"` + // Location - Location where the route error happened + Location *RouteErrorRange `json:"location,omitempty"` +} + +// RouteErrorPosition position where the route error happened +type RouteErrorPosition struct { + // Line - Line where the route error happened + Line *int32 `json:"line,omitempty"` + // Column - Column where the route error happened + Column *int32 `json:"column,omitempty"` +} + +// RouteErrorRange range of route errors +type RouteErrorRange struct { + // Start - Start where the route error happened + Start *RouteErrorPosition `json:"start,omitempty"` + // End - End where the route error happened + End *RouteErrorPosition `json:"end,omitempty"` +} + +// RouteProperties the properties of a routing rule that your IoT hub uses to route messages to endpoints. +type RouteProperties struct { + // Name - The name of the route. The name can only include alphanumeric characters, periods, underscores, hyphens, has a maximum length of 64 characters, and must be unique. + Name *string `json:"name,omitempty"` + // Source - The source that the routing rule is to be applied to, such as DeviceMessages. Possible values include: 'RoutingSourceInvalid', 'RoutingSourceDeviceMessages', 'RoutingSourceTwinChangeEvents', 'RoutingSourceDeviceLifecycleEvents', 'RoutingSourceDeviceJobLifecycleEvents', 'RoutingSourceDeviceConnectionStateEvents' + Source RoutingSource `json:"source,omitempty"` + // Condition - The condition that is evaluated to apply the routing rule. If no condition is provided, it evaluates to true by default. For grammar, see: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-query-language + Condition *string `json:"condition,omitempty"` + // EndpointNames - The list of endpoints to which messages that satisfy the condition are routed. Currently only one endpoint is allowed. + EndpointNames *[]string `json:"endpointNames,omitempty"` + // IsEnabled - Used to specify whether a route is enabled. + IsEnabled *bool `json:"isEnabled,omitempty"` +} + +// RoutingEndpoints the properties related to the custom endpoints to which your IoT hub routes messages +// based on the routing rules. A maximum of 10 custom endpoints are allowed across all endpoint types for +// paid hubs and only 1 custom endpoint is allowed across all endpoint types for free hubs. +type RoutingEndpoints struct { + // ServiceBusQueues - The list of Service Bus queue endpoints that IoT hub routes the messages to, based on the routing rules. + ServiceBusQueues *[]RoutingServiceBusQueueEndpointProperties `json:"serviceBusQueues,omitempty"` + // ServiceBusTopics - The list of Service Bus topic endpoints that the IoT hub routes the messages to, based on the routing rules. + ServiceBusTopics *[]RoutingServiceBusTopicEndpointProperties `json:"serviceBusTopics,omitempty"` + // EventHubs - The list of Event Hubs endpoints that IoT hub routes messages to, based on the routing rules. This list does not include the built-in Event Hubs endpoint. + EventHubs *[]RoutingEventHubProperties `json:"eventHubs,omitempty"` + // StorageContainers - The list of storage container endpoints that IoT hub routes messages to, based on the routing rules. + StorageContainers *[]RoutingStorageContainerProperties `json:"storageContainers,omitempty"` +} + +// RoutingEventHubProperties the properties related to an event hub endpoint. +type RoutingEventHubProperties struct { + // ID - Id of the event hub endpoint + ID *string `json:"id,omitempty"` + // ConnectionString - The connection string of the event hub endpoint. + ConnectionString *string `json:"connectionString,omitempty"` + // EndpointURI - The url of the event hub endpoint. It must include the protocol sb:// + EndpointURI *string `json:"endpointUri,omitempty"` + // EntityPath - Event hub name on the event hub namespace + EntityPath *string `json:"entityPath,omitempty"` + // AuthenticationType - Method used to authenticate against the event hub endpoint. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of routing event hub endpoint. + Identity *ManagedIdentity `json:"identity,omitempty"` + // Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + Name *string `json:"name,omitempty"` + // SubscriptionID - The subscription identifier of the event hub endpoint. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - The name of the resource group of the event hub endpoint. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// RoutingMessage routing message +type RoutingMessage struct { + // Body - Body of routing message + Body *string `json:"body,omitempty"` + // AppProperties - App properties + AppProperties map[string]*string `json:"appProperties"` + // SystemProperties - System properties + SystemProperties map[string]*string `json:"systemProperties"` +} + +// MarshalJSON is the custom marshaler for RoutingMessage. +func (rm RoutingMessage) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rm.Body != nil { + objectMap["body"] = rm.Body + } + if rm.AppProperties != nil { + objectMap["appProperties"] = rm.AppProperties + } + if rm.SystemProperties != nil { + objectMap["systemProperties"] = rm.SystemProperties + } + return json.Marshal(objectMap) +} + +// RoutingProperties the routing related properties of the IoT hub. See: +// https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-messaging +type RoutingProperties struct { + Endpoints *RoutingEndpoints `json:"endpoints,omitempty"` + // Routes - The list of user-provided routing rules that the IoT hub uses to route messages to built-in and custom endpoints. A maximum of 100 routing rules are allowed for paid hubs and a maximum of 5 routing rules are allowed for free hubs. + Routes *[]RouteProperties `json:"routes,omitempty"` + // FallbackRoute - The properties of the route that is used as a fall-back route when none of the conditions specified in the 'routes' section are met. This is an optional parameter. When this property is not set, the messages which do not meet any of the conditions specified in the 'routes' section get routed to the built-in eventhub endpoint. + FallbackRoute *FallbackRouteProperties `json:"fallbackRoute,omitempty"` + // Enrichments - The list of user-provided enrichments that the IoT hub applies to messages to be delivered to built-in and custom endpoints. See: https://aka.ms/telemetryoneventgrid + Enrichments *[]EnrichmentProperties `json:"enrichments,omitempty"` +} + +// RoutingServiceBusQueueEndpointProperties the properties related to service bus queue endpoint types. +type RoutingServiceBusQueueEndpointProperties struct { + // ID - Id of the service bus queue endpoint + ID *string `json:"id,omitempty"` + // ConnectionString - The connection string of the service bus queue endpoint. + ConnectionString *string `json:"connectionString,omitempty"` + // EndpointURI - The url of the service bus queue endpoint. It must include the protocol sb:// + EndpointURI *string `json:"endpointUri,omitempty"` + // EntityPath - Queue name on the service bus namespace + EntityPath *string `json:"entityPath,omitempty"` + // AuthenticationType - Method used to authenticate against the service bus queue endpoint. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of routing service bus queue endpoint. + Identity *ManagedIdentity `json:"identity,omitempty"` + // Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual queue name. + Name *string `json:"name,omitempty"` + // SubscriptionID - The subscription identifier of the service bus queue endpoint. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - The name of the resource group of the service bus queue endpoint. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// RoutingServiceBusTopicEndpointProperties the properties related to service bus topic endpoint types. +type RoutingServiceBusTopicEndpointProperties struct { + // ID - Id of the service bus topic endpoint + ID *string `json:"id,omitempty"` + // ConnectionString - The connection string of the service bus topic endpoint. + ConnectionString *string `json:"connectionString,omitempty"` + // EndpointURI - The url of the service bus topic endpoint. It must include the protocol sb:// + EndpointURI *string `json:"endpointUri,omitempty"` + // EntityPath - Queue name on the service bus topic + EntityPath *string `json:"entityPath,omitempty"` + // AuthenticationType - Method used to authenticate against the service bus topic endpoint. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of routing service bus topic endpoint. + Identity *ManagedIdentity `json:"identity,omitempty"` + // Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. The name need not be the same as the actual topic name. + Name *string `json:"name,omitempty"` + // SubscriptionID - The subscription identifier of the service bus topic endpoint. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - The name of the resource group of the service bus topic endpoint. + ResourceGroup *string `json:"resourceGroup,omitempty"` +} + +// RoutingStorageContainerProperties the properties related to a storage container endpoint. +type RoutingStorageContainerProperties struct { + // ID - Id of the storage container endpoint + ID *string `json:"id,omitempty"` + // ConnectionString - The connection string of the storage account. + ConnectionString *string `json:"connectionString,omitempty"` + // EndpointURI - The url of the storage endpoint. It must include the protocol https:// + EndpointURI *string `json:"endpointUri,omitempty"` + // AuthenticationType - Method used to authenticate against the storage endpoint. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of routing storage endpoint. + Identity *ManagedIdentity `json:"identity,omitempty"` + // Name - The name that identifies this endpoint. The name can only include alphanumeric characters, periods, underscores, hyphens and has a maximum length of 64 characters. The following names are reserved: events, fileNotifications, $default. Endpoint names must be unique across endpoint types. + Name *string `json:"name,omitempty"` + // SubscriptionID - The subscription identifier of the storage account. + SubscriptionID *string `json:"subscriptionId,omitempty"` + // ResourceGroup - The name of the resource group of the storage account. + ResourceGroup *string `json:"resourceGroup,omitempty"` + // ContainerName - The name of storage container in the storage account. + ContainerName *string `json:"containerName,omitempty"` + // FileNameFormat - File name format for the blob. Default format is {iothub}/{partition}/{YYYY}/{MM}/{DD}/{HH}/{mm}. All parameters are mandatory but can be reordered. + FileNameFormat *string `json:"fileNameFormat,omitempty"` + // BatchFrequencyInSeconds - Time interval at which blobs are written to storage. Value should be between 60 and 720 seconds. Default value is 300 seconds. + BatchFrequencyInSeconds *int32 `json:"batchFrequencyInSeconds,omitempty"` + // MaxChunkSizeInBytes - Maximum number of bytes for each blob written to storage. Value should be between 10485760(10MB) and 524288000(500MB). Default value is 314572800(300MB). + MaxChunkSizeInBytes *int32 `json:"maxChunkSizeInBytes,omitempty"` + // Encoding - Encoding that is used to serialize messages to blobs. Supported values are 'avro', 'avrodeflate', and 'JSON'. Default value is 'avro'. Possible values include: 'EncodingAvro', 'EncodingAvroDeflate', 'EncodingJSON' + Encoding Encoding `json:"encoding,omitempty"` +} + +// RoutingTwin twin reference input parameter. This is an optional parameter +type RoutingTwin struct { + // Tags - Twin Tags + Tags interface{} `json:"tags,omitempty"` + Properties *RoutingTwinProperties `json:"properties,omitempty"` +} + +// RoutingTwinProperties ... +type RoutingTwinProperties struct { + // Desired - Twin desired properties + Desired interface{} `json:"desired,omitempty"` + // Reported - Twin desired properties + Reported interface{} `json:"reported,omitempty"` +} + +// SetObject ... +type SetObject struct { + autorest.Response `json:"-"` + Value interface{} `json:"value,omitempty"` +} + +// SharedAccessSignatureAuthorizationRule the properties of an IoT hub shared access policy. +type SharedAccessSignatureAuthorizationRule struct { + autorest.Response `json:"-"` + // KeyName - The name of the shared access policy. + KeyName *string `json:"keyName,omitempty"` + // PrimaryKey - The primary key. + PrimaryKey *string `json:"primaryKey,omitempty"` + // SecondaryKey - The secondary key. + SecondaryKey *string `json:"secondaryKey,omitempty"` + // Rights - The permissions assigned to the shared access policy. Possible values include: 'AccessRightsRegistryRead', 'AccessRightsRegistryWrite', 'AccessRightsServiceConnect', 'AccessRightsDeviceConnect', 'AccessRightsRegistryReadRegistryWrite', 'AccessRightsRegistryReadServiceConnect', 'AccessRightsRegistryReadDeviceConnect', 'AccessRightsRegistryWriteServiceConnect', 'AccessRightsRegistryWriteDeviceConnect', 'AccessRightsServiceConnectDeviceConnect', 'AccessRightsRegistryReadRegistryWriteServiceConnect', 'AccessRightsRegistryReadRegistryWriteDeviceConnect', 'AccessRightsRegistryReadServiceConnectDeviceConnect', 'AccessRightsRegistryWriteServiceConnectDeviceConnect', 'AccessRightsRegistryReadRegistryWriteServiceConnectDeviceConnect' + Rights AccessRights `json:"rights,omitempty"` +} + +// SharedAccessSignatureAuthorizationRuleListResult the list of shared access policies with a next link. +type SharedAccessSignatureAuthorizationRuleListResult struct { + autorest.Response `json:"-"` + // Value - The list of shared access policies. + Value *[]SharedAccessSignatureAuthorizationRule `json:"value,omitempty"` + // NextLink - READ-ONLY; The next link. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for SharedAccessSignatureAuthorizationRuleListResult. +func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sasarlr.Value != nil { + objectMap["value"] = sasarlr.Value + } + return json.Marshal(objectMap) +} + +// SharedAccessSignatureAuthorizationRuleListResultIterator provides access to a complete listing of +// SharedAccessSignatureAuthorizationRule values. +type SharedAccessSignatureAuthorizationRuleListResultIterator struct { + i int + page SharedAccessSignatureAuthorizationRuleListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *SharedAccessSignatureAuthorizationRuleListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Response() SharedAccessSignatureAuthorizationRuleListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter SharedAccessSignatureAuthorizationRuleListResultIterator) Value() SharedAccessSignatureAuthorizationRule { + if !iter.page.NotDone() { + return SharedAccessSignatureAuthorizationRule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultIterator type. +func NewSharedAccessSignatureAuthorizationRuleListResultIterator(page SharedAccessSignatureAuthorizationRuleListResultPage) SharedAccessSignatureAuthorizationRuleListResultIterator { + return SharedAccessSignatureAuthorizationRuleListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) IsEmpty() bool { + return sasarlr.Value == nil || len(*sasarlr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) hasNextLink() bool { + return sasarlr.NextLink != nil && len(*sasarlr.NextLink) != 0 +} + +// sharedAccessSignatureAuthorizationRuleListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (sasarlr SharedAccessSignatureAuthorizationRuleListResult) sharedAccessSignatureAuthorizationRuleListResultPreparer(ctx context.Context) (*http.Request, error) { + if !sasarlr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(sasarlr.NextLink))) +} + +// SharedAccessSignatureAuthorizationRuleListResultPage contains a page of +// SharedAccessSignatureAuthorizationRule values. +type SharedAccessSignatureAuthorizationRuleListResultPage struct { + fn func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error) + sasarlr SharedAccessSignatureAuthorizationRuleListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *SharedAccessSignatureAuthorizationRuleListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SharedAccessSignatureAuthorizationRuleListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.sasarlr) + if err != nil { + return err + } + page.sasarlr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *SharedAccessSignatureAuthorizationRuleListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page SharedAccessSignatureAuthorizationRuleListResultPage) NotDone() bool { + return !page.sasarlr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page SharedAccessSignatureAuthorizationRuleListResultPage) Response() SharedAccessSignatureAuthorizationRuleListResult { + return page.sasarlr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page SharedAccessSignatureAuthorizationRuleListResultPage) Values() []SharedAccessSignatureAuthorizationRule { + if page.sasarlr.IsEmpty() { + return nil + } + return *page.sasarlr.Value +} + +// Creates a new instance of the SharedAccessSignatureAuthorizationRuleListResultPage type. +func NewSharedAccessSignatureAuthorizationRuleListResultPage(cur SharedAccessSignatureAuthorizationRuleListResult, getNextPage func(context.Context, SharedAccessSignatureAuthorizationRuleListResult) (SharedAccessSignatureAuthorizationRuleListResult, error)) SharedAccessSignatureAuthorizationRuleListResultPage { + return SharedAccessSignatureAuthorizationRuleListResultPage{ + fn: getNextPage, + sasarlr: cur, + } +} + +// StorageEndpointProperties the properties of the Azure Storage endpoint for file upload. +type StorageEndpointProperties struct { + // SasTTLAsIso8601 - The period of time for which the SAS URI generated by IoT Hub for file upload is valid. See: https://docs.microsoft.com/azure/iot-hub/iot-hub-devguide-file-upload#file-upload-notification-configuration-options. + SasTTLAsIso8601 *string `json:"sasTtlAsIso8601,omitempty"` + // ConnectionString - The connection string for the Azure Storage account to which files are uploaded. + ConnectionString *string `json:"connectionString,omitempty"` + // ContainerName - The name of the root container where you upload files. The container need not exist but should be creatable using the connectionString specified. + ContainerName *string `json:"containerName,omitempty"` + // AuthenticationType - Specifies authentication type being used for connecting to the storage account. Possible values include: 'AuthenticationTypeKeyBased', 'AuthenticationTypeIdentityBased' + AuthenticationType AuthenticationType `json:"authenticationType,omitempty"` + // Identity - Managed identity properties of storage endpoint for file upload. + Identity *ManagedIdentity `json:"identity,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TagsResource a container holding only the Tags for a resource, allowing the user to update the tags on +// an IoT Hub instance. +type TagsResource struct { + // Tags - Resource tags + Tags map[string]*string `json:"tags"` +} + +// MarshalJSON is the custom marshaler for TagsResource. +func (tr TagsResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + return json.Marshal(objectMap) +} + +// TestAllRoutesInput input for testing all routes +type TestAllRoutesInput struct { + // RoutingSource - Routing source. Possible values include: 'RoutingSourceInvalid', 'RoutingSourceDeviceMessages', 'RoutingSourceTwinChangeEvents', 'RoutingSourceDeviceLifecycleEvents', 'RoutingSourceDeviceJobLifecycleEvents', 'RoutingSourceDeviceConnectionStateEvents' + RoutingSource RoutingSource `json:"routingSource,omitempty"` + // Message - Routing message + Message *RoutingMessage `json:"message,omitempty"` + // Twin - Routing Twin Reference + Twin *RoutingTwin `json:"twin,omitempty"` +} + +// TestAllRoutesResult result of testing all routes +type TestAllRoutesResult struct { + autorest.Response `json:"-"` + // Routes - JSON-serialized array of matched routes + Routes *[]MatchedRoute `json:"routes,omitempty"` +} + +// TestRouteInput input for testing route +type TestRouteInput struct { + // Message - Routing message + Message *RoutingMessage `json:"message,omitempty"` + // Route - Route properties + Route *RouteProperties `json:"route,omitempty"` + // Twin - Routing Twin Reference + Twin *RoutingTwin `json:"twin,omitempty"` +} + +// TestRouteResult result of testing one route +type TestRouteResult struct { + autorest.Response `json:"-"` + // Result - Result of testing route. Possible values include: 'TestResultStatusUndefined', 'TestResultStatusFalse', 'TestResultStatusTrue' + Result TestResultStatus `json:"result,omitempty"` + // Details - Detailed result of testing route + Details *TestRouteResultDetails `json:"details,omitempty"` +} + +// TestRouteResultDetails detailed result of testing a route +type TestRouteResultDetails struct { + // CompilationErrors - JSON-serialized list of route compilation errors + CompilationErrors *[]RouteCompilationError `json:"compilationErrors,omitempty"` +} + +// UserSubscriptionQuota user subscription quota response +type UserSubscriptionQuota struct { + // ID - IotHub type id + ID *string `json:"id,omitempty"` + // Type - Response type + Type *string `json:"type,omitempty"` + // Unit - Unit of IotHub type + Unit *string `json:"unit,omitempty"` + // CurrentValue - Current number of IotHub type + CurrentValue *int32 `json:"currentValue,omitempty"` + // Limit - Numerical limit on IotHub type + Limit *int32 `json:"limit,omitempty"` + // Name - IotHub type + Name *Name `json:"name,omitempty"` +} + +// UserSubscriptionQuotaListResult json-serialized array of User subscription quota response +type UserSubscriptionQuotaListResult struct { + autorest.Response `json:"-"` + Value *[]UserSubscriptionQuota `json:"value,omitempty"` + // NextLink - READ-ONLY + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserSubscriptionQuotaListResult. +func (usqlr UserSubscriptionQuotaListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if usqlr.Value != nil { + objectMap["value"] = usqlr.Value + } + return json.Marshal(objectMap) +} diff --git a/services/iothub/mgmt/2021-07-02/devices/operations.go b/services/iothub/mgmt/2021-07-02/devices/operations.go new file mode 100644 index 000000000000..721c973e61b4 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/operations.go @@ -0,0 +1,140 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the use this API to manage the IoT hubs in your Azure subscription. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List lists all of the available IoT Hub REST API operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.Devices/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "devices.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "devices.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/privateendpointconnections.go b/services/iothub/mgmt/2021-07-02/devices/privateendpointconnections.go new file mode 100644 index 000000000000..d95c02d18c61 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/privateendpointconnections.go @@ -0,0 +1,364 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateEndpointConnectionsClient is the use this API to manage the IoT hubs in your Azure subscription. +type PrivateEndpointConnectionsClient struct { + BaseClient +} + +// NewPrivateEndpointConnectionsClient creates an instance of the PrivateEndpointConnectionsClient client. +func NewPrivateEndpointConnectionsClient(subscriptionID string) PrivateEndpointConnectionsClient { + return NewPrivateEndpointConnectionsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateEndpointConnectionsClientWithBaseURI creates an instance of the PrivateEndpointConnectionsClient client +// using a custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign +// clouds, Azure stack). +func NewPrivateEndpointConnectionsClientWithBaseURI(baseURI string, subscriptionID string) PrivateEndpointConnectionsClient { + return PrivateEndpointConnectionsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Delete delete private endpoint connection with the specified name +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// privateEndpointConnectionName - the name of the private endpoint connection +func (client PrivateEndpointConnectionsClient) Delete(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnectionsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.DeletePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client PrivateEndpointConnectionsClient) DeletePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) DeleteSender(req *http.Request) (future PrivateEndpointConnectionsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) DeleteResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get get private endpoint connection properties +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// privateEndpointConnectionName - the name of the private endpoint connection +func (client PrivateEndpointConnectionsClient) Get(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (result PrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateEndpointConnectionsClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) GetResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list private endpoint connection properties +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client PrivateEndpointConnectionsClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result ListPrivateEndpointConnection, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateEndpointConnectionsClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) ListResponder(resp *http.Response) (result ListPrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result.Value), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Update update the status of a private endpoint connection with the specified name +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// privateEndpointConnectionName - the name of the private endpoint connection +// privateEndpointConnection - the private endpoint connection with updated properties +func (client PrivateEndpointConnectionsClient) Update(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (result PrivateEndpointConnectionsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateEndpointConnectionsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: privateEndpointConnection, + Constraints: []validation.Constraint{{Target: "privateEndpointConnection.Properties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "privateEndpointConnection.Properties.PrivateLinkServiceConnectionState", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "privateEndpointConnection.Properties.PrivateLinkServiceConnectionState.Description", Name: validation.Null, Rule: true, Chain: nil}}}, + }}}}}); err != nil { + return result, validation.NewError("devices.PrivateEndpointConnectionsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, resourceGroupName, resourceName, privateEndpointConnectionName, privateEndpointConnection) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateEndpointConnectionsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client PrivateEndpointConnectionsClient) UpdatePreparer(ctx context.Context, resourceGroupName string, resourceName string, privateEndpointConnectionName string, privateEndpointConnection PrivateEndpointConnection) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "privateEndpointConnectionName": autorest.Encode("path", privateEndpointConnectionName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + privateEndpointConnection.ID = nil + privateEndpointConnection.Name = nil + privateEndpointConnection.Type = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateEndpointConnections/{privateEndpointConnectionName}", pathParameters), + autorest.WithJSON(privateEndpointConnection), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateEndpointConnectionsClient) UpdateSender(req *http.Request) (future PrivateEndpointConnectionsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client PrivateEndpointConnectionsClient) UpdateResponder(resp *http.Response) (result PrivateEndpointConnection, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/privatelinkresources.go b/services/iothub/mgmt/2021-07-02/devices/privatelinkresources.go new file mode 100644 index 000000000000..549842440b4e --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/privatelinkresources.go @@ -0,0 +1,186 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// PrivateLinkResourcesClient is the use this API to manage the IoT hubs in your Azure subscription. +type PrivateLinkResourcesClient struct { + BaseClient +} + +// NewPrivateLinkResourcesClient creates an instance of the PrivateLinkResourcesClient client. +func NewPrivateLinkResourcesClient(subscriptionID string) PrivateLinkResourcesClient { + return NewPrivateLinkResourcesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewPrivateLinkResourcesClientWithBaseURI creates an instance of the PrivateLinkResourcesClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewPrivateLinkResourcesClientWithBaseURI(baseURI string, subscriptionID string) PrivateLinkResourcesClient { + return PrivateLinkResourcesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get get the specified private link resource for the given IotHub +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +// groupID - the name of the private link resource +func (client PrivateLinkResourcesClient) Get(ctx context.Context, resourceGroupName string, resourceName string, groupID string) (result GroupIDInformation, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetPreparer(ctx, resourceGroupName, resourceName, groupID) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateLinkResourcesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.PrivateLinkResourcesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateLinkResourcesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client PrivateLinkResourcesClient) GetPreparer(ctx context.Context, resourceGroupName string, resourceName string, groupID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "groupId": autorest.Encode("path", groupID), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources/{groupId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) GetResponder(resp *http.Response) (result GroupIDInformation, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// List list private link resources for the given IotHub +// Parameters: +// resourceGroupName - the name of the resource group that contains the IoT hub. +// resourceName - the name of the IoT hub. +func (client PrivateLinkResourcesClient) List(ctx context.Context, resourceGroupName string, resourceName string) (result PrivateLinkResources, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PrivateLinkResourcesClient.List") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.ListPreparer(ctx, resourceGroupName, resourceName) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateLinkResourcesClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.PrivateLinkResourcesClient", "List", resp, "Failure sending request") + return + } + + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.PrivateLinkResourcesClient", "List", resp, "Failure responding to request") + return + } + + return +} + +// ListPreparer prepares the List request. +func (client PrivateLinkResourcesClient) ListPreparer(ctx context.Context, resourceGroupName string, resourceName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "resourceName": autorest.Encode("path", resourceName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Devices/iotHubs/{resourceName}/privateLinkResources", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client PrivateLinkResourcesClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client PrivateLinkResourcesClient) ListResponder(resp *http.Response) (result PrivateLinkResources, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/resourceprovidercommon.go b/services/iothub/mgmt/2021-07-02/devices/resourceprovidercommon.go new file mode 100644 index 000000000000..974d4ab0cb7a --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/resourceprovidercommon.go @@ -0,0 +1,103 @@ +package devices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ResourceProviderCommonClient is the use this API to manage the IoT hubs in your Azure subscription. +type ResourceProviderCommonClient struct { + BaseClient +} + +// NewResourceProviderCommonClient creates an instance of the ResourceProviderCommonClient client. +func NewResourceProviderCommonClient(subscriptionID string) ResourceProviderCommonClient { + return NewResourceProviderCommonClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewResourceProviderCommonClientWithBaseURI creates an instance of the ResourceProviderCommonClient client using a +// custom endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, +// Azure stack). +func NewResourceProviderCommonClientWithBaseURI(baseURI string, subscriptionID string) ResourceProviderCommonClient { + return ResourceProviderCommonClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// GetSubscriptionQuota get the number of free and paid iot hubs in the subscription +func (client ResourceProviderCommonClient) GetSubscriptionQuota(ctx context.Context) (result UserSubscriptionQuotaListResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ResourceProviderCommonClient.GetSubscriptionQuota") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + req, err := client.GetSubscriptionQuotaPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.ResourceProviderCommonClient", "GetSubscriptionQuota", nil, "Failure preparing request") + return + } + + resp, err := client.GetSubscriptionQuotaSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "devices.ResourceProviderCommonClient", "GetSubscriptionQuota", resp, "Failure sending request") + return + } + + result, err = client.GetSubscriptionQuotaResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "devices.ResourceProviderCommonClient", "GetSubscriptionQuota", resp, "Failure responding to request") + return + } + + return +} + +// GetSubscriptionQuotaPreparer prepares the GetSubscriptionQuota request. +func (client ResourceProviderCommonClient) GetSubscriptionQuotaPreparer(ctx context.Context) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-07-02" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.Devices/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSubscriptionQuotaSender sends the GetSubscriptionQuota request. The method will close the +// http.Response Body if it receives an error. +func (client ResourceProviderCommonClient) GetSubscriptionQuotaSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetSubscriptionQuotaResponder handles the response to the GetSubscriptionQuota request. The method always +// closes the http.Response Body. +func (client ResourceProviderCommonClient) GetSubscriptionQuotaResponder(resp *http.Response) (result UserSubscriptionQuotaListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/iothub/mgmt/2021-07-02/devices/version.go b/services/iothub/mgmt/2021-07-02/devices/version.go new file mode 100644 index 000000000000..2104f803f7a9 --- /dev/null +++ b/services/iothub/mgmt/2021-07-02/devices/version.go @@ -0,0 +1,19 @@ +package devices + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " devices/2021-07-02" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} From fce369fd459d839704c04fb3fef82a04409b4e59 Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:23:28 +0800 Subject: [PATCH 6/8] Generated from specification/labservices/resource-manager/readme.md tag package-preview-2021-11 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- .../mgmt/labservices/labservicesapi/models.go | 23 + .../labservices/mgmt/labservices/models.go | 545 +++ .../labservices/CHANGELOG.md | 2 + .../2021-11-15-preview/labservices/_meta.json | 11 + .../2021-11-15-preview/labservices/client.go | 41 + .../2021-11-15-preview/labservices/enums.go | 440 ++ .../2021-11-15-preview/labservices/images.go | 461 ++ .../labservices/labplans.go | 749 +++ .../2021-11-15-preview/labservices/labs.go | 836 ++++ .../labservices/labservicesapi/interfaces.go | 124 + .../2021-11-15-preview/labservices/models.go | 4068 +++++++++++++++++ .../labservices/operationresults.go | 117 + .../labservices/operations.go | 140 + .../labservices/schedules.go | 562 +++ .../2021-11-15-preview/labservices/skus.go | 156 + .../2021-11-15-preview/labservices/usages.go | 162 + .../2021-11-15-preview/labservices/users.go | 665 +++ .../2021-11-15-preview/labservices/version.go | 19 + .../labservices/virtualmachines.go | 760 +++ 19 files changed, 9881 insertions(+) create mode 100644 profiles/preview/preview/labservices/mgmt/labservices/labservicesapi/models.go create mode 100644 profiles/preview/preview/labservices/mgmt/labservices/models.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/CHANGELOG.md create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/_meta.json create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/client.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/enums.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/images.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/labplans.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/labs.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/labservicesapi/interfaces.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/models.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/operationresults.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/operations.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/schedules.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/skus.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/usages.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/users.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/version.go create mode 100644 services/preview/labservices/mgmt/2021-11-15-preview/labservices/virtualmachines.go diff --git a/profiles/preview/preview/labservices/mgmt/labservices/labservicesapi/models.go b/profiles/preview/preview/labservices/mgmt/labservices/labservicesapi/models.go new file mode 100644 index 000000000000..e4c2bc866432 --- /dev/null +++ b/profiles/preview/preview/labservices/mgmt/labservices/labservicesapi/models.go @@ -0,0 +1,23 @@ +//go:build go1.9 +// +build go1.9 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder + +package labservicesapi + +import original "github.com/Azure/azure-sdk-for-go/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labservicesapi" + +type ImagesClientAPI = original.ImagesClientAPI +type LabPlansClientAPI = original.LabPlansClientAPI +type LabsClientAPI = original.LabsClientAPI +type OperationResultsClientAPI = original.OperationResultsClientAPI +type OperationsClientAPI = original.OperationsClientAPI +type SchedulesClientAPI = original.SchedulesClientAPI +type SkusClientAPI = original.SkusClientAPI +type UsagesClientAPI = original.UsagesClientAPI +type UsersClientAPI = original.UsersClientAPI +type VirtualMachinesClientAPI = original.VirtualMachinesClientAPI diff --git a/profiles/preview/preview/labservices/mgmt/labservices/models.go b/profiles/preview/preview/labservices/mgmt/labservices/models.go new file mode 100644 index 000000000000..e1bf1161df7d --- /dev/null +++ b/profiles/preview/preview/labservices/mgmt/labservices/models.go @@ -0,0 +1,545 @@ +//go:build go1.9 +// +build go1.9 + +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +// This code was auto-generated by: +// github.com/Azure/azure-sdk-for-go/eng/tools/profileBuilder + +package labservices + +import ( + "context" + + original "github.com/Azure/azure-sdk-for-go/services/preview/labservices/mgmt/2021-11-15-preview/labservices" +) + +const ( + DefaultBaseURI = original.DefaultBaseURI +) + +type ActionType = original.ActionType + +const ( + ActionTypeInternal ActionType = original.ActionTypeInternal +) + +type ConnectionType = original.ConnectionType + +const ( + ConnectionTypeNone ConnectionType = original.ConnectionTypeNone + ConnectionTypePrivate ConnectionType = original.ConnectionTypePrivate + ConnectionTypePublic ConnectionType = original.ConnectionTypePublic +) + +type CreateOption = original.CreateOption + +const ( + CreateOptionImage CreateOption = original.CreateOptionImage + CreateOptionTemplateVM CreateOption = original.CreateOptionTemplateVM +) + +type CreatedByType = original.CreatedByType + +const ( + CreatedByTypeApplication CreatedByType = original.CreatedByTypeApplication + CreatedByTypeKey CreatedByType = original.CreatedByTypeKey + CreatedByTypeManagedIdentity CreatedByType = original.CreatedByTypeManagedIdentity + CreatedByTypeUser CreatedByType = original.CreatedByTypeUser +) + +type EnableState = original.EnableState + +const ( + EnableStateDisabled EnableState = original.EnableStateDisabled + EnableStateEnabled EnableState = original.EnableStateEnabled +) + +type InvitationState = original.InvitationState + +const ( + InvitationStateFailed InvitationState = original.InvitationStateFailed + InvitationStateNotSent InvitationState = original.InvitationStateNotSent + InvitationStateSending InvitationState = original.InvitationStateSending + InvitationStateSent InvitationState = original.InvitationStateSent +) + +type LabState = original.LabState + +const ( + LabStateDraft LabState = original.LabStateDraft + LabStatePublished LabState = original.LabStatePublished + LabStatePublishing LabState = original.LabStatePublishing + LabStateScaling LabState = original.LabStateScaling + LabStateSyncing LabState = original.LabStateSyncing +) + +type OperationStatus = original.OperationStatus + +const ( + OperationStatusCanceled OperationStatus = original.OperationStatusCanceled + OperationStatusFailed OperationStatus = original.OperationStatusFailed + OperationStatusInProgress OperationStatus = original.OperationStatusInProgress + OperationStatusNotStarted OperationStatus = original.OperationStatusNotStarted + OperationStatusSucceeded OperationStatus = original.OperationStatusSucceeded +) + +type Origin = original.Origin + +const ( + OriginSystem Origin = original.OriginSystem + OriginUser Origin = original.OriginUser + OriginUsersystem Origin = original.OriginUsersystem +) + +type OsState = original.OsState + +const ( + OsStateGeneralized OsState = original.OsStateGeneralized + OsStateSpecialized OsState = original.OsStateSpecialized +) + +type OsType = original.OsType + +const ( + OsTypeLinux OsType = original.OsTypeLinux + OsTypeWindows OsType = original.OsTypeWindows +) + +type ProvisioningState = original.ProvisioningState + +const ( + ProvisioningStateCreating ProvisioningState = original.ProvisioningStateCreating + ProvisioningStateDeleting ProvisioningState = original.ProvisioningStateDeleting + ProvisioningStateFailed ProvisioningState = original.ProvisioningStateFailed + ProvisioningStateLocked ProvisioningState = original.ProvisioningStateLocked + ProvisioningStateSucceeded ProvisioningState = original.ProvisioningStateSucceeded + ProvisioningStateUpdating ProvisioningState = original.ProvisioningStateUpdating +) + +type RecurrenceFrequency = original.RecurrenceFrequency + +const ( + RecurrenceFrequencyDaily RecurrenceFrequency = original.RecurrenceFrequencyDaily + RecurrenceFrequencyWeekly RecurrenceFrequency = original.RecurrenceFrequencyWeekly +) + +type RegistrationState = original.RegistrationState + +const ( + RegistrationStateNotRegistered RegistrationState = original.RegistrationStateNotRegistered + RegistrationStateRegistered RegistrationState = original.RegistrationStateRegistered +) + +type ResourceIdentityType = original.ResourceIdentityType + +const ( + ResourceIdentityTypeSystemAssigned ResourceIdentityType = original.ResourceIdentityTypeSystemAssigned +) + +type RestrictionReasonCode = original.RestrictionReasonCode + +const ( + RestrictionReasonCodeNotAvailableForSubscription RestrictionReasonCode = original.RestrictionReasonCodeNotAvailableForSubscription + RestrictionReasonCodeQuotaID RestrictionReasonCode = original.RestrictionReasonCodeQuotaID +) + +type RestrictionType = original.RestrictionType + +const ( + RestrictionTypeLocation RestrictionType = original.RestrictionTypeLocation +) + +type ScaleType = original.ScaleType + +const ( + ScaleTypeAutomatic ScaleType = original.ScaleTypeAutomatic + ScaleTypeManual ScaleType = original.ScaleTypeManual + ScaleTypeNone ScaleType = original.ScaleTypeNone +) + +type ShutdownOnIdleMode = original.ShutdownOnIdleMode + +const ( + ShutdownOnIdleModeLowUsage ShutdownOnIdleMode = original.ShutdownOnIdleModeLowUsage + ShutdownOnIdleModeNone ShutdownOnIdleMode = original.ShutdownOnIdleModeNone + ShutdownOnIdleModeUserAbsence ShutdownOnIdleMode = original.ShutdownOnIdleModeUserAbsence +) + +type SkuTier = original.SkuTier + +const ( + SkuTierBasic SkuTier = original.SkuTierBasic + SkuTierFree SkuTier = original.SkuTierFree + SkuTierPremium SkuTier = original.SkuTierPremium + SkuTierStandard SkuTier = original.SkuTierStandard +) + +type SkuTierEnum = original.SkuTierEnum + +const ( + SkuTierEnumPremium SkuTierEnum = original.SkuTierEnumPremium + SkuTierEnumStandard SkuTierEnum = original.SkuTierEnumStandard +) + +type UsageUnit = original.UsageUnit + +const ( + UsageUnitCount UsageUnit = original.UsageUnitCount +) + +type VirtualMachineState = original.VirtualMachineState + +const ( + VirtualMachineStateRedeploying VirtualMachineState = original.VirtualMachineStateRedeploying + VirtualMachineStateReimaging VirtualMachineState = original.VirtualMachineStateReimaging + VirtualMachineStateResettingPassword VirtualMachineState = original.VirtualMachineStateResettingPassword + VirtualMachineStateRunning VirtualMachineState = original.VirtualMachineStateRunning + VirtualMachineStateStarting VirtualMachineState = original.VirtualMachineStateStarting + VirtualMachineStateStopped VirtualMachineState = original.VirtualMachineStateStopped + VirtualMachineStateStopping VirtualMachineState = original.VirtualMachineStateStopping +) + +type VirtualMachineType = original.VirtualMachineType + +const ( + VirtualMachineTypeTemplate VirtualMachineType = original.VirtualMachineTypeTemplate + VirtualMachineTypeUser VirtualMachineType = original.VirtualMachineTypeUser +) + +type WeekDay = original.WeekDay + +const ( + WeekDayFriday WeekDay = original.WeekDayFriday + WeekDayMonday WeekDay = original.WeekDayMonday + WeekDaySaturday WeekDay = original.WeekDaySaturday + WeekDaySunday WeekDay = original.WeekDaySunday + WeekDayThursday WeekDay = original.WeekDayThursday + WeekDayTuesday WeekDay = original.WeekDayTuesday + WeekDayWednesday WeekDay = original.WeekDayWednesday +) + +type AutoShutdownProfile = original.AutoShutdownProfile +type AzureEntityResource = original.AzureEntityResource +type BaseClient = original.BaseClient +type ConnectionProfile = original.ConnectionProfile +type Credentials = original.Credentials +type ErrorAdditionalInfo = original.ErrorAdditionalInfo +type ErrorDetail = original.ErrorDetail +type ErrorResponse = original.ErrorResponse +type Identity = original.Identity +type Image = original.Image +type ImageProperties = original.ImageProperties +type ImageReference = original.ImageReference +type ImageUpdate = original.ImageUpdate +type ImageUpdateProperties = original.ImageUpdateProperties +type ImagesClient = original.ImagesClient +type InviteBody = original.InviteBody +type Lab = original.Lab +type LabNetworkProfile = original.LabNetworkProfile +type LabPlan = original.LabPlan +type LabPlanNetworkProfile = original.LabPlanNetworkProfile +type LabPlanProperties = original.LabPlanProperties +type LabPlanUpdate = original.LabPlanUpdate +type LabPlanUpdateProperties = original.LabPlanUpdateProperties +type LabPlansClient = original.LabPlansClient +type LabPlansCreateOrUpdateFuture = original.LabPlansCreateOrUpdateFuture +type LabPlansDeleteFuture = original.LabPlansDeleteFuture +type LabPlansSaveImageFuture = original.LabPlansSaveImageFuture +type LabPlansUpdateFuture = original.LabPlansUpdateFuture +type LabProperties = original.LabProperties +type LabUpdate = original.LabUpdate +type LabUpdateProperties = original.LabUpdateProperties +type LabsClient = original.LabsClient +type LabsCreateOrUpdateFuture = original.LabsCreateOrUpdateFuture +type LabsDeleteFuture = original.LabsDeleteFuture +type LabsPublishFuture = original.LabsPublishFuture +type LabsSyncGroupFuture = original.LabsSyncGroupFuture +type LabsUpdateFuture = original.LabsUpdateFuture +type ListUsagesResult = original.ListUsagesResult +type ListUsagesResultIterator = original.ListUsagesResultIterator +type ListUsagesResultPage = original.ListUsagesResultPage +type Operation = original.Operation +type OperationDisplay = original.OperationDisplay +type OperationListResult = original.OperationListResult +type OperationListResultIterator = original.OperationListResultIterator +type OperationListResultPage = original.OperationListResultPage +type OperationResult = original.OperationResult +type OperationResultsClient = original.OperationResultsClient +type OperationsClient = original.OperationsClient +type PagedImages = original.PagedImages +type PagedImagesIterator = original.PagedImagesIterator +type PagedImagesPage = original.PagedImagesPage +type PagedLabPlans = original.PagedLabPlans +type PagedLabPlansIterator = original.PagedLabPlansIterator +type PagedLabPlansPage = original.PagedLabPlansPage +type PagedLabServicesSkus = original.PagedLabServicesSkus +type PagedLabServicesSkusIterator = original.PagedLabServicesSkusIterator +type PagedLabServicesSkusPage = original.PagedLabServicesSkusPage +type PagedLabs = original.PagedLabs +type PagedLabsIterator = original.PagedLabsIterator +type PagedLabsPage = original.PagedLabsPage +type PagedSchedules = original.PagedSchedules +type PagedSchedulesIterator = original.PagedSchedulesIterator +type PagedSchedulesPage = original.PagedSchedulesPage +type PagedUsers = original.PagedUsers +type PagedUsersIterator = original.PagedUsersIterator +type PagedUsersPage = original.PagedUsersPage +type PagedVirtualMachines = original.PagedVirtualMachines +type PagedVirtualMachinesIterator = original.PagedVirtualMachinesIterator +type PagedVirtualMachinesPage = original.PagedVirtualMachinesPage +type Plan = original.Plan +type ProxyResource = original.ProxyResource +type RecurrencePattern = original.RecurrencePattern +type ResetPasswordBody = original.ResetPasswordBody +type Resource = original.Resource +type ResourceModelWithAllowedPropertySet = original.ResourceModelWithAllowedPropertySet +type ResourceModelWithAllowedPropertySetIdentity = original.ResourceModelWithAllowedPropertySetIdentity +type ResourceModelWithAllowedPropertySetPlan = original.ResourceModelWithAllowedPropertySetPlan +type ResourceModelWithAllowedPropertySetSku = original.ResourceModelWithAllowedPropertySetSku +type RosterProfile = original.RosterProfile +type SaveImageBody = original.SaveImageBody +type Schedule = original.Schedule +type ScheduleProperties = original.ScheduleProperties +type ScheduleUpdate = original.ScheduleUpdate +type ScheduleUpdateProperties = original.ScheduleUpdateProperties +type SchedulesClient = original.SchedulesClient +type SchedulesDeleteFuture = original.SchedulesDeleteFuture +type SecurityProfile = original.SecurityProfile +type Sku = original.Sku +type SkuCapabilities = original.SkuCapabilities +type SkuCapacity = original.SkuCapacity +type SkuCost = original.SkuCost +type SkuRestrictions = original.SkuRestrictions +type SkuType = original.SkuType +type SkusClient = original.SkusClient +type SupportInfo = original.SupportInfo +type SystemData = original.SystemData +type TrackedResource = original.TrackedResource +type TrackedResourceUpdate = original.TrackedResourceUpdate +type Usage = original.Usage +type UsageName = original.UsageName +type UsagesClient = original.UsagesClient +type User = original.User +type UserProperties = original.UserProperties +type UserUpdate = original.UserUpdate +type UserUpdateProperties = original.UserUpdateProperties +type UsersClient = original.UsersClient +type UsersCreateOrUpdateFuture = original.UsersCreateOrUpdateFuture +type UsersDeleteFuture = original.UsersDeleteFuture +type UsersInviteFuture = original.UsersInviteFuture +type UsersUpdateFuture = original.UsersUpdateFuture +type VirtualMachine = original.VirtualMachine +type VirtualMachineAdditionalCapabilities = original.VirtualMachineAdditionalCapabilities +type VirtualMachineConnectionProfile = original.VirtualMachineConnectionProfile +type VirtualMachineProfile = original.VirtualMachineProfile +type VirtualMachineProperties = original.VirtualMachineProperties +type VirtualMachinesClient = original.VirtualMachinesClient +type VirtualMachinesRedeployFuture = original.VirtualMachinesRedeployFuture +type VirtualMachinesReimageFuture = original.VirtualMachinesReimageFuture +type VirtualMachinesResetPasswordFuture = original.VirtualMachinesResetPasswordFuture +type VirtualMachinesStartFuture = original.VirtualMachinesStartFuture +type VirtualMachinesStopFuture = original.VirtualMachinesStopFuture + +func New(subscriptionID string) BaseClient { + return original.New(subscriptionID) +} +func NewImagesClient(subscriptionID string) ImagesClient { + return original.NewImagesClient(subscriptionID) +} +func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { + return original.NewImagesClientWithBaseURI(baseURI, subscriptionID) +} +func NewLabPlansClient(subscriptionID string) LabPlansClient { + return original.NewLabPlansClient(subscriptionID) +} +func NewLabPlansClientWithBaseURI(baseURI string, subscriptionID string) LabPlansClient { + return original.NewLabPlansClientWithBaseURI(baseURI, subscriptionID) +} +func NewLabsClient(subscriptionID string) LabsClient { + return original.NewLabsClient(subscriptionID) +} +func NewLabsClientWithBaseURI(baseURI string, subscriptionID string) LabsClient { + return original.NewLabsClientWithBaseURI(baseURI, subscriptionID) +} +func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { + return original.NewListUsagesResultIterator(page) +} +func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return original.NewListUsagesResultPage(cur, getNextPage) +} +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return original.NewOperationListResultIterator(page) +} +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return original.NewOperationListResultPage(cur, getNextPage) +} +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClient(subscriptionID) +} +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return original.NewOperationResultsClientWithBaseURI(baseURI, subscriptionID) +} +func NewOperationsClient(subscriptionID string) OperationsClient { + return original.NewOperationsClient(subscriptionID) +} +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return original.NewOperationsClientWithBaseURI(baseURI, subscriptionID) +} +func NewPagedImagesIterator(page PagedImagesPage) PagedImagesIterator { + return original.NewPagedImagesIterator(page) +} +func NewPagedImagesPage(cur PagedImages, getNextPage func(context.Context, PagedImages) (PagedImages, error)) PagedImagesPage { + return original.NewPagedImagesPage(cur, getNextPage) +} +func NewPagedLabPlansIterator(page PagedLabPlansPage) PagedLabPlansIterator { + return original.NewPagedLabPlansIterator(page) +} +func NewPagedLabPlansPage(cur PagedLabPlans, getNextPage func(context.Context, PagedLabPlans) (PagedLabPlans, error)) PagedLabPlansPage { + return original.NewPagedLabPlansPage(cur, getNextPage) +} +func NewPagedLabServicesSkusIterator(page PagedLabServicesSkusPage) PagedLabServicesSkusIterator { + return original.NewPagedLabServicesSkusIterator(page) +} +func NewPagedLabServicesSkusPage(cur PagedLabServicesSkus, getNextPage func(context.Context, PagedLabServicesSkus) (PagedLabServicesSkus, error)) PagedLabServicesSkusPage { + return original.NewPagedLabServicesSkusPage(cur, getNextPage) +} +func NewPagedLabsIterator(page PagedLabsPage) PagedLabsIterator { + return original.NewPagedLabsIterator(page) +} +func NewPagedLabsPage(cur PagedLabs, getNextPage func(context.Context, PagedLabs) (PagedLabs, error)) PagedLabsPage { + return original.NewPagedLabsPage(cur, getNextPage) +} +func NewPagedSchedulesIterator(page PagedSchedulesPage) PagedSchedulesIterator { + return original.NewPagedSchedulesIterator(page) +} +func NewPagedSchedulesPage(cur PagedSchedules, getNextPage func(context.Context, PagedSchedules) (PagedSchedules, error)) PagedSchedulesPage { + return original.NewPagedSchedulesPage(cur, getNextPage) +} +func NewPagedUsersIterator(page PagedUsersPage) PagedUsersIterator { + return original.NewPagedUsersIterator(page) +} +func NewPagedUsersPage(cur PagedUsers, getNextPage func(context.Context, PagedUsers) (PagedUsers, error)) PagedUsersPage { + return original.NewPagedUsersPage(cur, getNextPage) +} +func NewPagedVirtualMachinesIterator(page PagedVirtualMachinesPage) PagedVirtualMachinesIterator { + return original.NewPagedVirtualMachinesIterator(page) +} +func NewPagedVirtualMachinesPage(cur PagedVirtualMachines, getNextPage func(context.Context, PagedVirtualMachines) (PagedVirtualMachines, error)) PagedVirtualMachinesPage { + return original.NewPagedVirtualMachinesPage(cur, getNextPage) +} +func NewSchedulesClient(subscriptionID string) SchedulesClient { + return original.NewSchedulesClient(subscriptionID) +} +func NewSchedulesClientWithBaseURI(baseURI string, subscriptionID string) SchedulesClient { + return original.NewSchedulesClientWithBaseURI(baseURI, subscriptionID) +} +func NewSkusClient(subscriptionID string) SkusClient { + return original.NewSkusClient(subscriptionID) +} +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return original.NewSkusClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsagesClient(subscriptionID string) UsagesClient { + return original.NewUsagesClient(subscriptionID) +} +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return original.NewUsagesClientWithBaseURI(baseURI, subscriptionID) +} +func NewUsersClient(subscriptionID string) UsersClient { + return original.NewUsersClient(subscriptionID) +} +func NewUsersClientWithBaseURI(baseURI string, subscriptionID string) UsersClient { + return original.NewUsersClientWithBaseURI(baseURI, subscriptionID) +} +func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { + return original.NewVirtualMachinesClient(subscriptionID) +} +func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { + return original.NewVirtualMachinesClientWithBaseURI(baseURI, subscriptionID) +} +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return original.NewWithBaseURI(baseURI, subscriptionID) +} +func PossibleActionTypeValues() []ActionType { + return original.PossibleActionTypeValues() +} +func PossibleConnectionTypeValues() []ConnectionType { + return original.PossibleConnectionTypeValues() +} +func PossibleCreateOptionValues() []CreateOption { + return original.PossibleCreateOptionValues() +} +func PossibleCreatedByTypeValues() []CreatedByType { + return original.PossibleCreatedByTypeValues() +} +func PossibleEnableStateValues() []EnableState { + return original.PossibleEnableStateValues() +} +func PossibleInvitationStateValues() []InvitationState { + return original.PossibleInvitationStateValues() +} +func PossibleLabStateValues() []LabState { + return original.PossibleLabStateValues() +} +func PossibleOperationStatusValues() []OperationStatus { + return original.PossibleOperationStatusValues() +} +func PossibleOriginValues() []Origin { + return original.PossibleOriginValues() +} +func PossibleOsStateValues() []OsState { + return original.PossibleOsStateValues() +} +func PossibleOsTypeValues() []OsType { + return original.PossibleOsTypeValues() +} +func PossibleProvisioningStateValues() []ProvisioningState { + return original.PossibleProvisioningStateValues() +} +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return original.PossibleRecurrenceFrequencyValues() +} +func PossibleRegistrationStateValues() []RegistrationState { + return original.PossibleRegistrationStateValues() +} +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return original.PossibleResourceIdentityTypeValues() +} +func PossibleRestrictionReasonCodeValues() []RestrictionReasonCode { + return original.PossibleRestrictionReasonCodeValues() +} +func PossibleRestrictionTypeValues() []RestrictionType { + return original.PossibleRestrictionTypeValues() +} +func PossibleScaleTypeValues() []ScaleType { + return original.PossibleScaleTypeValues() +} +func PossibleShutdownOnIdleModeValues() []ShutdownOnIdleMode { + return original.PossibleShutdownOnIdleModeValues() +} +func PossibleSkuTierEnumValues() []SkuTierEnum { + return original.PossibleSkuTierEnumValues() +} +func PossibleSkuTierValues() []SkuTier { + return original.PossibleSkuTierValues() +} +func PossibleUsageUnitValues() []UsageUnit { + return original.PossibleUsageUnitValues() +} +func PossibleVirtualMachineStateValues() []VirtualMachineState { + return original.PossibleVirtualMachineStateValues() +} +func PossibleVirtualMachineTypeValues() []VirtualMachineType { + return original.PossibleVirtualMachineTypeValues() +} +func PossibleWeekDayValues() []WeekDay { + return original.PossibleWeekDayValues() +} +func UserAgent() string { + return original.UserAgent() + " profiles/preview" +} +func Version() string { + return original.Version() +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/CHANGELOG.md b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/CHANGELOG.md new file mode 100644 index 000000000000..52911e4cc5e4 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/CHANGELOG.md @@ -0,0 +1,2 @@ +# Change History + diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/_meta.json b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/_meta.json new file mode 100644 index 000000000000..4f2f5ebfd988 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/_meta.json @@ -0,0 +1,11 @@ +{ + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", + "readme": "/_/azure-rest-api-specs/specification/labservices/resource-manager/readme.md", + "tag": "package-preview-2021-11", + "use": "@microsoft.azure/autorest.go@2.1.187", + "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-preview-2021-11 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/labservices/resource-manager/readme.md", + "additional_properties": { + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" + } +} \ No newline at end of file diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/client.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/client.go new file mode 100644 index 000000000000..1d9f0e553f40 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/client.go @@ -0,0 +1,41 @@ +// Package labservices implements the Azure ARM Labservices service API version 2021-11-15-preview. +// +// +package labservices + +// 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. + +import ( + "github.com/Azure/go-autorest/autorest" +) + +const ( + // DefaultBaseURI is the default URI used for the service Labservices + DefaultBaseURI = "https://management.azure.com" +) + +// BaseClient is the base client for Labservices. +type BaseClient struct { + autorest.Client + BaseURI string + SubscriptionID string +} + +// New creates an instance of the BaseClient client. +func New(subscriptionID string) BaseClient { + return NewWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewWithBaseURI creates an instance of the BaseClient client using a custom endpoint. Use this when interacting with +// an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewWithBaseURI(baseURI string, subscriptionID string) BaseClient { + return BaseClient{ + Client: autorest.NewClientWithUserAgent(UserAgent()), + BaseURI: baseURI, + SubscriptionID: subscriptionID, + } +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/enums.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/enums.go new file mode 100644 index 000000000000..b78642996935 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/enums.go @@ -0,0 +1,440 @@ +package labservices + +// 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. + +// ActionType enumerates the values for action type. +type ActionType string + +const ( + // ActionTypeInternal ... + ActionTypeInternal ActionType = "Internal" +) + +// PossibleActionTypeValues returns an array of possible values for the ActionType const type. +func PossibleActionTypeValues() []ActionType { + return []ActionType{ActionTypeInternal} +} + +// ConnectionType enumerates the values for connection type. +type ConnectionType string + +const ( + // ConnectionTypeNone ... + ConnectionTypeNone ConnectionType = "None" + // ConnectionTypePrivate ... + ConnectionTypePrivate ConnectionType = "Private" + // ConnectionTypePublic ... + ConnectionTypePublic ConnectionType = "Public" +) + +// PossibleConnectionTypeValues returns an array of possible values for the ConnectionType const type. +func PossibleConnectionTypeValues() []ConnectionType { + return []ConnectionType{ConnectionTypeNone, ConnectionTypePrivate, ConnectionTypePublic} +} + +// CreatedByType enumerates the values for created by type. +type CreatedByType string + +const ( + // CreatedByTypeApplication ... + CreatedByTypeApplication CreatedByType = "Application" + // CreatedByTypeKey ... + CreatedByTypeKey CreatedByType = "Key" + // CreatedByTypeManagedIdentity ... + CreatedByTypeManagedIdentity CreatedByType = "ManagedIdentity" + // CreatedByTypeUser ... + CreatedByTypeUser CreatedByType = "User" +) + +// PossibleCreatedByTypeValues returns an array of possible values for the CreatedByType const type. +func PossibleCreatedByTypeValues() []CreatedByType { + return []CreatedByType{CreatedByTypeApplication, CreatedByTypeKey, CreatedByTypeManagedIdentity, CreatedByTypeUser} +} + +// CreateOption enumerates the values for create option. +type CreateOption string + +const ( + // CreateOptionImage An image is used to create all lab user virtual machines. When this option is set, no + // template VM will be created. + CreateOptionImage CreateOption = "Image" + // CreateOptionTemplateVM A template VM will be used to create all lab user virtual machines. + CreateOptionTemplateVM CreateOption = "TemplateVM" +) + +// PossibleCreateOptionValues returns an array of possible values for the CreateOption const type. +func PossibleCreateOptionValues() []CreateOption { + return []CreateOption{CreateOptionImage, CreateOptionTemplateVM} +} + +// EnableState enumerates the values for enable state. +type EnableState string + +const ( + // EnableStateDisabled ... + EnableStateDisabled EnableState = "Disabled" + // EnableStateEnabled ... + EnableStateEnabled EnableState = "Enabled" +) + +// PossibleEnableStateValues returns an array of possible values for the EnableState const type. +func PossibleEnableStateValues() []EnableState { + return []EnableState{EnableStateDisabled, EnableStateEnabled} +} + +// InvitationState enumerates the values for invitation state. +type InvitationState string + +const ( + // InvitationStateFailed There was an error while sending the invitation. + InvitationStateFailed InvitationState = "Failed" + // InvitationStateNotSent The invitation has not been sent. + InvitationStateNotSent InvitationState = "NotSent" + // InvitationStateSending Currently sending the invitation. + InvitationStateSending InvitationState = "Sending" + // InvitationStateSent The invitation has been successfully sent. + InvitationStateSent InvitationState = "Sent" +) + +// PossibleInvitationStateValues returns an array of possible values for the InvitationState const type. +func PossibleInvitationStateValues() []InvitationState { + return []InvitationState{InvitationStateFailed, InvitationStateNotSent, InvitationStateSending, InvitationStateSent} +} + +// LabState enumerates the values for lab state. +type LabState string + +const ( + // LabStateDraft The lab is currently in draft (has not been published). + LabStateDraft LabState = "Draft" + // LabStatePublished The lab has been published. + LabStatePublished LabState = "Published" + // LabStatePublishing The lab is publishing. + LabStatePublishing LabState = "Publishing" + // LabStateScaling The lab is scaling. + LabStateScaling LabState = "Scaling" + // LabStateSyncing The lab is syncing users. + LabStateSyncing LabState = "Syncing" +) + +// PossibleLabStateValues returns an array of possible values for the LabState const type. +func PossibleLabStateValues() []LabState { + return []LabState{LabStateDraft, LabStatePublished, LabStatePublishing, LabStateScaling, LabStateSyncing} +} + +// OperationStatus enumerates the values for operation status. +type OperationStatus string + +const ( + // OperationStatusCanceled Not supported yet + OperationStatusCanceled OperationStatus = "Canceled" + // OperationStatusFailed The operation failed + OperationStatusFailed OperationStatus = "Failed" + // OperationStatusInProgress The operation is running + OperationStatusInProgress OperationStatus = "InProgress" + // OperationStatusNotStarted The operation has been accepted but hasn't started. + OperationStatusNotStarted OperationStatus = "NotStarted" + // OperationStatusSucceeded The operation Succeeded + OperationStatusSucceeded OperationStatus = "Succeeded" +) + +// PossibleOperationStatusValues returns an array of possible values for the OperationStatus const type. +func PossibleOperationStatusValues() []OperationStatus { + return []OperationStatus{OperationStatusCanceled, OperationStatusFailed, OperationStatusInProgress, OperationStatusNotStarted, OperationStatusSucceeded} +} + +// Origin enumerates the values for origin. +type Origin string + +const ( + // OriginSystem ... + OriginSystem Origin = "system" + // OriginUser ... + OriginUser Origin = "user" + // OriginUsersystem ... + OriginUsersystem Origin = "user,system" +) + +// PossibleOriginValues returns an array of possible values for the Origin const type. +func PossibleOriginValues() []Origin { + return []Origin{OriginSystem, OriginUser, OriginUsersystem} +} + +// OsState enumerates the values for os state. +type OsState string + +const ( + // OsStateGeneralized Image does not contain any machine and user specific information. + OsStateGeneralized OsState = "Generalized" + // OsStateSpecialized Image contains machine and user specific information. + OsStateSpecialized OsState = "Specialized" +) + +// PossibleOsStateValues returns an array of possible values for the OsState const type. +func PossibleOsStateValues() []OsState { + return []OsState{OsStateGeneralized, OsStateSpecialized} +} + +// OsType enumerates the values for os type. +type OsType string + +const ( + // OsTypeLinux ... + OsTypeLinux OsType = "Linux" + // OsTypeWindows ... + OsTypeWindows OsType = "Windows" +) + +// PossibleOsTypeValues returns an array of possible values for the OsType const type. +func PossibleOsTypeValues() []OsType { + return []OsType{OsTypeLinux, OsTypeWindows} +} + +// ProvisioningState enumerates the values for provisioning state. +type ProvisioningState string + +const ( + // ProvisioningStateCreating Resource is in the process of being created. + ProvisioningStateCreating ProvisioningState = "Creating" + // ProvisioningStateDeleting Resource is in the process of being deleted. + ProvisioningStateDeleting ProvisioningState = "Deleting" + // ProvisioningStateFailed Previous operation on the resource has failed leaving resource in unhealthy + // state. + ProvisioningStateFailed ProvisioningState = "Failed" + // ProvisioningStateLocked The resource is locked and changes are currently blocked. This could be due to + // maintenance or a scheduled operation. The state will go back to succeeded once the locking operation has + // finished. + ProvisioningStateLocked ProvisioningState = "Locked" + // ProvisioningStateSucceeded Resource is in healthy state after creation or update operation. + ProvisioningStateSucceeded ProvisioningState = "Succeeded" + // ProvisioningStateUpdating New property values are being applied to the resource. + ProvisioningStateUpdating ProvisioningState = "Updating" +) + +// PossibleProvisioningStateValues returns an array of possible values for the ProvisioningState const type. +func PossibleProvisioningStateValues() []ProvisioningState { + return []ProvisioningState{ProvisioningStateCreating, ProvisioningStateDeleting, ProvisioningStateFailed, ProvisioningStateLocked, ProvisioningStateSucceeded, ProvisioningStateUpdating} +} + +// RecurrenceFrequency enumerates the values for recurrence frequency. +type RecurrenceFrequency string + +const ( + // RecurrenceFrequencyDaily Schedule will run every days. + RecurrenceFrequencyDaily RecurrenceFrequency = "Daily" + // RecurrenceFrequencyWeekly Schedule will run every week on days specified in weekDays. + RecurrenceFrequencyWeekly RecurrenceFrequency = "Weekly" +) + +// PossibleRecurrenceFrequencyValues returns an array of possible values for the RecurrenceFrequency const type. +func PossibleRecurrenceFrequencyValues() []RecurrenceFrequency { + return []RecurrenceFrequency{RecurrenceFrequencyDaily, RecurrenceFrequencyWeekly} +} + +// RegistrationState enumerates the values for registration state. +type RegistrationState string + +const ( + // RegistrationStateNotRegistered User has registered with the lab. + RegistrationStateNotRegistered RegistrationState = "NotRegistered" + // RegistrationStateRegistered User has not yet registered with the lab. + RegistrationStateRegistered RegistrationState = "Registered" +) + +// PossibleRegistrationStateValues returns an array of possible values for the RegistrationState const type. +func PossibleRegistrationStateValues() []RegistrationState { + return []RegistrationState{RegistrationStateNotRegistered, RegistrationStateRegistered} +} + +// ResourceIdentityType enumerates the values for resource identity type. +type ResourceIdentityType string + +const ( + // ResourceIdentityTypeSystemAssigned ... + ResourceIdentityTypeSystemAssigned ResourceIdentityType = "SystemAssigned" +) + +// PossibleResourceIdentityTypeValues returns an array of possible values for the ResourceIdentityType const type. +func PossibleResourceIdentityTypeValues() []ResourceIdentityType { + return []ResourceIdentityType{ResourceIdentityTypeSystemAssigned} +} + +// RestrictionReasonCode enumerates the values for restriction reason code. +type RestrictionReasonCode string + +const ( + // RestrictionReasonCodeNotAvailableForSubscription ... + RestrictionReasonCodeNotAvailableForSubscription RestrictionReasonCode = "NotAvailableForSubscription" + // RestrictionReasonCodeQuotaID ... + RestrictionReasonCodeQuotaID RestrictionReasonCode = "QuotaId" +) + +// PossibleRestrictionReasonCodeValues returns an array of possible values for the RestrictionReasonCode const type. +func PossibleRestrictionReasonCodeValues() []RestrictionReasonCode { + return []RestrictionReasonCode{RestrictionReasonCodeNotAvailableForSubscription, RestrictionReasonCodeQuotaID} +} + +// RestrictionType enumerates the values for restriction type. +type RestrictionType string + +const ( + // RestrictionTypeLocation ... + RestrictionTypeLocation RestrictionType = "Location" +) + +// PossibleRestrictionTypeValues returns an array of possible values for the RestrictionType const type. +func PossibleRestrictionTypeValues() []RestrictionType { + return []RestrictionType{RestrictionTypeLocation} +} + +// ScaleType enumerates the values for scale type. +type ScaleType string + +const ( + // ScaleTypeAutomatic The user is permitted to scale this SKU in and out. + ScaleTypeAutomatic ScaleType = "Automatic" + // ScaleTypeManual The user must manually scale this SKU in and out. + ScaleTypeManual ScaleType = "Manual" + // ScaleTypeNone The capacity is not adjustable in any way. + ScaleTypeNone ScaleType = "None" +) + +// PossibleScaleTypeValues returns an array of possible values for the ScaleType const type. +func PossibleScaleTypeValues() []ScaleType { + return []ScaleType{ScaleTypeAutomatic, ScaleTypeManual, ScaleTypeNone} +} + +// ShutdownOnIdleMode enumerates the values for shutdown on idle mode. +type ShutdownOnIdleMode string + +const ( + // ShutdownOnIdleModeLowUsage The VM will be considered as idle when user is absent and the resource (CPU + // and disk) consumption is low. + ShutdownOnIdleModeLowUsage ShutdownOnIdleMode = "LowUsage" + // ShutdownOnIdleModeNone The VM won't be shut down when it is idle. + ShutdownOnIdleModeNone ShutdownOnIdleMode = "None" + // ShutdownOnIdleModeUserAbsence The VM will be considered as idle when there is no keyboard or mouse + // input. + ShutdownOnIdleModeUserAbsence ShutdownOnIdleMode = "UserAbsence" +) + +// PossibleShutdownOnIdleModeValues returns an array of possible values for the ShutdownOnIdleMode const type. +func PossibleShutdownOnIdleModeValues() []ShutdownOnIdleMode { + return []ShutdownOnIdleMode{ShutdownOnIdleModeLowUsage, ShutdownOnIdleModeNone, ShutdownOnIdleModeUserAbsence} +} + +// SkuTier enumerates the values for sku tier. +type SkuTier string + +const ( + // SkuTierBasic ... + SkuTierBasic SkuTier = "Basic" + // SkuTierFree ... + SkuTierFree SkuTier = "Free" + // SkuTierPremium ... + SkuTierPremium SkuTier = "Premium" + // SkuTierStandard ... + SkuTierStandard SkuTier = "Standard" +) + +// PossibleSkuTierValues returns an array of possible values for the SkuTier const type. +func PossibleSkuTierValues() []SkuTier { + return []SkuTier{SkuTierBasic, SkuTierFree, SkuTierPremium, SkuTierStandard} +} + +// SkuTierEnum enumerates the values for sku tier enum. +type SkuTierEnum string + +const ( + // SkuTierEnumPremium ... + SkuTierEnumPremium SkuTierEnum = "Premium" + // SkuTierEnumStandard ... + SkuTierEnumStandard SkuTierEnum = "Standard" +) + +// PossibleSkuTierEnumValues returns an array of possible values for the SkuTierEnum const type. +func PossibleSkuTierEnumValues() []SkuTierEnum { + return []SkuTierEnum{SkuTierEnumPremium, SkuTierEnumStandard} +} + +// UsageUnit enumerates the values for usage unit. +type UsageUnit string + +const ( + // UsageUnitCount ... + UsageUnitCount UsageUnit = "Count" +) + +// PossibleUsageUnitValues returns an array of possible values for the UsageUnit const type. +func PossibleUsageUnitValues() []UsageUnit { + return []UsageUnit{UsageUnitCount} +} + +// VirtualMachineState enumerates the values for virtual machine state. +type VirtualMachineState string + +const ( + // VirtualMachineStateRedeploying The VM is being redeployed. + VirtualMachineStateRedeploying VirtualMachineState = "Redeploying" + // VirtualMachineStateReimaging The VM is being reimaged. + VirtualMachineStateReimaging VirtualMachineState = "Reimaging" + // VirtualMachineStateResettingPassword The VM password is being reset. + VirtualMachineStateResettingPassword VirtualMachineState = "ResettingPassword" + // VirtualMachineStateRunning The VM is running. + VirtualMachineStateRunning VirtualMachineState = "Running" + // VirtualMachineStateStarting The VM is starting. + VirtualMachineStateStarting VirtualMachineState = "Starting" + // VirtualMachineStateStopped The VM is currently stopped. + VirtualMachineStateStopped VirtualMachineState = "Stopped" + // VirtualMachineStateStopping The VM is stopping. + VirtualMachineStateStopping VirtualMachineState = "Stopping" +) + +// PossibleVirtualMachineStateValues returns an array of possible values for the VirtualMachineState const type. +func PossibleVirtualMachineStateValues() []VirtualMachineState { + return []VirtualMachineState{VirtualMachineStateRedeploying, VirtualMachineStateReimaging, VirtualMachineStateResettingPassword, VirtualMachineStateRunning, VirtualMachineStateStarting, VirtualMachineStateStopped, VirtualMachineStateStopping} +} + +// VirtualMachineType enumerates the values for virtual machine type. +type VirtualMachineType string + +const ( + // VirtualMachineTypeTemplate A template VM + VirtualMachineTypeTemplate VirtualMachineType = "Template" + // VirtualMachineTypeUser A user VM + VirtualMachineTypeUser VirtualMachineType = "User" +) + +// PossibleVirtualMachineTypeValues returns an array of possible values for the VirtualMachineType const type. +func PossibleVirtualMachineTypeValues() []VirtualMachineType { + return []VirtualMachineType{VirtualMachineTypeTemplate, VirtualMachineTypeUser} +} + +// WeekDay enumerates the values for week day. +type WeekDay string + +const ( + // WeekDayFriday Schedule will run on Friday + WeekDayFriday WeekDay = "Friday" + // WeekDayMonday Schedule will run on Monday + WeekDayMonday WeekDay = "Monday" + // WeekDaySaturday Schedule will run on Saturday + WeekDaySaturday WeekDay = "Saturday" + // WeekDaySunday Schedule will run on Sunday + WeekDaySunday WeekDay = "Sunday" + // WeekDayThursday Schedule will run on Thursday + WeekDayThursday WeekDay = "Thursday" + // WeekDayTuesday Schedule will run on Tuesday + WeekDayTuesday WeekDay = "Tuesday" + // WeekDayWednesday Schedule will run on Wednesday + WeekDayWednesday WeekDay = "Wednesday" +) + +// PossibleWeekDayValues returns an array of possible values for the WeekDay const type. +func PossibleWeekDayValues() []WeekDay { + return []WeekDay{WeekDayFriday, WeekDayMonday, WeekDaySaturday, WeekDaySunday, WeekDayThursday, WeekDayTuesday, WeekDayWednesday} +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/images.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/images.go new file mode 100644 index 000000000000..e64d3bfb4085 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/images.go @@ -0,0 +1,461 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// ImagesClient is the client for the Images methods of the Labservices service. +type ImagesClient struct { + BaseClient +} + +// NewImagesClient creates an instance of the ImagesClient client. +func NewImagesClient(subscriptionID string) ImagesClient { + return NewImagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewImagesClientWithBaseURI creates an instance of the ImagesClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewImagesClientWithBaseURI(baseURI string, subscriptionID string) ImagesClient { + return ImagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate updates an image resource via PUT. Creating new resources via PUT will not function. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +// imageName - the image name. +func (client ImagesClient) CreateOrUpdate(ctx context.Context, body Image, resourceGroupName string, labPlanName string, imageName string) (result Image, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.ImageProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: imageName, + Constraints: []validation.Constraint{{Target: "imageName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "imageName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "imageName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.ImagesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, labPlanName, imageName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client ImagesClient) CreateOrUpdatePreparer(ctx context.Context, body Image, resourceGroupName string, labPlanName string, imageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images/{imageName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client ImagesClient) CreateOrUpdateResponder(resp *http.Response) (result Image, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Get gets an image resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +// imageName - the image name. +func (client ImagesClient) Get(ctx context.Context, resourceGroupName string, labPlanName string, imageName string) (result Image, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: imageName, + Constraints: []validation.Constraint{{Target: "imageName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "imageName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "imageName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.ImagesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, labPlanName, imageName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client ImagesClient) GetPreparer(ctx context.Context, resourceGroupName string, labPlanName string, imageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images/{imageName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client ImagesClient) GetResponder(resp *http.Response) (result Image, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByLabPlan gets all images from galleries attached to a lab plan. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +// filter - the filter to apply to the operation. +func (client ImagesClient) ListByLabPlan(ctx context.Context, resourceGroupName string, labPlanName string, filter string) (result PagedImagesPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByLabPlan") + defer func() { + sc := -1 + if result.pi.Response.Response != nil { + sc = result.pi.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.ImagesClient", "ListByLabPlan", err.Error()) + } + + result.fn = client.listByLabPlanNextResults + req, err := client.ListByLabPlanPreparer(ctx, resourceGroupName, labPlanName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "ListByLabPlan", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLabPlanSender(req) + if err != nil { + result.pi.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "ListByLabPlan", resp, "Failure sending request") + return + } + + result.pi, err = client.ListByLabPlanResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "ListByLabPlan", resp, "Failure responding to request") + return + } + if result.pi.hasNextLink() && result.pi.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLabPlanPreparer prepares the ListByLabPlan request. +func (client ImagesClient) ListByLabPlanPreparer(ctx context.Context, resourceGroupName string, labPlanName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLabPlanSender sends the ListByLabPlan request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) ListByLabPlanSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLabPlanResponder handles the response to the ListByLabPlan request. The method always +// closes the http.Response Body. +func (client ImagesClient) ListByLabPlanResponder(resp *http.Response) (result PagedImages, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLabPlanNextResults retrieves the next set of results, if any. +func (client ImagesClient) listByLabPlanNextResults(ctx context.Context, lastResults PagedImages) (result PagedImages, err error) { + req, err := lastResults.pagedImagesPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.ImagesClient", "listByLabPlanNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLabPlanSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.ImagesClient", "listByLabPlanNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLabPlanResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "listByLabPlanNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLabPlanComplete enumerates all values, automatically crossing page boundaries as required. +func (client ImagesClient) ListByLabPlanComplete(ctx context.Context, resourceGroupName string, labPlanName string, filter string) (result PagedImagesIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.ListByLabPlan") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLabPlan(ctx, resourceGroupName, labPlanName, filter) + return +} + +// Update updates an image resource. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +// imageName - the image name. +func (client ImagesClient) Update(ctx context.Context, body ImageUpdate, resourceGroupName string, labPlanName string, imageName string) (result Image, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ImagesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: imageName, + Constraints: []validation.Constraint{{Target: "imageName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "imageName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "imageName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.ImagesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, labPlanName, imageName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.ImagesClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client ImagesClient) UpdatePreparer(ctx context.Context, body ImageUpdate, resourceGroupName string, labPlanName string, imageName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "imageName": autorest.Encode("path", imageName), + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/images/{imageName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client ImagesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client ImagesClient) UpdateResponder(resp *http.Response) (result Image, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labplans.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labplans.go new file mode 100644 index 000000000000..3cebdb9871e3 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labplans.go @@ -0,0 +1,749 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LabPlansClient is the client for the LabPlans methods of the Labservices service. +type LabPlansClient struct { + BaseClient +} + +// NewLabPlansClient creates an instance of the LabPlansClient client. +func NewLabPlansClient(subscriptionID string) LabPlansClient { + return NewLabPlansClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLabPlansClientWithBaseURI creates an instance of the LabPlansClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewLabPlansClientWithBaseURI(baseURI string, subscriptionID string) LabPlansClient { + return LabPlansClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate operation to create or update a Lab Plan resource. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +func (client LabPlansClient) CreateOrUpdate(ctx context.Context, body LabPlan, resourceGroupName string, labPlanName string) (result LabPlansCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.LabPlanProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, labPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LabPlansClient) CreateOrUpdatePreparer(ctx context.Context, body LabPlan, resourceGroupName string, labPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) CreateOrUpdateSender(req *http.Request) (future LabPlansCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client LabPlansClient) CreateOrUpdateResponder(resp *http.Response) (result LabPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to delete a Lab Plan resource. Deleting a lab plan does not delete labs associated with a lab plan, +// nor does it delete shared images added to a gallery via the lab plan permission container. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +func (client LabPlansClient) Delete(ctx context.Context, resourceGroupName string, labPlanName string) (result LabPlansDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, labPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LabPlansClient) DeletePreparer(ctx context.Context, resourceGroupName string, labPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) DeleteSender(req *http.Request) (future LabPlansDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LabPlansClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get retrieves the properties of a Lab Plan. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +func (client LabPlansClient) Get(ctx context.Context, resourceGroupName string, labPlanName string) (result LabPlan, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, labPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client LabPlansClient) GetPreparer(ctx context.Context, resourceGroupName string, labPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LabPlansClient) GetResponder(resp *http.Response) (result LabPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup returns a list of all lab plans for a subscription and resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client LabPlansClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result PagedLabPlansPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.plp.Response.Response != nil { + sc = result.plp.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.plp.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.plp, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.plp.hasNextLink() && result.plp.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client LabPlansClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client LabPlansClient) ListByResourceGroupResponder(resp *http.Response) (result PagedLabPlans, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client LabPlansClient) listByResourceGroupNextResults(ctx context.Context, lastResults PagedLabPlans) (result PagedLabPlans, err error) { + req, err := lastResults.pagedLabPlansPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.LabPlansClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.LabPlansClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client LabPlansClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result PagedLabPlansIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription returns a list of all lab plans within a subscription +// Parameters: +// filter - the filter to apply to the operation. +func (client LabPlansClient) ListBySubscription(ctx context.Context, filter string) (result PagedLabPlansPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.ListBySubscription") + defer func() { + sc := -1 + if result.plp.Response.Response != nil { + sc = result.plp.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.plp.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.plp, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.plp.hasNextLink() && result.plp.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client LabPlansClient) ListBySubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labPlans", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client LabPlansClient) ListBySubscriptionResponder(resp *http.Response) (result PagedLabPlans, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client LabPlansClient) listBySubscriptionNextResults(ctx context.Context, lastResults PagedLabPlans) (result PagedLabPlans, err error) { + req, err := lastResults.pagedLabPlansPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.LabPlansClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.LabPlansClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client LabPlansClient) ListBySubscriptionComplete(ctx context.Context, filter string) (result PagedLabPlansIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, filter) + return +} + +// SaveImage saves an image from a lab VM to the attached shared image gallery. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +func (client LabPlansClient) SaveImage(ctx context.Context, body SaveImageBody, resourceGroupName string, labPlanName string) (result LabPlansSaveImageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.SaveImage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "SaveImage", err.Error()) + } + + req, err := client.SaveImagePreparer(ctx, body, resourceGroupName, labPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "SaveImage", nil, "Failure preparing request") + return + } + + result, err = client.SaveImageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "SaveImage", result.Response(), "Failure sending request") + return + } + + return +} + +// SaveImagePreparer prepares the SaveImage request. +func (client LabPlansClient) SaveImagePreparer(ctx context.Context, body SaveImageBody, resourceGroupName string, labPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}/saveImage", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SaveImageSender sends the SaveImage request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) SaveImageSender(req *http.Request) (future LabPlansSaveImageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SaveImageResponder handles the response to the SaveImage request. The method always +// closes the http.Response Body. +func (client LabPlansClient) SaveImageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update operation to update a Lab Plan resource. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labPlanName - the name of the lab plan that uniquely identifies it within containing resource group. Used in +// resource URIs and in UI. +func (client LabPlansClient) Update(ctx context.Context, body LabPlanUpdate, resourceGroupName string, labPlanName string) (result LabPlansUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabPlansClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labPlanName, + Constraints: []validation.Constraint{{Target: "labPlanName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labPlanName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabPlansClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, labPlanName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client LabPlansClient) UpdatePreparer(ctx context.Context, body LabPlanUpdate, resourceGroupName string, labPlanName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labPlanName": autorest.Encode("path", labPlanName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labPlans/{labPlanName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client LabPlansClient) UpdateSender(req *http.Request) (future LabPlansUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client LabPlansClient) UpdateResponder(resp *http.Response) (result LabPlan, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labs.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labs.go new file mode 100644 index 000000000000..59cf7f917f03 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labs.go @@ -0,0 +1,836 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// LabsClient is the client for the Labs methods of the Labservices service. +type LabsClient struct { + BaseClient +} + +// NewLabsClient creates an instance of the LabsClient client. +func NewLabsClient(subscriptionID string) LabsClient { + return NewLabsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewLabsClientWithBaseURI creates an instance of the LabsClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewLabsClientWithBaseURI(baseURI string, subscriptionID string) LabsClient { + return LabsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate operation to create or update a lab resource. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +func (client LabsClient) CreateOrUpdate(ctx context.Context, body Lab, resourceGroupName string, labName string) (result LabsCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.LabProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, labName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client LabsClient) CreateOrUpdatePreparer(ctx context.Context, body Lab, resourceGroupName string, labName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) CreateOrUpdateSender(req *http.Request) (future LabsCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client LabsClient) CreateOrUpdateResponder(resp *http.Response) (result Lab, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to delete a lab resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +func (client LabsClient) Delete(ctx context.Context, resourceGroupName string, labName string) (result LabsDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, labName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client LabsClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) DeleteSender(req *http.Request) (future LabsDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client LabsClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns the properties of a lab resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +func (client LabsClient) Get(ctx context.Context, resourceGroupName string, labName string) (result Lab, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, labName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client LabsClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client LabsClient) GetResponder(resp *http.Response) (result Lab, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByResourceGroup returns a list of all labs in a resource group. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +func (client LabsClient) ListByResourceGroup(ctx context.Context, resourceGroupName string) (result PagedLabsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "ListByResourceGroup", err.Error()) + } + + result.fn = client.listByResourceGroupNextResults + req, err := client.ListByResourceGroupPreparer(ctx, resourceGroupName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "ListByResourceGroup", nil, "Failure preparing request") + return + } + + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.pl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "ListByResourceGroup", resp, "Failure sending request") + return + } + + result.pl, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "ListByResourceGroup", resp, "Failure responding to request") + return + } + if result.pl.hasNextLink() && result.pl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByResourceGroupPreparer prepares the ListByResourceGroup request. +func (client LabsClient) ListByResourceGroupPreparer(ctx context.Context, resourceGroupName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByResourceGroupSender sends the ListByResourceGroup request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) ListByResourceGroupSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByResourceGroupResponder handles the response to the ListByResourceGroup request. The method always +// closes the http.Response Body. +func (client LabsClient) ListByResourceGroupResponder(resp *http.Response) (result PagedLabs, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByResourceGroupNextResults retrieves the next set of results, if any. +func (client LabsClient) listByResourceGroupNextResults(ctx context.Context, lastResults PagedLabs) (result PagedLabs, err error) { + req, err := lastResults.pagedLabsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.LabsClient", "listByResourceGroupNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByResourceGroupSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.LabsClient", "listByResourceGroupNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByResourceGroupResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "listByResourceGroupNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByResourceGroupComplete enumerates all values, automatically crossing page boundaries as required. +func (client LabsClient) ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result PagedLabsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListByResourceGroup") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByResourceGroup(ctx, resourceGroupName) + return +} + +// ListBySubscription returns a list of all labs for a subscription. +// Parameters: +// filter - the filter to apply to the operation. +func (client LabsClient) ListBySubscription(ctx context.Context, filter string) (result PagedLabsPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListBySubscription") + defer func() { + sc := -1 + if result.pl.Response.Response != nil { + sc = result.pl.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "ListBySubscription", err.Error()) + } + + result.fn = client.listBySubscriptionNextResults + req, err := client.ListBySubscriptionPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "ListBySubscription", nil, "Failure preparing request") + return + } + + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.pl.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "ListBySubscription", resp, "Failure sending request") + return + } + + result.pl, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "ListBySubscription", resp, "Failure responding to request") + return + } + if result.pl.hasNextLink() && result.pl.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListBySubscriptionPreparer prepares the ListBySubscription request. +func (client LabsClient) ListBySubscriptionPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/labs", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListBySubscriptionSender sends the ListBySubscription request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) ListBySubscriptionSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListBySubscriptionResponder handles the response to the ListBySubscription request. The method always +// closes the http.Response Body. +func (client LabsClient) ListBySubscriptionResponder(resp *http.Response) (result PagedLabs, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listBySubscriptionNextResults retrieves the next set of results, if any. +func (client LabsClient) listBySubscriptionNextResults(ctx context.Context, lastResults PagedLabs) (result PagedLabs, err error) { + req, err := lastResults.pagedLabsPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.LabsClient", "listBySubscriptionNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListBySubscriptionSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.LabsClient", "listBySubscriptionNextResults", resp, "Failure sending next results request") + } + result, err = client.ListBySubscriptionResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "listBySubscriptionNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListBySubscriptionComplete enumerates all values, automatically crossing page boundaries as required. +func (client LabsClient) ListBySubscriptionComplete(ctx context.Context, filter string) (result PagedLabsIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.ListBySubscription") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListBySubscription(ctx, filter) + return +} + +// Publish publish or re-publish a lab. This will create or update all lab resources, such as virtual machines. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +func (client LabsClient) Publish(ctx context.Context, resourceGroupName string, labName string) (result LabsPublishFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.Publish") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "Publish", err.Error()) + } + + req, err := client.PublishPreparer(ctx, resourceGroupName, labName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Publish", nil, "Failure preparing request") + return + } + + result, err = client.PublishSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Publish", result.Response(), "Failure sending request") + return + } + + return +} + +// PublishPreparer prepares the Publish request. +func (client LabsClient) PublishPreparer(ctx context.Context, resourceGroupName string, labName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/publish", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// PublishSender sends the Publish request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) PublishSender(req *http.Request) (future LabsPublishFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// PublishResponder handles the response to the Publish request. The method always +// closes the http.Response Body. +func (client LabsClient) PublishResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// SyncGroup action used to manually kick off an AAD group sync job. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +func (client LabsClient) SyncGroup(ctx context.Context, resourceGroupName string, labName string) (result LabsSyncGroupFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.SyncGroup") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "SyncGroup", err.Error()) + } + + req, err := client.SyncGroupPreparer(ctx, resourceGroupName, labName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "SyncGroup", nil, "Failure preparing request") + return + } + + result, err = client.SyncGroupSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "SyncGroup", result.Response(), "Failure sending request") + return + } + + return +} + +// SyncGroupPreparer prepares the SyncGroup request. +func (client LabsClient) SyncGroupPreparer(ctx context.Context, resourceGroupName string, labName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/syncGroup", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// SyncGroupSender sends the SyncGroup request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) SyncGroupSender(req *http.Request) (future LabsSyncGroupFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// SyncGroupResponder handles the response to the SyncGroup request. The method always +// closes the http.Response Body. +func (client LabsClient) SyncGroupResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Update operation to update a lab resource. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +func (client LabsClient) Update(ctx context.Context, body LabUpdate, resourceGroupName string, labName string) (result LabsUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/LabsClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.LabsClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, labName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client LabsClient) UpdatePreparer(ctx context.Context, body LabUpdate, resourceGroupName string, labName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client LabsClient) UpdateSender(req *http.Request) (future LabsUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client LabsClient) UpdateResponder(resp *http.Response) (result Lab, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labservicesapi/interfaces.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labservicesapi/interfaces.go new file mode 100644 index 000000000000..b2314fec23f8 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/labservicesapi/interfaces.go @@ -0,0 +1,124 @@ +package labservicesapi + +// 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. + +import ( + "context" + "github.com/Azure/azure-sdk-for-go/services/preview/labservices/mgmt/2021-11-15-preview/labservices" +) + +// ImagesClientAPI contains the set of methods on the ImagesClient type. +type ImagesClientAPI interface { + CreateOrUpdate(ctx context.Context, body labservices.Image, resourceGroupName string, labPlanName string, imageName string) (result labservices.Image, err error) + Get(ctx context.Context, resourceGroupName string, labPlanName string, imageName string) (result labservices.Image, err error) + ListByLabPlan(ctx context.Context, resourceGroupName string, labPlanName string, filter string) (result labservices.PagedImagesPage, err error) + ListByLabPlanComplete(ctx context.Context, resourceGroupName string, labPlanName string, filter string) (result labservices.PagedImagesIterator, err error) + Update(ctx context.Context, body labservices.ImageUpdate, resourceGroupName string, labPlanName string, imageName string) (result labservices.Image, err error) +} + +var _ ImagesClientAPI = (*labservices.ImagesClient)(nil) + +// LabPlansClientAPI contains the set of methods on the LabPlansClient type. +type LabPlansClientAPI interface { + CreateOrUpdate(ctx context.Context, body labservices.LabPlan, resourceGroupName string, labPlanName string) (result labservices.LabPlansCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, labPlanName string) (result labservices.LabPlansDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, labPlanName string) (result labservices.LabPlan, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result labservices.PagedLabPlansPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result labservices.PagedLabPlansIterator, err error) + ListBySubscription(ctx context.Context, filter string) (result labservices.PagedLabPlansPage, err error) + ListBySubscriptionComplete(ctx context.Context, filter string) (result labservices.PagedLabPlansIterator, err error) + SaveImage(ctx context.Context, body labservices.SaveImageBody, resourceGroupName string, labPlanName string) (result labservices.LabPlansSaveImageFuture, err error) + Update(ctx context.Context, body labservices.LabPlanUpdate, resourceGroupName string, labPlanName string) (result labservices.LabPlansUpdateFuture, err error) +} + +var _ LabPlansClientAPI = (*labservices.LabPlansClient)(nil) + +// OperationsClientAPI contains the set of methods on the OperationsClient type. +type OperationsClientAPI interface { + List(ctx context.Context) (result labservices.OperationListResultPage, err error) + ListComplete(ctx context.Context) (result labservices.OperationListResultIterator, err error) +} + +var _ OperationsClientAPI = (*labservices.OperationsClient)(nil) + +// LabsClientAPI contains the set of methods on the LabsClient type. +type LabsClientAPI interface { + CreateOrUpdate(ctx context.Context, body labservices.Lab, resourceGroupName string, labName string) (result labservices.LabsCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, labName string) (result labservices.LabsDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, labName string) (result labservices.Lab, err error) + ListByResourceGroup(ctx context.Context, resourceGroupName string) (result labservices.PagedLabsPage, err error) + ListByResourceGroupComplete(ctx context.Context, resourceGroupName string) (result labservices.PagedLabsIterator, err error) + ListBySubscription(ctx context.Context, filter string) (result labservices.PagedLabsPage, err error) + ListBySubscriptionComplete(ctx context.Context, filter string) (result labservices.PagedLabsIterator, err error) + Publish(ctx context.Context, resourceGroupName string, labName string) (result labservices.LabsPublishFuture, err error) + SyncGroup(ctx context.Context, resourceGroupName string, labName string) (result labservices.LabsSyncGroupFuture, err error) + Update(ctx context.Context, body labservices.LabUpdate, resourceGroupName string, labName string) (result labservices.LabsUpdateFuture, err error) +} + +var _ LabsClientAPI = (*labservices.LabsClient)(nil) + +// OperationResultsClientAPI contains the set of methods on the OperationResultsClient type. +type OperationResultsClientAPI interface { + Get(ctx context.Context, operationResultID string) (result labservices.OperationResult, err error) +} + +var _ OperationResultsClientAPI = (*labservices.OperationResultsClient)(nil) + +// SchedulesClientAPI contains the set of methods on the SchedulesClient type. +type SchedulesClientAPI interface { + CreateOrUpdate(ctx context.Context, body labservices.Schedule, resourceGroupName string, labName string, scheduleName string) (result labservices.Schedule, err error) + Delete(ctx context.Context, resourceGroupName string, labName string, scheduleName string) (result labservices.SchedulesDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, labName string, scheduleName string) (result labservices.Schedule, err error) + ListByLab(ctx context.Context, resourceGroupName string, labName string, filter string) (result labservices.PagedSchedulesPage, err error) + ListByLabComplete(ctx context.Context, resourceGroupName string, labName string, filter string) (result labservices.PagedSchedulesIterator, err error) + Update(ctx context.Context, body labservices.ScheduleUpdate, resourceGroupName string, labName string, scheduleName string) (result labservices.Schedule, err error) +} + +var _ SchedulesClientAPI = (*labservices.SchedulesClient)(nil) + +// UsersClientAPI contains the set of methods on the UsersClient type. +type UsersClientAPI interface { + CreateOrUpdate(ctx context.Context, body labservices.User, resourceGroupName string, labName string, userName string) (result labservices.UsersCreateOrUpdateFuture, err error) + Delete(ctx context.Context, resourceGroupName string, labName string, userName string) (result labservices.UsersDeleteFuture, err error) + Get(ctx context.Context, resourceGroupName string, labName string, userName string) (result labservices.User, err error) + Invite(ctx context.Context, body labservices.InviteBody, resourceGroupName string, labName string, userName string) (result labservices.UsersInviteFuture, err error) + ListByLab(ctx context.Context, resourceGroupName string, labName string, filter string) (result labservices.PagedUsersPage, err error) + ListByLabComplete(ctx context.Context, resourceGroupName string, labName string, filter string) (result labservices.PagedUsersIterator, err error) + Update(ctx context.Context, body labservices.UserUpdate, resourceGroupName string, labName string, userName string) (result labservices.UsersUpdateFuture, err error) +} + +var _ UsersClientAPI = (*labservices.UsersClient)(nil) + +// VirtualMachinesClientAPI contains the set of methods on the VirtualMachinesClient type. +type VirtualMachinesClientAPI interface { + Get(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result labservices.VirtualMachine, err error) + ListByLab(ctx context.Context, resourceGroupName string, labName string, filter string) (result labservices.PagedVirtualMachinesPage, err error) + ListByLabComplete(ctx context.Context, resourceGroupName string, labName string, filter string) (result labservices.PagedVirtualMachinesIterator, err error) + Redeploy(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result labservices.VirtualMachinesRedeployFuture, err error) + Reimage(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result labservices.VirtualMachinesReimageFuture, err error) + ResetPassword(ctx context.Context, body labservices.ResetPasswordBody, resourceGroupName string, labName string, virtualMachineName string) (result labservices.VirtualMachinesResetPasswordFuture, err error) + Start(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result labservices.VirtualMachinesStartFuture, err error) + Stop(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result labservices.VirtualMachinesStopFuture, err error) +} + +var _ VirtualMachinesClientAPI = (*labservices.VirtualMachinesClient)(nil) + +// UsagesClientAPI contains the set of methods on the UsagesClient type. +type UsagesClientAPI interface { + ListByLocation(ctx context.Context, location string, filter string) (result labservices.ListUsagesResultPage, err error) + ListByLocationComplete(ctx context.Context, location string, filter string) (result labservices.ListUsagesResultIterator, err error) +} + +var _ UsagesClientAPI = (*labservices.UsagesClient)(nil) + +// SkusClientAPI contains the set of methods on the SkusClient type. +type SkusClientAPI interface { + List(ctx context.Context, filter string) (result labservices.PagedLabServicesSkusPage, err error) + ListComplete(ctx context.Context, filter string) (result labservices.PagedLabServicesSkusIterator, err error) +} + +var _ SkusClientAPI = (*labservices.SkusClient)(nil) diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/models.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/models.go new file mode 100644 index 000000000000..9f7c053c70e8 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/models.go @@ -0,0 +1,4068 @@ +package labservices + +// 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. + +import ( + "context" + "encoding/json" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/date" + "github.com/Azure/go-autorest/autorest/to" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// The package's fully qualified name. +const fqdn = "github.com/Azure/azure-sdk-for-go/services/preview/labservices/mgmt/2021-11-15-preview/labservices" + +// AutoShutdownProfile profile for how to handle shutting down virtual machines. +type AutoShutdownProfile struct { + // ShutdownOnDisconnect - Whether shutdown on disconnect is enabled. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + ShutdownOnDisconnect EnableState `json:"shutdownOnDisconnect,omitempty"` + // ShutdownWhenNotConnected - Whether a VM will get shutdown when it hasn't been connected to after a period of time. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + ShutdownWhenNotConnected EnableState `json:"shutdownWhenNotConnected,omitempty"` + // ShutdownOnIdle - Whether a VM will get shutdown when it has idled for a period of time. Possible values include: 'ShutdownOnIdleModeNone', 'ShutdownOnIdleModeUserAbsence', 'ShutdownOnIdleModeLowUsage' + ShutdownOnIdle ShutdownOnIdleMode `json:"shutdownOnIdle,omitempty"` + // DisconnectDelay - The amount of time a VM will stay running after a user disconnects if this behavior is enabled. + DisconnectDelay *string `json:"disconnectDelay,omitempty"` + // NoConnectDelay - The amount of time a VM will stay running before it is shutdown if no connection is made and this behavior is enabled. + NoConnectDelay *string `json:"noConnectDelay,omitempty"` + // IdleDelay - The amount of time a VM will idle before it is shutdown if this behavior is enabled. + IdleDelay *string `json:"idleDelay,omitempty"` +} + +// AzureEntityResource the resource model definition for an Azure Resource Manager resource with an etag. +type AzureEntityResource struct { + // Etag - READ-ONLY; Resource Etag. + Etag *string `json:"etag,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for AzureEntityResource. +func (aer AzureEntityResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ConnectionProfile connection profile for how users connect to lab virtual machines. +type ConnectionProfile struct { + // WebSSHAccess - The enabled access level for Web Access over SSH. Possible values include: 'ConnectionTypePublic', 'ConnectionTypePrivate', 'ConnectionTypeNone' + WebSSHAccess ConnectionType `json:"webSshAccess,omitempty"` + // WebRdpAccess - The enabled access level for Web Access over RDP. Possible values include: 'ConnectionTypePublic', 'ConnectionTypePrivate', 'ConnectionTypeNone' + WebRdpAccess ConnectionType `json:"webRdpAccess,omitempty"` + // ClientSSHAccess - The enabled access level for Client Access over SSH. Possible values include: 'ConnectionTypePublic', 'ConnectionTypePrivate', 'ConnectionTypeNone' + ClientSSHAccess ConnectionType `json:"clientSshAccess,omitempty"` + // ClientRdpAccess - The enabled access level for Client Access over RDP. Possible values include: 'ConnectionTypePublic', 'ConnectionTypePrivate', 'ConnectionTypeNone' + ClientRdpAccess ConnectionType `json:"clientRdpAccess,omitempty"` +} + +// Credentials credentials for a user on a lab VM. +type Credentials struct { + // Username - The username to use when signing in to lab VMs. + Username *string `json:"username,omitempty"` + // Password - The password for the user. This is required for the TemplateVM createOption. + Password *string `json:"password,omitempty"` +} + +// ErrorAdditionalInfo the resource management error additional info. +type ErrorAdditionalInfo struct { + // Type - READ-ONLY; The additional info type. + Type *string `json:"type,omitempty"` + // Info - READ-ONLY; The additional info. + Info interface{} `json:"info,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorAdditionalInfo. +func (eai ErrorAdditionalInfo) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorDetail the error detail. +type ErrorDetail struct { + // Code - READ-ONLY; The error code. + Code *string `json:"code,omitempty"` + // Message - READ-ONLY; The error message. + Message *string `json:"message,omitempty"` + // Target - READ-ONLY; The error target. + Target *string `json:"target,omitempty"` + // Details - READ-ONLY; The error details. + Details *[]ErrorDetail `json:"details,omitempty"` + // AdditionalInfo - READ-ONLY; The error additional info. + AdditionalInfo *[]ErrorAdditionalInfo `json:"additionalInfo,omitempty"` +} + +// MarshalJSON is the custom marshaler for ErrorDetail. +func (ed ErrorDetail) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ErrorResponse common error response for all Azure Resource Manager APIs to return error details for +// failed operations. (This also follows the OData error response format.). +type ErrorResponse struct { + // Error - The error object. + Error *ErrorDetail `json:"error,omitempty"` +} + +// Identity identity for the resource. +type Identity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Identity. +func (i Identity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.Type != "" { + objectMap["type"] = i.Type + } + return json.Marshal(objectMap) +} + +// Image lab services virtual machine image +type Image struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the image. + SystemData *SystemData `json:"systemData,omitempty"` + // ImageProperties - Image resource properties + *ImageProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Image. +func (i Image) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if i.ImageProperties != nil { + objectMap["properties"] = i.ImageProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Image struct. +func (i *Image) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + i.SystemData = &systemData + } + case "properties": + if v != nil { + var imageProperties ImageProperties + err = json.Unmarshal(*v, &imageProperties) + if err != nil { + return err + } + i.ImageProperties = &imageProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + i.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + i.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + i.Type = &typeVar + } + } + } + + return nil +} + +// ImageProperties properties of an image resource. +type ImageProperties struct { + // ProvisioningState - READ-ONLY; Current provisioning state of the image. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateLocked' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DisplayName - READ-ONLY; The image display name. + DisplayName *string `json:"displayName,omitempty"` + // Description - READ-ONLY; A description of the image. + Description *string `json:"description,omitempty"` + // IconURL - READ-ONLY; URL of the image icon. + IconURL *string `json:"iconUrl,omitempty"` + // Author - READ-ONLY; The image author. + Author *string `json:"author,omitempty"` + // OsType - READ-ONLY; The OS Type of the image. Possible values include: 'OsTypeWindows', 'OsTypeLinux' + OsType OsType `json:"osType,omitempty"` + // Plan - READ-ONLY; The ID of marketplace plan associated with the image (optional). + Plan *string `json:"plan,omitempty"` + // TermsStatus - READ-ONLY; The status of image terms of use (enabled = accepted, disabled = not accepted). Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + TermsStatus EnableState `json:"termsStatus,omitempty"` + // Offer - READ-ONLY; The ID of an offer associated with the image. + Offer *string `json:"offer,omitempty"` + // Publisher - READ-ONLY; The ID of the publisher of the image. + Publisher *string `json:"publisher,omitempty"` + // Sku - READ-ONLY; The image SKU. + Sku *string `json:"sku,omitempty"` + // Version - READ-ONLY; The image version. + Version *string `json:"version,omitempty"` + // SharedGalleryID - READ-ONLY; The ID for the image in the shared gallery. + SharedGalleryID *string `json:"sharedGalleryId,omitempty"` + // AvailableRegions - The available regions of the image in the shared gallery. + AvailableRegions *[]string `json:"availableRegions,omitempty"` + // OsState - READ-ONLY; The OS State of the image. Possible values include: 'OsStateGeneralized', 'OsStateSpecialized' + OsState OsState `json:"osState,omitempty"` + // EnabledState - Is the image enabled. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + EnabledState EnableState `json:"enabledState,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageProperties. +func (IP ImageProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if IP.AvailableRegions != nil { + objectMap["availableRegions"] = IP.AvailableRegions + } + if IP.EnabledState != "" { + objectMap["enabledState"] = IP.EnabledState + } + return json.Marshal(objectMap) +} + +// ImageReference image reference information. Used in the virtual machine profile. +type ImageReference struct { + // ID - Image resource ID + ID *string `json:"id,omitempty"` + // Offer - The image offer if applicable. + Offer *string `json:"offer,omitempty"` + // Publisher - The image publisher + Publisher *string `json:"publisher,omitempty"` + // Sku - The image SKU + Sku *string `json:"sku,omitempty"` + // Version - The image version specified on creation. + Version *string `json:"version,omitempty"` + // ExactVersion - READ-ONLY; The actual version of the image after use. + ExactVersion *string `json:"exactVersion,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageReference. +func (ir ImageReference) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if ir.ID != nil { + objectMap["id"] = ir.ID + } + if ir.Offer != nil { + objectMap["offer"] = ir.Offer + } + if ir.Publisher != nil { + objectMap["publisher"] = ir.Publisher + } + if ir.Sku != nil { + objectMap["sku"] = ir.Sku + } + if ir.Version != nil { + objectMap["version"] = ir.Version + } + return json.Marshal(objectMap) +} + +// ImageUpdate lab services virtual machine image for updates. +type ImageUpdate struct { + // ImageUpdateProperties - Image resource properties + *ImageUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ImageUpdate. +func (iu ImageUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if iu.ImageUpdateProperties != nil { + objectMap["properties"] = iu.ImageUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ImageUpdate struct. +func (iu *ImageUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var imageUpdateProperties ImageUpdateProperties + err = json.Unmarshal(*v, &imageUpdateProperties) + if err != nil { + return err + } + iu.ImageUpdateProperties = &imageUpdateProperties + } + } + } + + return nil +} + +// ImageUpdateProperties properties of an image resource update +type ImageUpdateProperties struct { + // EnabledState - Is the image enabled. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + EnabledState EnableState `json:"enabledState,omitempty"` +} + +// InviteBody body for a user invite request +type InviteBody struct { + // Text - Custom text for the invite email. + Text *string `json:"text,omitempty"` +} + +// Lab the lab resource. +type Lab struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the lab. + SystemData *SystemData `json:"systemData,omitempty"` + // LabProperties - Lab resource properties + *LabProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Lab. +func (l Lab) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if l.LabProperties != nil { + objectMap["properties"] = l.LabProperties + } + if l.Tags != nil { + objectMap["tags"] = l.Tags + } + if l.Location != nil { + objectMap["location"] = l.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Lab struct. +func (l *Lab) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + l.SystemData = &systemData + } + case "properties": + if v != nil { + var labProperties LabProperties + err = json.Unmarshal(*v, &labProperties) + if err != nil { + return err + } + l.LabProperties = &labProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + l.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + l.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + l.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + l.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + l.Type = &typeVar + } + } + } + + return nil +} + +// LabNetworkProfile profile for how to handle networking for Labs. +type LabNetworkProfile struct { + // SubnetID - The external subnet resource id + SubnetID *string `json:"subnetId,omitempty"` + // LoadBalancerID - The external load balancer resource id + LoadBalancerID *string `json:"loadBalancerId,omitempty"` + // PublicIPID - The external public IP resource id + PublicIPID *string `json:"publicIpId,omitempty"` +} + +// LabPlan lab Plans act as a permission container for creating labs via labs.azure.com. Additionally, they +// can provide a set of default configurations that will apply at the time of creating a lab, but these +// defaults can still be overwritten. +type LabPlan struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the lab plan. + SystemData *SystemData `json:"systemData,omitempty"` + // LabPlanProperties - Lab plan resource properties + *LabPlanProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabPlan. +func (lp LabPlan) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lp.LabPlanProperties != nil { + objectMap["properties"] = lp.LabPlanProperties + } + if lp.Tags != nil { + objectMap["tags"] = lp.Tags + } + if lp.Location != nil { + objectMap["location"] = lp.Location + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LabPlan struct. +func (lp *LabPlan) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + lp.SystemData = &systemData + } + case "properties": + if v != nil { + var labPlanProperties LabPlanProperties + err = json.Unmarshal(*v, &labPlanProperties) + if err != nil { + return err + } + lp.LabPlanProperties = &labPlanProperties + } + case "tags": + if v != nil { + var tags map[string]*string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lp.Tags = tags + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + lp.Location = &location + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + lp.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + lp.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + lp.Type = &typeVar + } + } + } + + return nil +} + +// LabPlanNetworkProfile profile for how to handle networking for Lab Plans. +type LabPlanNetworkProfile struct { + // SubnetID - The external subnet resource id + SubnetID *string `json:"subnetId,omitempty"` +} + +// LabPlanProperties lab plan resource properties +type LabPlanProperties struct { + // ProvisioningState - READ-ONLY; Current provisioning state of the lab plan. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateLocked' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DefaultConnectionProfile - The default lab connection profile. This can be changed on a lab resource and only provides a default profile. + DefaultConnectionProfile *ConnectionProfile `json:"defaultConnectionProfile,omitempty"` + // DefaultAutoShutdownProfile - The default lab shutdown profile. This can be changed on a lab resource and only provides a default profile. + DefaultAutoShutdownProfile *AutoShutdownProfile `json:"defaultAutoShutdownProfile,omitempty"` + // DefaultNetworkProfile - The lab plan network profile. To enforce lab network policies they must be defined here and cannot be changed when there are existing labs associated with this lab plan. + DefaultNetworkProfile *LabPlanNetworkProfile `json:"defaultNetworkProfile,omitempty"` + // AllowedRegions - The allowed regions for the lab creator to use when creating labs using this lab plan. + AllowedRegions *[]string `json:"allowedRegions,omitempty"` + // SharedGalleryID - Resource ID of the Shared Image Gallery attached to this lab plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be made available to use when creating new labs. + SharedGalleryID *string `json:"sharedGalleryId,omitempty"` + // SupportInfo - Support contact information and instructions for users of the lab plan. This information is displayed to lab owners and virtual machine users for all labs in the lab plan. + SupportInfo *SupportInfo `json:"supportInfo,omitempty"` + // LinkedLmsInstance - Base Url of the lms instance this lab plan can link lab rosters against. + LinkedLmsInstance *string `json:"linkedLmsInstance,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabPlanProperties. +func (lpp LabPlanProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lpp.DefaultConnectionProfile != nil { + objectMap["defaultConnectionProfile"] = lpp.DefaultConnectionProfile + } + if lpp.DefaultAutoShutdownProfile != nil { + objectMap["defaultAutoShutdownProfile"] = lpp.DefaultAutoShutdownProfile + } + if lpp.DefaultNetworkProfile != nil { + objectMap["defaultNetworkProfile"] = lpp.DefaultNetworkProfile + } + if lpp.AllowedRegions != nil { + objectMap["allowedRegions"] = lpp.AllowedRegions + } + if lpp.SharedGalleryID != nil { + objectMap["sharedGalleryId"] = lpp.SharedGalleryID + } + if lpp.SupportInfo != nil { + objectMap["supportInfo"] = lpp.SupportInfo + } + if lpp.LinkedLmsInstance != nil { + objectMap["linkedLmsInstance"] = lpp.LinkedLmsInstance + } + return json.Marshal(objectMap) +} + +// LabPlansCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LabPlansCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabPlansClient) (LabPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabPlansCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabPlansCreateOrUpdateFuture.Result. +func (future *LabPlansCreateOrUpdateFuture) result(client LabPlansClient) (lp LabPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabPlansCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lp.Response.Response, err = future.GetResult(sender); err == nil && lp.Response.Response.StatusCode != http.StatusNoContent { + lp, err = client.CreateOrUpdateResponder(lp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansCreateOrUpdateFuture", "Result", lp.Response.Response, "Failure responding to request") + } + } + return +} + +// LabPlansDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LabPlansDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabPlansDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabPlansDeleteFuture.Result. +func (future *LabPlansDeleteFuture) result(client LabPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabPlansDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LabPlansSaveImageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LabPlansSaveImageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabPlansClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabPlansSaveImageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabPlansSaveImageFuture.Result. +func (future *LabPlansSaveImageFuture) result(client LabPlansClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansSaveImageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabPlansSaveImageFuture") + return + } + ar.Response = future.Response() + return +} + +// LabPlansUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LabPlansUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabPlansClient) (LabPlan, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabPlansUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabPlansUpdateFuture.Result. +func (future *LabPlansUpdateFuture) result(client LabPlansClient) (lp LabPlan, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + lp.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabPlansUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if lp.Response.Response, err = future.GetResult(sender); err == nil && lp.Response.Response.StatusCode != http.StatusNoContent { + lp, err = client.UpdateResponder(lp.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabPlansUpdateFuture", "Result", lp.Response.Response, "Failure responding to request") + } + } + return +} + +// LabPlanUpdate contains lab configuration and default settings. This variant is used for PATCH. +type LabPlanUpdate struct { + // LabPlanUpdateProperties - Lab plan resource update properties + *LabPlanUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags *[]string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabPlanUpdate. +func (lpu LabPlanUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lpu.LabPlanUpdateProperties != nil { + objectMap["properties"] = lpu.LabPlanUpdateProperties + } + if lpu.Tags != nil { + objectMap["tags"] = lpu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LabPlanUpdate struct. +func (lpu *LabPlanUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var labPlanUpdateProperties LabPlanUpdateProperties + err = json.Unmarshal(*v, &labPlanUpdateProperties) + if err != nil { + return err + } + lpu.LabPlanUpdateProperties = &labPlanUpdateProperties + } + case "tags": + if v != nil { + var tags []string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lpu.Tags = &tags + } + } + } + + return nil +} + +// LabPlanUpdateProperties lab plan resource properties for updates +type LabPlanUpdateProperties struct { + // DefaultConnectionProfile - The default lab connection profile. This can be changed on a lab resource and only provides a default profile. + DefaultConnectionProfile *ConnectionProfile `json:"defaultConnectionProfile,omitempty"` + // DefaultAutoShutdownProfile - The default lab shutdown profile. This can be changed on a lab resource and only provides a default profile. + DefaultAutoShutdownProfile *AutoShutdownProfile `json:"defaultAutoShutdownProfile,omitempty"` + // DefaultNetworkProfile - The lab plan network profile. To enforce lab network policies they must be defined here and cannot be changed when there are existing labs associated with this lab plan. + DefaultNetworkProfile *LabPlanNetworkProfile `json:"defaultNetworkProfile,omitempty"` + // AllowedRegions - The allowed regions for the lab creator to use when creating labs using this lab plan. + AllowedRegions *[]string `json:"allowedRegions,omitempty"` + // SharedGalleryID - Resource ID of the Shared Image Gallery attached to this lab plan. When saving a lab template virtual machine image it will be persisted in this gallery. Shared images from the gallery can be made available to use when creating new labs. + SharedGalleryID *string `json:"sharedGalleryId,omitempty"` + // SupportInfo - Support contact information and instructions for users of the lab plan. This information is displayed to lab owners and virtual machine users for all labs in the lab plan. + SupportInfo *SupportInfo `json:"supportInfo,omitempty"` + // LinkedLmsInstance - Base Url of the lms instance this lab plan can link lab rosters against. + LinkedLmsInstance *string `json:"linkedLmsInstance,omitempty"` +} + +// LabProperties properties of a lab resource. +type LabProperties struct { + // ProvisioningState - READ-ONLY; Current provisioning state of the lab. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateLocked' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // NetworkProfile - The network profile for the lab, typically applied via a lab plan. This profile cannot be modified once a lab has been created. + NetworkProfile *LabNetworkProfile `json:"networkProfile,omitempty"` + // State - READ-ONLY; The lab state. Possible values include: 'LabStateDraft', 'LabStatePublishing', 'LabStateScaling', 'LabStateSyncing', 'LabStatePublished' + State LabState `json:"state,omitempty"` + // AutoShutdownProfile - The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. + AutoShutdownProfile *AutoShutdownProfile `json:"autoShutdownProfile,omitempty"` + // ConnectionProfile - The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. + ConnectionProfile *ConnectionProfile `json:"connectionProfile,omitempty"` + // VirtualMachineProfile - The profile used for creating lab virtual machines. + VirtualMachineProfile *VirtualMachineProfile `json:"virtualMachineProfile,omitempty"` + // SecurityProfile - The lab security profile. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // RosterProfile - The lab user list management profile. + RosterProfile *RosterProfile `json:"rosterProfile,omitempty"` + // LabPlanID - The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. + LabPlanID *string `json:"labPlanId,omitempty"` + // Title - The title of the lab. + Title *string `json:"title,omitempty"` + // Description - The description of the lab. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabProperties. +func (lp LabProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lp.NetworkProfile != nil { + objectMap["networkProfile"] = lp.NetworkProfile + } + if lp.AutoShutdownProfile != nil { + objectMap["autoShutdownProfile"] = lp.AutoShutdownProfile + } + if lp.ConnectionProfile != nil { + objectMap["connectionProfile"] = lp.ConnectionProfile + } + if lp.VirtualMachineProfile != nil { + objectMap["virtualMachineProfile"] = lp.VirtualMachineProfile + } + if lp.SecurityProfile != nil { + objectMap["securityProfile"] = lp.SecurityProfile + } + if lp.RosterProfile != nil { + objectMap["rosterProfile"] = lp.RosterProfile + } + if lp.LabPlanID != nil { + objectMap["labPlanId"] = lp.LabPlanID + } + if lp.Title != nil { + objectMap["title"] = lp.Title + } + if lp.Description != nil { + objectMap["description"] = lp.Description + } + return json.Marshal(objectMap) +} + +// LabsCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LabsCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabsClient) (Lab, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabsCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabsCreateOrUpdateFuture.Result. +func (future *LabsCreateOrUpdateFuture) result(client LabsClient) (l Lab, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + l.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabsCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if l.Response.Response, err = future.GetResult(sender); err == nil && l.Response.Response.StatusCode != http.StatusNoContent { + l, err = client.CreateOrUpdateResponder(l.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsCreateOrUpdateFuture", "Result", l.Response.Response, "Failure responding to request") + } + } + return +} + +// LabsDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LabsDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabsDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabsDeleteFuture.Result. +func (future *LabsDeleteFuture) result(client LabsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabsDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// LabsPublishFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LabsPublishFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabsPublishFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabsPublishFuture.Result. +func (future *LabsPublishFuture) result(client LabsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsPublishFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabsPublishFuture") + return + } + ar.Response = future.Response() + return +} + +// LabsSyncGroupFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type LabsSyncGroupFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabsClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabsSyncGroupFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabsSyncGroupFuture.Result. +func (future *LabsSyncGroupFuture) result(client LabsClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsSyncGroupFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabsSyncGroupFuture") + return + } + ar.Response = future.Response() + return +} + +// LabsUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type LabsUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(LabsClient) (Lab, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *LabsUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for LabsUpdateFuture.Result. +func (future *LabsUpdateFuture) result(client LabsClient) (l Lab, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + l.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.LabsUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if l.Response.Response, err = future.GetResult(sender); err == nil && l.Response.Response.StatusCode != http.StatusNoContent { + l, err = client.UpdateResponder(l.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.LabsUpdateFuture", "Result", l.Response.Response, "Failure responding to request") + } + } + return +} + +// LabUpdate the lab resource for updates. +type LabUpdate struct { + // LabUpdateProperties - Lab resource properties + *LabUpdateProperties `json:"properties,omitempty"` + // Tags - Resource tags. + Tags *[]string `json:"tags,omitempty"` +} + +// MarshalJSON is the custom marshaler for LabUpdate. +func (lu LabUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if lu.LabUpdateProperties != nil { + objectMap["properties"] = lu.LabUpdateProperties + } + if lu.Tags != nil { + objectMap["tags"] = lu.Tags + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for LabUpdate struct. +func (lu *LabUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var labUpdateProperties LabUpdateProperties + err = json.Unmarshal(*v, &labUpdateProperties) + if err != nil { + return err + } + lu.LabUpdateProperties = &labUpdateProperties + } + case "tags": + if v != nil { + var tags []string + err = json.Unmarshal(*v, &tags) + if err != nil { + return err + } + lu.Tags = &tags + } + } + } + + return nil +} + +// LabUpdateProperties properties of a lab resource used for updates. +type LabUpdateProperties struct { + // AutoShutdownProfile - The resource auto shutdown configuration for the lab. This controls whether actions are taken on resources that are sitting idle. + AutoShutdownProfile *AutoShutdownProfile `json:"autoShutdownProfile,omitempty"` + // ConnectionProfile - The connection profile for the lab. This controls settings such as web access to lab resources or whether RDP or SSH ports are open. + ConnectionProfile *ConnectionProfile `json:"connectionProfile,omitempty"` + // VirtualMachineProfile - The profile used for creating lab virtual machines. + VirtualMachineProfile *VirtualMachineProfile `json:"virtualMachineProfile,omitempty"` + // SecurityProfile - The lab security profile. + SecurityProfile *SecurityProfile `json:"securityProfile,omitempty"` + // RosterProfile - The lab user list management profile. + RosterProfile *RosterProfile `json:"rosterProfile,omitempty"` + // LabPlanID - The ID of the lab plan. Used during resource creation to provide defaults and acts as a permission container when creating a lab via labs.azure.com. Setting a labPlanId on an existing lab provides organization.. + LabPlanID *string `json:"labPlanId,omitempty"` + // Title - The title of the lab. + Title *string `json:"title,omitempty"` + // Description - The description of the lab. + Description *string `json:"description,omitempty"` +} + +// ListUsagesResult list of Core Usages. +type ListUsagesResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of Usages. + Value *[]Usage `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of Usage result. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for ListUsagesResult. +func (lur ListUsagesResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ListUsagesResultIterator provides access to a complete listing of Usage values. +type ListUsagesResultIterator struct { + i int + page ListUsagesResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *ListUsagesResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *ListUsagesResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter ListUsagesResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter ListUsagesResultIterator) Response() ListUsagesResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter ListUsagesResultIterator) Value() Usage { + if !iter.page.NotDone() { + return Usage{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the ListUsagesResultIterator type. +func NewListUsagesResultIterator(page ListUsagesResultPage) ListUsagesResultIterator { + return ListUsagesResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (lur ListUsagesResult) IsEmpty() bool { + return lur.Value == nil || len(*lur.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (lur ListUsagesResult) hasNextLink() bool { + return lur.NextLink != nil && len(*lur.NextLink) != 0 +} + +// listUsagesResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (lur ListUsagesResult) listUsagesResultPreparer(ctx context.Context) (*http.Request, error) { + if !lur.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(lur.NextLink))) +} + +// ListUsagesResultPage contains a page of Usage values. +type ListUsagesResultPage struct { + fn func(context.Context, ListUsagesResult) (ListUsagesResult, error) + lur ListUsagesResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *ListUsagesResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/ListUsagesResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.lur) + if err != nil { + return err + } + page.lur = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *ListUsagesResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page ListUsagesResultPage) NotDone() bool { + return !page.lur.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page ListUsagesResultPage) Response() ListUsagesResult { + return page.lur +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page ListUsagesResultPage) Values() []Usage { + if page.lur.IsEmpty() { + return nil + } + return *page.lur.Value +} + +// Creates a new instance of the ListUsagesResultPage type. +func NewListUsagesResultPage(cur ListUsagesResult, getNextPage func(context.Context, ListUsagesResult) (ListUsagesResult, error)) ListUsagesResultPage { + return ListUsagesResultPage{ + fn: getNextPage, + lur: cur, + } +} + +// Operation details of a REST API operation, returned from the Resource Provider Operations API +type Operation struct { + // Name - READ-ONLY; The name of the operation, as per Resource-Based Access Control (RBAC). Examples: "Microsoft.Compute/virtualMachines/write", "Microsoft.Compute/virtualMachines/capture/action" + Name *string `json:"name,omitempty"` + // IsDataAction - READ-ONLY; Whether the operation applies to data-plane. This is "true" for data-plane operations and "false" for ARM/control-plane operations. + IsDataAction *bool `json:"isDataAction,omitempty"` + // Display - Localized display information for this particular operation. + Display *OperationDisplay `json:"display,omitempty"` + // Origin - READ-ONLY; The intended executor of the operation; as in Resource Based Access Control (RBAC) and audit logs UX. Default value is "user,system". Possible values include: 'OriginUser', 'OriginSystem', 'OriginUsersystem' + Origin Origin `json:"origin,omitempty"` + // ActionType - READ-ONLY; Enum. Indicates the action type. "Internal" refers to actions that are for internal only APIs. Possible values include: 'ActionTypeInternal' + ActionType ActionType `json:"actionType,omitempty"` +} + +// MarshalJSON is the custom marshaler for Operation. +func (o Operation) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if o.Display != nil { + objectMap["display"] = o.Display + } + return json.Marshal(objectMap) +} + +// OperationDisplay localized display information for this particular operation. +type OperationDisplay struct { + // Provider - READ-ONLY; The localized friendly form of the resource provider name, e.g. "Microsoft Monitoring Insights" or "Microsoft Compute". + Provider *string `json:"provider,omitempty"` + // Resource - READ-ONLY; The localized friendly name of the resource type related to this operation. E.g. "Virtual Machines" or "Job Schedule Collections". + Resource *string `json:"resource,omitempty"` + // Operation - READ-ONLY; The concise, localized friendly name for the operation; suitable for dropdowns. E.g. "Create or Update Virtual Machine", "Restart Virtual Machine". + Operation *string `json:"operation,omitempty"` + // Description - READ-ONLY; The short, localized friendly description of the operation; suitable for tool tips and detailed views. + Description *string `json:"description,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationDisplay. +func (o OperationDisplay) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResult a list of REST API operations supported by an Azure Resource Provider. It contains +// an URL link to get the next set of results. +type OperationListResult struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; List of operations supported by the resource provider + Value *[]Operation `json:"value,omitempty"` + // NextLink - READ-ONLY; URL to get the next set of operation list results (if there are any). + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationListResult. +func (olr OperationListResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// OperationListResultIterator provides access to a complete listing of Operation values. +type OperationListResultIterator struct { + i int + page OperationListResultPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *OperationListResultIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *OperationListResultIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter OperationListResultIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter OperationListResultIterator) Response() OperationListResult { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter OperationListResultIterator) Value() Operation { + if !iter.page.NotDone() { + return Operation{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the OperationListResultIterator type. +func NewOperationListResultIterator(page OperationListResultPage) OperationListResultIterator { + return OperationListResultIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (olr OperationListResult) IsEmpty() bool { + return olr.Value == nil || len(*olr.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (olr OperationListResult) hasNextLink() bool { + return olr.NextLink != nil && len(*olr.NextLink) != 0 +} + +// operationListResultPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (olr OperationListResult) operationListResultPreparer(ctx context.Context) (*http.Request, error) { + if !olr.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(olr.NextLink))) +} + +// OperationListResultPage contains a page of Operation values. +type OperationListResultPage struct { + fn func(context.Context, OperationListResult) (OperationListResult, error) + olr OperationListResult +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *OperationListResultPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationListResultPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.olr) + if err != nil { + return err + } + page.olr = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *OperationListResultPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page OperationListResultPage) NotDone() bool { + return !page.olr.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page OperationListResultPage) Response() OperationListResult { + return page.olr +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page OperationListResultPage) Values() []Operation { + if page.olr.IsEmpty() { + return nil + } + return *page.olr.Value +} + +// Creates a new instance of the OperationListResultPage type. +func NewOperationListResultPage(cur OperationListResult, getNextPage func(context.Context, OperationListResult) (OperationListResult, error)) OperationListResultPage { + return OperationListResultPage{ + fn: getNextPage, + olr: cur, + } +} + +// OperationResult a long running operation result +type OperationResult struct { + autorest.Response `json:"-"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Status - The operation status. Possible values include: 'OperationStatusNotStarted', 'OperationStatusInProgress', 'OperationStatusSucceeded', 'OperationStatusFailed', 'OperationStatusCanceled' + Status OperationStatus `json:"status,omitempty"` + // StartTime - Start time + StartTime *date.Time `json:"startTime,omitempty"` + // EndTime - End time + EndTime *date.Time `json:"endTime,omitempty"` + // PercentComplete - Percent completion + PercentComplete *float64 `json:"percentComplete,omitempty"` + // Error - The error for a failure if the operation failed. + Error *ErrorDetail `json:"error,omitempty"` +} + +// MarshalJSON is the custom marshaler for OperationResult. +func (or OperationResult) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if or.Status != "" { + objectMap["status"] = or.Status + } + if or.StartTime != nil { + objectMap["startTime"] = or.StartTime + } + if or.EndTime != nil { + objectMap["endTime"] = or.EndTime + } + if or.PercentComplete != nil { + objectMap["percentComplete"] = or.PercentComplete + } + if or.Error != nil { + objectMap["error"] = or.Error + } + return json.Marshal(objectMap) +} + +// PagedImages paged list of Lab services virtual machine images. +type PagedImages struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of virtual machine images. + Value *[]Image `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of image results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedImages. +func (pi PagedImages) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedImagesIterator provides access to a complete listing of Image values. +type PagedImagesIterator struct { + i int + page PagedImagesPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedImagesIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedImagesIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedImagesIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedImagesIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedImagesIterator) Response() PagedImages { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedImagesIterator) Value() Image { + if !iter.page.NotDone() { + return Image{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedImagesIterator type. +func NewPagedImagesIterator(page PagedImagesPage) PagedImagesIterator { + return PagedImagesIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pi PagedImages) IsEmpty() bool { + return pi.Value == nil || len(*pi.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pi PagedImages) hasNextLink() bool { + return pi.NextLink != nil && len(*pi.NextLink) != 0 +} + +// pagedImagesPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pi PagedImages) pagedImagesPreparer(ctx context.Context) (*http.Request, error) { + if !pi.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pi.NextLink))) +} + +// PagedImagesPage contains a page of Image values. +type PagedImagesPage struct { + fn func(context.Context, PagedImages) (PagedImages, error) + pi PagedImages +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedImagesPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedImagesPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pi) + if err != nil { + return err + } + page.pi = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedImagesPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedImagesPage) NotDone() bool { + return !page.pi.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedImagesPage) Response() PagedImages { + return page.pi +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedImagesPage) Values() []Image { + if page.pi.IsEmpty() { + return nil + } + return *page.pi.Value +} + +// Creates a new instance of the PagedImagesPage type. +func NewPagedImagesPage(cur PagedImages, getNextPage func(context.Context, PagedImages) (PagedImages, error)) PagedImagesPage { + return PagedImagesPage{ + fn: getNextPage, + pi: cur, + } +} + +// PagedLabPlans paged list of lab plans. +type PagedLabPlans struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of lab plans. + Value *[]LabPlan `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of lab plan results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedLabPlans. +func (plp PagedLabPlans) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedLabPlansIterator provides access to a complete listing of LabPlan values. +type PagedLabPlansIterator struct { + i int + page PagedLabPlansPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedLabPlansIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedLabPlansIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedLabPlansIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedLabPlansIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedLabPlansIterator) Response() PagedLabPlans { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedLabPlansIterator) Value() LabPlan { + if !iter.page.NotDone() { + return LabPlan{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedLabPlansIterator type. +func NewPagedLabPlansIterator(page PagedLabPlansPage) PagedLabPlansIterator { + return PagedLabPlansIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plp PagedLabPlans) IsEmpty() bool { + return plp.Value == nil || len(*plp.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plp PagedLabPlans) hasNextLink() bool { + return plp.NextLink != nil && len(*plp.NextLink) != 0 +} + +// pagedLabPlansPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plp PagedLabPlans) pagedLabPlansPreparer(ctx context.Context) (*http.Request, error) { + if !plp.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plp.NextLink))) +} + +// PagedLabPlansPage contains a page of LabPlan values. +type PagedLabPlansPage struct { + fn func(context.Context, PagedLabPlans) (PagedLabPlans, error) + plp PagedLabPlans +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedLabPlansPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedLabPlansPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plp) + if err != nil { + return err + } + page.plp = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedLabPlansPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedLabPlansPage) NotDone() bool { + return !page.plp.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedLabPlansPage) Response() PagedLabPlans { + return page.plp +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedLabPlansPage) Values() []LabPlan { + if page.plp.IsEmpty() { + return nil + } + return *page.plp.Value +} + +// Creates a new instance of the PagedLabPlansPage type. +func NewPagedLabPlansPage(cur PagedLabPlans, getNextPage func(context.Context, PagedLabPlans) (PagedLabPlans, error)) PagedLabPlansPage { + return PagedLabPlansPage{ + fn: getNextPage, + plp: cur, + } +} + +// PagedLabs paged list of labs. +type PagedLabs struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of lab results. + Value *[]Lab `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of image results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedLabs. +func (pl PagedLabs) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedLabServicesSkus paged list of lab services skus. +type PagedLabServicesSkus struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of sku results. + Value *[]SkuType `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of sku results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedLabServicesSkus. +func (plss PagedLabServicesSkus) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedLabServicesSkusIterator provides access to a complete listing of SkuType values. +type PagedLabServicesSkusIterator struct { + i int + page PagedLabServicesSkusPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedLabServicesSkusIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedLabServicesSkusIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedLabServicesSkusIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedLabServicesSkusIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedLabServicesSkusIterator) Response() PagedLabServicesSkus { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedLabServicesSkusIterator) Value() SkuType { + if !iter.page.NotDone() { + return SkuType{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedLabServicesSkusIterator type. +func NewPagedLabServicesSkusIterator(page PagedLabServicesSkusPage) PagedLabServicesSkusIterator { + return PagedLabServicesSkusIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (plss PagedLabServicesSkus) IsEmpty() bool { + return plss.Value == nil || len(*plss.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (plss PagedLabServicesSkus) hasNextLink() bool { + return plss.NextLink != nil && len(*plss.NextLink) != 0 +} + +// pagedLabServicesSkusPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (plss PagedLabServicesSkus) pagedLabServicesSkusPreparer(ctx context.Context) (*http.Request, error) { + if !plss.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(plss.NextLink))) +} + +// PagedLabServicesSkusPage contains a page of SkuType values. +type PagedLabServicesSkusPage struct { + fn func(context.Context, PagedLabServicesSkus) (PagedLabServicesSkus, error) + plss PagedLabServicesSkus +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedLabServicesSkusPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedLabServicesSkusPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.plss) + if err != nil { + return err + } + page.plss = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedLabServicesSkusPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedLabServicesSkusPage) NotDone() bool { + return !page.plss.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedLabServicesSkusPage) Response() PagedLabServicesSkus { + return page.plss +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedLabServicesSkusPage) Values() []SkuType { + if page.plss.IsEmpty() { + return nil + } + return *page.plss.Value +} + +// Creates a new instance of the PagedLabServicesSkusPage type. +func NewPagedLabServicesSkusPage(cur PagedLabServicesSkus, getNextPage func(context.Context, PagedLabServicesSkus) (PagedLabServicesSkus, error)) PagedLabServicesSkusPage { + return PagedLabServicesSkusPage{ + fn: getNextPage, + plss: cur, + } +} + +// PagedLabsIterator provides access to a complete listing of Lab values. +type PagedLabsIterator struct { + i int + page PagedLabsPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedLabsIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedLabsIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedLabsIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedLabsIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedLabsIterator) Response() PagedLabs { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedLabsIterator) Value() Lab { + if !iter.page.NotDone() { + return Lab{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedLabsIterator type. +func NewPagedLabsIterator(page PagedLabsPage) PagedLabsIterator { + return PagedLabsIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pl PagedLabs) IsEmpty() bool { + return pl.Value == nil || len(*pl.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pl PagedLabs) hasNextLink() bool { + return pl.NextLink != nil && len(*pl.NextLink) != 0 +} + +// pagedLabsPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pl PagedLabs) pagedLabsPreparer(ctx context.Context) (*http.Request, error) { + if !pl.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pl.NextLink))) +} + +// PagedLabsPage contains a page of Lab values. +type PagedLabsPage struct { + fn func(context.Context, PagedLabs) (PagedLabs, error) + pl PagedLabs +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedLabsPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedLabsPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pl) + if err != nil { + return err + } + page.pl = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedLabsPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedLabsPage) NotDone() bool { + return !page.pl.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedLabsPage) Response() PagedLabs { + return page.pl +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedLabsPage) Values() []Lab { + if page.pl.IsEmpty() { + return nil + } + return *page.pl.Value +} + +// Creates a new instance of the PagedLabsPage type. +func NewPagedLabsPage(cur PagedLabs, getNextPage func(context.Context, PagedLabs) (PagedLabs, error)) PagedLabsPage { + return PagedLabsPage{ + fn: getNextPage, + pl: cur, + } +} + +// PagedSchedules paged list of schedules. +type PagedSchedules struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of schedule results. + Value *[]Schedule `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of schedule results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedSchedules. +func (ps PagedSchedules) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedSchedulesIterator provides access to a complete listing of Schedule values. +type PagedSchedulesIterator struct { + i int + page PagedSchedulesPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedSchedulesIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedSchedulesIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedSchedulesIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedSchedulesIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedSchedulesIterator) Response() PagedSchedules { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedSchedulesIterator) Value() Schedule { + if !iter.page.NotDone() { + return Schedule{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedSchedulesIterator type. +func NewPagedSchedulesIterator(page PagedSchedulesPage) PagedSchedulesIterator { + return PagedSchedulesIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (ps PagedSchedules) IsEmpty() bool { + return ps.Value == nil || len(*ps.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (ps PagedSchedules) hasNextLink() bool { + return ps.NextLink != nil && len(*ps.NextLink) != 0 +} + +// pagedSchedulesPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (ps PagedSchedules) pagedSchedulesPreparer(ctx context.Context) (*http.Request, error) { + if !ps.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(ps.NextLink))) +} + +// PagedSchedulesPage contains a page of Schedule values. +type PagedSchedulesPage struct { + fn func(context.Context, PagedSchedules) (PagedSchedules, error) + ps PagedSchedules +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedSchedulesPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedSchedulesPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.ps) + if err != nil { + return err + } + page.ps = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedSchedulesPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedSchedulesPage) NotDone() bool { + return !page.ps.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedSchedulesPage) Response() PagedSchedules { + return page.ps +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedSchedulesPage) Values() []Schedule { + if page.ps.IsEmpty() { + return nil + } + return *page.ps.Value +} + +// Creates a new instance of the PagedSchedulesPage type. +func NewPagedSchedulesPage(cur PagedSchedules, getNextPage func(context.Context, PagedSchedules) (PagedSchedules, error)) PagedSchedulesPage { + return PagedSchedulesPage{ + fn: getNextPage, + ps: cur, + } +} + +// PagedUsers paged list of users. +type PagedUsers struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of user results. + Value *[]User `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of image results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedUsers. +func (pu PagedUsers) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedUsersIterator provides access to a complete listing of User values. +type PagedUsersIterator struct { + i int + page PagedUsersPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedUsersIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedUsersIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedUsersIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedUsersIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedUsersIterator) Response() PagedUsers { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedUsersIterator) Value() User { + if !iter.page.NotDone() { + return User{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedUsersIterator type. +func NewPagedUsersIterator(page PagedUsersPage) PagedUsersIterator { + return PagedUsersIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pu PagedUsers) IsEmpty() bool { + return pu.Value == nil || len(*pu.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pu PagedUsers) hasNextLink() bool { + return pu.NextLink != nil && len(*pu.NextLink) != 0 +} + +// pagedUsersPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pu PagedUsers) pagedUsersPreparer(ctx context.Context) (*http.Request, error) { + if !pu.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pu.NextLink))) +} + +// PagedUsersPage contains a page of User values. +type PagedUsersPage struct { + fn func(context.Context, PagedUsers) (PagedUsers, error) + pu PagedUsers +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedUsersPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedUsersPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pu) + if err != nil { + return err + } + page.pu = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedUsersPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedUsersPage) NotDone() bool { + return !page.pu.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedUsersPage) Response() PagedUsers { + return page.pu +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedUsersPage) Values() []User { + if page.pu.IsEmpty() { + return nil + } + return *page.pu.Value +} + +// Creates a new instance of the PagedUsersPage type. +func NewPagedUsersPage(cur PagedUsers, getNextPage func(context.Context, PagedUsers) (PagedUsers, error)) PagedUsersPage { + return PagedUsersPage{ + fn: getNextPage, + pu: cur, + } +} + +// PagedVirtualMachines paged list of lab services virtual machines. +type PagedVirtualMachines struct { + autorest.Response `json:"-"` + // Value - READ-ONLY; The array page of virtual machine results. + Value *[]VirtualMachine `json:"value,omitempty"` + // NextLink - READ-ONLY; The link to get the next page of virtual machine results. + NextLink *string `json:"nextLink,omitempty"` +} + +// MarshalJSON is the custom marshaler for PagedVirtualMachines. +func (pvm PagedVirtualMachines) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// PagedVirtualMachinesIterator provides access to a complete listing of VirtualMachine values. +type PagedVirtualMachinesIterator struct { + i int + page PagedVirtualMachinesPage +} + +// NextWithContext advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +func (iter *PagedVirtualMachinesIterator) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedVirtualMachinesIterator.NextWithContext") + defer func() { + sc := -1 + if iter.Response().Response.Response != nil { + sc = iter.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + iter.i++ + if iter.i < len(iter.page.Values()) { + return nil + } + err = iter.page.NextWithContext(ctx) + if err != nil { + iter.i-- + return err + } + iter.i = 0 + return nil +} + +// Next advances to the next value. If there was an error making +// the request the iterator does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (iter *PagedVirtualMachinesIterator) Next() error { + return iter.NextWithContext(context.Background()) +} + +// NotDone returns true if the enumeration should be started or is not yet complete. +func (iter PagedVirtualMachinesIterator) NotDone() bool { + return iter.page.NotDone() && iter.i < len(iter.page.Values()) +} + +// Response returns the raw server response from the last page request. +func (iter PagedVirtualMachinesIterator) Response() PagedVirtualMachines { + return iter.page.Response() +} + +// Value returns the current value or a zero-initialized value if the +// iterator has advanced beyond the end of the collection. +func (iter PagedVirtualMachinesIterator) Value() VirtualMachine { + if !iter.page.NotDone() { + return VirtualMachine{} + } + return iter.page.Values()[iter.i] +} + +// Creates a new instance of the PagedVirtualMachinesIterator type. +func NewPagedVirtualMachinesIterator(page PagedVirtualMachinesPage) PagedVirtualMachinesIterator { + return PagedVirtualMachinesIterator{page: page} +} + +// IsEmpty returns true if the ListResult contains no values. +func (pvm PagedVirtualMachines) IsEmpty() bool { + return pvm.Value == nil || len(*pvm.Value) == 0 +} + +// hasNextLink returns true if the NextLink is not empty. +func (pvm PagedVirtualMachines) hasNextLink() bool { + return pvm.NextLink != nil && len(*pvm.NextLink) != 0 +} + +// pagedVirtualMachinesPreparer prepares a request to retrieve the next set of results. +// It returns nil if no more results exist. +func (pvm PagedVirtualMachines) pagedVirtualMachinesPreparer(ctx context.Context) (*http.Request, error) { + if !pvm.hasNextLink() { + return nil, nil + } + return autorest.Prepare((&http.Request{}).WithContext(ctx), + autorest.AsJSON(), + autorest.AsGet(), + autorest.WithBaseURL(to.String(pvm.NextLink))) +} + +// PagedVirtualMachinesPage contains a page of VirtualMachine values. +type PagedVirtualMachinesPage struct { + fn func(context.Context, PagedVirtualMachines) (PagedVirtualMachines, error) + pvm PagedVirtualMachines +} + +// NextWithContext advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +func (page *PagedVirtualMachinesPage) NextWithContext(ctx context.Context) (err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/PagedVirtualMachinesPage.NextWithContext") + defer func() { + sc := -1 + if page.Response().Response.Response != nil { + sc = page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + for { + next, err := page.fn(ctx, page.pvm) + if err != nil { + return err + } + page.pvm = next + if !next.hasNextLink() || !next.IsEmpty() { + break + } + } + return nil +} + +// Next advances to the next page of values. If there was an error making +// the request the page does not advance and the error is returned. +// Deprecated: Use NextWithContext() instead. +func (page *PagedVirtualMachinesPage) Next() error { + return page.NextWithContext(context.Background()) +} + +// NotDone returns true if the page enumeration should be started or is not yet complete. +func (page PagedVirtualMachinesPage) NotDone() bool { + return !page.pvm.IsEmpty() +} + +// Response returns the raw server response from the last page request. +func (page PagedVirtualMachinesPage) Response() PagedVirtualMachines { + return page.pvm +} + +// Values returns the slice of values for the current page or nil if there are no values. +func (page PagedVirtualMachinesPage) Values() []VirtualMachine { + if page.pvm.IsEmpty() { + return nil + } + return *page.pvm.Value +} + +// Creates a new instance of the PagedVirtualMachinesPage type. +func NewPagedVirtualMachinesPage(cur PagedVirtualMachines, getNextPage func(context.Context, PagedVirtualMachines) (PagedVirtualMachines, error)) PagedVirtualMachinesPage { + return PagedVirtualMachinesPage{ + fn: getNextPage, + pvm: cur, + } +} + +// Plan plan for the resource. +type Plan struct { + // Name - A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + // Publisher - The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + // Product - The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + // PromotionCode - A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + // Version - The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + +// ProxyResource the resource model definition for a Azure Resource Manager proxy resource. It will not +// have tags and a location +type ProxyResource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ProxyResource. +func (pr ProxyResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// RecurrencePattern recurrence pattern of a lab schedule. +type RecurrencePattern struct { + // Frequency - The frequency of the recurrence. Possible values include: 'RecurrenceFrequencyDaily', 'RecurrenceFrequencyWeekly' + Frequency RecurrenceFrequency `json:"frequency,omitempty"` + // WeekDays - The week days the schedule runs. Used for when the Frequency is set to Weekly. + WeekDays *[]WeekDay `json:"weekDays,omitempty"` + // Interval - The interval to invoke the schedule on. For example, interval = 2 and RecurrenceFrequency.Daily will run every 2 days. When no interval is supplied, an interval of 1 is used. + Interval *int32 `json:"interval,omitempty"` + // ExpirationDate - When the recurrence will expire. This date is inclusive. + ExpirationDate *date.Date `json:"expirationDate,omitempty"` +} + +// ResetPasswordBody body of a reset password request. +type ResetPasswordBody struct { + // Username - The user whose password is being reset + Username *string `json:"username,omitempty"` + // Password - The password + Password *string `json:"password,omitempty"` +} + +// Resource common fields that are returned in the response for all Azure Resource Manager resources +type Resource struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Resource. +func (r Resource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// ResourceModelWithAllowedPropertySet the resource model definition containing the full set of allowed +// properties for a resource. Except properties bag, there cannot be a top level property outside of this +// set. +type ResourceModelWithAllowedPropertySet struct { + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ManagedBy - The fully qualified resource ID of the resource that manages this resource. Indicates if this resource is managed by another Azure resource. If this is present, complete mode deployment will not delete the resource if it is removed from the template since it is managed by another resource. + ManagedBy *string `json:"managedBy,omitempty"` + // Kind - Metadata used by portal/tooling/etc to render different UX experiences for resources of the same type; e.g. ApiApps are a kind of Microsoft.Web/sites type. If supported, the resource provider must validate and persist this value. + Kind *string `json:"kind,omitempty"` + // Etag - READ-ONLY; The etag field is *not* required. If it is provided in the response body, it must also be provided as a header per the normal etag convention. Entity tags are used for comparing two or more entities from the same requested resource. HTTP/1.1 uses entity tags in the etag (section 14.19), If-Match (section 14.24), If-None-Match (section 14.26), and If-Range (section 14.27) header fields. + Etag *string `json:"etag,omitempty"` + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + Identity *ResourceModelWithAllowedPropertySetIdentity `json:"identity,omitempty"` + Sku *ResourceModelWithAllowedPropertySetSku `json:"sku,omitempty"` + Plan *ResourceModelWithAllowedPropertySetPlan `json:"plan,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceModelWithAllowedPropertySet. +func (rmwaps ResourceModelWithAllowedPropertySet) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmwaps.Location != nil { + objectMap["location"] = rmwaps.Location + } + if rmwaps.ManagedBy != nil { + objectMap["managedBy"] = rmwaps.ManagedBy + } + if rmwaps.Kind != nil { + objectMap["kind"] = rmwaps.Kind + } + if rmwaps.Tags != nil { + objectMap["tags"] = rmwaps.Tags + } + if rmwaps.Identity != nil { + objectMap["identity"] = rmwaps.Identity + } + if rmwaps.Sku != nil { + objectMap["sku"] = rmwaps.Sku + } + if rmwaps.Plan != nil { + objectMap["plan"] = rmwaps.Plan + } + return json.Marshal(objectMap) +} + +// ResourceModelWithAllowedPropertySetIdentity ... +type ResourceModelWithAllowedPropertySetIdentity struct { + // PrincipalID - READ-ONLY; The principal ID of resource identity. + PrincipalID *string `json:"principalId,omitempty"` + // TenantID - READ-ONLY; The tenant ID of resource. + TenantID *string `json:"tenantId,omitempty"` + // Type - The identity type. Possible values include: 'ResourceIdentityTypeSystemAssigned' + Type ResourceIdentityType `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ResourceModelWithAllowedPropertySetIdentity. +func (rmwaps ResourceModelWithAllowedPropertySetIdentity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rmwaps.Type != "" { + objectMap["type"] = rmwaps.Type + } + return json.Marshal(objectMap) +} + +// ResourceModelWithAllowedPropertySetPlan ... +type ResourceModelWithAllowedPropertySetPlan struct { + // Name - A user defined name of the 3rd Party Artifact that is being procured. + Name *string `json:"name,omitempty"` + // Publisher - The publisher of the 3rd Party Artifact that is being bought. E.g. NewRelic + Publisher *string `json:"publisher,omitempty"` + // Product - The 3rd Party artifact that is being procured. E.g. NewRelic. Product maps to the OfferID specified for the artifact at the time of Data Market onboarding. + Product *string `json:"product,omitempty"` + // PromotionCode - A publisher provided promotion code as provisioned in Data Market for the said product/artifact. + PromotionCode *string `json:"promotionCode,omitempty"` + // Version - The version of the desired product/artifact. + Version *string `json:"version,omitempty"` +} + +// ResourceModelWithAllowedPropertySetSku ... +type ResourceModelWithAllowedPropertySetSku struct { + // Name - The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string `json:"name,omitempty"` + // Tier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'SkuTierFree', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` + // Size - The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + // Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + Capacity *int32 `json:"capacity,omitempty"` +} + +// RosterProfile the lab user list management profile. +type RosterProfile struct { + // ActiveDirectoryGroupID - The AAD group ID which this lab roster is populated from. Having this set enables AAD sync mode. + ActiveDirectoryGroupID *string `json:"activeDirectoryGroupId,omitempty"` + // LtiContextID - The unique context identifier for the lab in the lms. + LtiContextID *string `json:"ltiContextId,omitempty"` + // LmsInstance - The base URI identifying the lms instance. + LmsInstance *string `json:"lmsInstance,omitempty"` + // LtiClientID - The unique id of the azure lab services tool in the lms. + LtiClientID *string `json:"ltiClientId,omitempty"` + // LtiRosterEndpoint - The uri of the names and roles service endpoint on the lms for the class attached to this lab. + LtiRosterEndpoint *string `json:"ltiRosterEndpoint,omitempty"` +} + +// SaveImageBody body for the save image POST +type SaveImageBody struct { + // Name - The name for the image we create. + Name *string `json:"name,omitempty"` + // LabVirtualMachineID - The ID of the lab virtual machine you want to save an image from. + LabVirtualMachineID *string `json:"labVirtualMachineId,omitempty"` +} + +// Schedule schedule for automatically turning virtual machines in a lab on and off at specified times. +type Schedule struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the schedule. + SystemData *SystemData `json:"systemData,omitempty"` + // ScheduleProperties - Schedule resource properties + *ScheduleProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for Schedule. +func (s Schedule) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if s.ScheduleProperties != nil { + objectMap["properties"] = s.ScheduleProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for Schedule struct. +func (s *Schedule) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + s.SystemData = &systemData + } + case "properties": + if v != nil { + var scheduleProperties ScheduleProperties + err = json.Unmarshal(*v, &scheduleProperties) + if err != nil { + return err + } + s.ScheduleProperties = &scheduleProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + s.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + s.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + s.Type = &typeVar + } + } + } + + return nil +} + +// ScheduleProperties schedule resource properties +type ScheduleProperties struct { + // ProvisioningState - READ-ONLY; Current provisioning state of the schedule. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateLocked' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // StartAt - When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. + StartAt *date.Time `json:"startAt,omitempty"` + // StopAt - When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. + StopAt *date.Time `json:"stopAt,omitempty"` + // RecurrencePattern - The recurrence pattern of the scheduled actions. + RecurrencePattern *RecurrencePattern `json:"recurrencePattern,omitempty"` + // TimeZoneID - The IANA timezone id for the schedule. + TimeZoneID *string `json:"timeZoneId,omitempty"` + // Notes - Notes for this schedule. + Notes *string `json:"notes,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleProperties. +func (sp ScheduleProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.StartAt != nil { + objectMap["startAt"] = sp.StartAt + } + if sp.StopAt != nil { + objectMap["stopAt"] = sp.StopAt + } + if sp.RecurrencePattern != nil { + objectMap["recurrencePattern"] = sp.RecurrencePattern + } + if sp.TimeZoneID != nil { + objectMap["timeZoneId"] = sp.TimeZoneID + } + if sp.Notes != nil { + objectMap["notes"] = sp.Notes + } + return json.Marshal(objectMap) +} + +// SchedulesDeleteFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type SchedulesDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(SchedulesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *SchedulesDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for SchedulesDeleteFuture.Result. +func (future *SchedulesDeleteFuture) result(client SchedulesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.SchedulesDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// ScheduleUpdate schedule for automatically turning virtual machines in a lab on and off at specified +// times. Used for updates. +type ScheduleUpdate struct { + // ScheduleUpdateProperties - Schedule resource properties + *ScheduleUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for ScheduleUpdate. +func (su ScheduleUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if su.ScheduleUpdateProperties != nil { + objectMap["properties"] = su.ScheduleUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for ScheduleUpdate struct. +func (su *ScheduleUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var scheduleUpdateProperties ScheduleUpdateProperties + err = json.Unmarshal(*v, &scheduleUpdateProperties) + if err != nil { + return err + } + su.ScheduleUpdateProperties = &scheduleUpdateProperties + } + } + } + + return nil +} + +// ScheduleUpdateProperties schedule resource properties used for updates. +type ScheduleUpdateProperties struct { + // StartAt - When lab user virtual machines will be started. Timestamp offsets will be ignored and timeZoneId is used instead. + StartAt *date.Time `json:"startAt,omitempty"` + // StopAt - When lab user virtual machines will be stopped. Timestamp offsets will be ignored and timeZoneId is used instead. + StopAt *date.Time `json:"stopAt,omitempty"` + // RecurrencePattern - The recurrence pattern of the scheduled actions. + RecurrencePattern *RecurrencePattern `json:"recurrencePattern,omitempty"` + // TimeZoneID - The IANA timezone id for the schedule. + TimeZoneID *string `json:"timeZoneId,omitempty"` + // Notes - Notes for this schedule. + Notes *string `json:"notes,omitempty"` +} + +// SecurityProfile the lab security profile. +type SecurityProfile struct { + // RegistrationCode - READ-ONLY; The registration code for the lab. + RegistrationCode *string `json:"registrationCode,omitempty"` + // OpenAccess - Whether any user or only specified users can register to a lab. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + OpenAccess EnableState `json:"openAccess,omitempty"` +} + +// MarshalJSON is the custom marshaler for SecurityProfile. +func (sp SecurityProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sp.OpenAccess != "" { + objectMap["openAccess"] = sp.OpenAccess + } + return json.Marshal(objectMap) +} + +// Sku the resource model definition representing SKU +type Sku struct { + // Name - The name of the SKU. Ex - P3. It is typically a letter+number code + Name *string `json:"name,omitempty"` + // Tier - This field is required to be implemented by the Resource Provider if the service has more than one tier, but is not required on a PUT. Possible values include: 'SkuTierFree', 'SkuTierBasic', 'SkuTierStandard', 'SkuTierPremium' + Tier SkuTier `json:"tier,omitempty"` + // Size - The SKU size. When the name field is the combination of tier and some other value, this would be the standalone code. + Size *string `json:"size,omitempty"` + // Family - If the service has different generations of hardware, for the same SKU, then that can be captured here. + Family *string `json:"family,omitempty"` + // Capacity - If the SKU supports scale out/in then the capacity integer should be included. If scale out/in is not possible for the resource this may be omitted. + Capacity *int32 `json:"capacity,omitempty"` +} + +// SkuCapabilities the array of capabilities of a lab services SKU. +type SkuCapabilities struct { + // Name - READ-ONLY; The name of the capability for a SKU. + Name *string `json:"name,omitempty"` + // Value - READ-ONLY; The value of the capability for a SKU. + Value *string `json:"value,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuCapabilities. +func (sc SkuCapabilities) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SkuCapacity the scale out/in options of the SKU. +type SkuCapacity struct { + // Default - READ-ONLY; The default capacity for this resource. + Default *int64 `json:"default,omitempty"` + // Minimum - READ-ONLY; The lowest permitted capacity for this resource. + Minimum *int64 `json:"minimum,omitempty"` + // Maximum - READ-ONLY; The highest permitted capacity for this resource. + Maximum *int64 `json:"maximum,omitempty"` + // ScaleType - READ-ONLY; The localized name of the resource. Possible values include: 'ScaleTypeNone', 'ScaleTypeManual', 'ScaleTypeAutomatic' + ScaleType ScaleType `json:"scaleType,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuCapacity. +func (sc SkuCapacity) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SkuCost the array of costs of a lab services SKU. +type SkuCost struct { + // MeterID - READ-ONLY; The meter id. + MeterID *string `json:"meterId,omitempty"` + // Quantity - READ-ONLY; The quantity of units charged. + Quantity *float64 `json:"quantity,omitempty"` + // ExtendedUnit - READ-ONLY; The extended unit. + ExtendedUnit *string `json:"extendedUnit,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuCost. +func (sc SkuCost) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SkuRestrictions the restriction details. +type SkuRestrictions struct { + // Type - READ-ONLY; The type of restriction. Possible values include: 'RestrictionTypeLocation' + Type RestrictionType `json:"type,omitempty"` + // Values - READ-ONLY; The values of the restriction. + Values *[]string `json:"values,omitempty"` + // ReasonCode - READ-ONLY; The reason for the restriction. Possible values include: 'RestrictionReasonCodeQuotaID', 'RestrictionReasonCodeNotAvailableForSubscription' + ReasonCode RestrictionReasonCode `json:"reasonCode,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuRestrictions. +func (sr SkuRestrictions) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// SkuType azure Lab Services resource SKUs +type SkuType struct { + // ResourceType - READ-ONLY; The lab services resource type. + ResourceType *string `json:"resourceType,omitempty"` + // Name - READ-ONLY; The name of the SKU. + Name *string `json:"name,omitempty"` + // Tier - READ-ONLY; The tier of the SKU. Possible values include: 'SkuTierEnumStandard', 'SkuTierEnumPremium' + Tier SkuTierEnum `json:"tier,omitempty"` + // Size - READ-ONLY; The SKU size. + Size *string `json:"size,omitempty"` + // Family - READ-ONLY; The family of the SKU. + Family *string `json:"family,omitempty"` + Capacity *SkuCapacity `json:"capacity,omitempty"` + // Capabilities - READ-ONLY; The capabilities of the SKU. + Capabilities *[]SkuCapabilities `json:"capabilities,omitempty"` + // Locations - READ-ONLY; List of locations that are available for a size. + Locations *[]string `json:"locations,omitempty"` + // Costs - READ-ONLY; Metadata for retrieving price info of a lab services SKUs. + Costs *[]SkuCost `json:"costs,omitempty"` + // Restrictions - READ-ONLY; Restrictions of a lab services SKUs. + Restrictions *[]SkuRestrictions `json:"restrictions,omitempty"` +} + +// MarshalJSON is the custom marshaler for SkuType. +func (st SkuType) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if st.Capacity != nil { + objectMap["capacity"] = st.Capacity + } + return json.Marshal(objectMap) +} + +// SupportInfo support contact information and instructions. +type SupportInfo struct { + // URL - Support web address. + URL *string `json:"url,omitempty"` + // Email - Support contact email address. + Email *string `json:"email,omitempty"` + // Phone - Support contact phone number. + Phone *string `json:"phone,omitempty"` + // Instructions - Support instructions. + Instructions *string `json:"instructions,omitempty"` +} + +// SystemData metadata pertaining to creation and last modification of the resource. +type SystemData struct { + // CreatedBy - The identity that created the resource. + CreatedBy *string `json:"createdBy,omitempty"` + // CreatedByType - The type of identity that created the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + CreatedByType CreatedByType `json:"createdByType,omitempty"` + // CreatedAt - The timestamp of resource creation (UTC). + CreatedAt *date.Time `json:"createdAt,omitempty"` + // LastModifiedBy - The identity that last modified the resource. + LastModifiedBy *string `json:"lastModifiedBy,omitempty"` + // LastModifiedByType - The type of identity that last modified the resource. Possible values include: 'CreatedByTypeUser', 'CreatedByTypeApplication', 'CreatedByTypeManagedIdentity', 'CreatedByTypeKey' + LastModifiedByType CreatedByType `json:"lastModifiedByType,omitempty"` + // LastModifiedAt - The timestamp of resource last modification (UTC) + LastModifiedAt *date.Time `json:"lastModifiedAt,omitempty"` +} + +// TrackedResource the resource model definition for an Azure Resource Manager tracked top level resource +// which has 'tags' and a 'location' +type TrackedResource struct { + // Tags - Resource tags. + Tags map[string]*string `json:"tags"` + // Location - The geo-location where the resource lives + Location *string `json:"location,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for TrackedResource. +func (tr TrackedResource) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if tr.Tags != nil { + objectMap["tags"] = tr.Tags + } + if tr.Location != nil { + objectMap["location"] = tr.Location + } + return json.Marshal(objectMap) +} + +// TrackedResourceUpdate base tracked resource type for all PATCH updates. +type TrackedResourceUpdate struct { + // Tags - Resource tags. + Tags *[]string `json:"tags,omitempty"` +} + +// Usage the core usage details. +type Usage struct { + // CurrentValue - The current usage. + CurrentValue *int64 `json:"currentValue,omitempty"` + // Limit - The limit integer. + Limit *int64 `json:"limit,omitempty"` + // Unit - The unit details. Possible values include: 'UsageUnitCount' + Unit UsageUnit `json:"unit,omitempty"` + // Name - The name. + Name *UsageName `json:"name,omitempty"` + // ID - The fully qualified arm resource id. + ID *string `json:"id,omitempty"` +} + +// UsageName the Usage Names. +type UsageName struct { + // LocalizedValue - The localized name of the resource. + LocalizedValue *string `json:"localizedValue,omitempty"` + // Value - The name of the resource. + Value *string `json:"value,omitempty"` +} + +// User user of a lab that can register for and use virtual machines within the lab. +type User struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; Metadata pertaining to creation and last modification of the user resource. + SystemData *SystemData `json:"systemData,omitempty"` + // UserProperties - User resource properties + *UserProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for User. +func (u User) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if u.UserProperties != nil { + objectMap["properties"] = u.UserProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for User struct. +func (u *User) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + u.SystemData = &systemData + } + case "properties": + if v != nil { + var userProperties UserProperties + err = json.Unmarshal(*v, &userProperties) + if err != nil { + return err + } + u.UserProperties = &userProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + u.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + u.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + u.Type = &typeVar + } + } + } + + return nil +} + +// UserProperties user resource properties +type UserProperties struct { + // ProvisioningState - READ-ONLY; Current provisioning state of the user resource. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateLocked' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // DisplayName - READ-ONLY; Display name of the user, for example user's full name. + DisplayName *string `json:"displayName,omitempty"` + // Email - Email address of the user. + Email *string `json:"email,omitempty"` + // RegistrationState - READ-ONLY; State of the user's registration within the lab. Possible values include: 'RegistrationStateRegistered', 'RegistrationStateNotRegistered' + RegistrationState RegistrationState `json:"registrationState,omitempty"` + // InvitationState - READ-ONLY; State of the invitation message for the user. Possible values include: 'InvitationStateNotSent', 'InvitationStateSending', 'InvitationStateSent', 'InvitationStateFailed' + InvitationState InvitationState `json:"invitationState,omitempty"` + // InvitationSent - READ-ONLY; Date and time when the invitation message was sent to the user. + InvitationSent *date.Time `json:"invitationSent,omitempty"` + // TotalUsage - READ-ONLY; How long the user has used their virtual machines in this lab. + TotalUsage *string `json:"totalUsage,omitempty"` + // AdditionalUsageQuota - The amount of usage quota time the user gets in addition to the lab usage quota. + AdditionalUsageQuota *string `json:"additionalUsageQuota,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserProperties. +func (up UserProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if up.Email != nil { + objectMap["email"] = up.Email + } + if up.AdditionalUsageQuota != nil { + objectMap["additionalUsageQuota"] = up.AdditionalUsageQuota + } + return json.Marshal(objectMap) +} + +// UsersCreateOrUpdateFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type UsersCreateOrUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(UsersClient) (User, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UsersCreateOrUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for UsersCreateOrUpdateFuture.Result. +func (future *UsersCreateOrUpdateFuture) result(client UsersClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersCreateOrUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + u.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.UsersCreateOrUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.CreateOrUpdateResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersCreateOrUpdateFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return +} + +// UsersDeleteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UsersDeleteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(UsersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UsersDeleteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for UsersDeleteFuture.Result. +func (future *UsersDeleteFuture) result(client UsersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersDeleteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.UsersDeleteFuture") + return + } + ar.Response = future.Response() + return +} + +// UsersInviteFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UsersInviteFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(UsersClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UsersInviteFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for UsersInviteFuture.Result. +func (future *UsersInviteFuture) result(client UsersClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersInviteFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.UsersInviteFuture") + return + } + ar.Response = future.Response() + return +} + +// UsersUpdateFuture an abstraction for monitoring and retrieving the results of a long-running operation. +type UsersUpdateFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(UsersClient) (User, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *UsersUpdateFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for UsersUpdateFuture.Result. +func (future *UsersUpdateFuture) result(client UsersClient) (u User, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersUpdateFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + u.Response.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.UsersUpdateFuture") + return + } + sender := autorest.DecorateSender(client, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) + if u.Response.Response, err = future.GetResult(sender); err == nil && u.Response.Response.StatusCode != http.StatusNoContent { + u, err = client.UpdateResponder(u.Response.Response) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersUpdateFuture", "Result", u.Response.Response, "Failure responding to request") + } + } + return +} + +// UserUpdate user of a lab that can register for and use virtual machines within the lab. Used for +// updates. +type UserUpdate struct { + // UserUpdateProperties - User resource properties + *UserUpdateProperties `json:"properties,omitempty"` +} + +// MarshalJSON is the custom marshaler for UserUpdate. +func (uu UserUpdate) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if uu.UserUpdateProperties != nil { + objectMap["properties"] = uu.UserUpdateProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for UserUpdate struct. +func (uu *UserUpdate) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var userUpdateProperties UserUpdateProperties + err = json.Unmarshal(*v, &userUpdateProperties) + if err != nil { + return err + } + uu.UserUpdateProperties = &userUpdateProperties + } + } + } + + return nil +} + +// UserUpdateProperties user resource properties used for updates. +type UserUpdateProperties struct { + // AdditionalUsageQuota - The amount of usage quota time the user gets in addition to the lab usage quota. + AdditionalUsageQuota *string `json:"additionalUsageQuota,omitempty"` +} + +// VirtualMachine a lab virtual machine resource. +type VirtualMachine struct { + autorest.Response `json:"-"` + // SystemData - READ-ONLY; System data of the Lab virtual machine. + SystemData *SystemData `json:"systemData,omitempty"` + // VirtualMachineProperties - Virtual machine resource properties + *VirtualMachineProperties `json:"properties,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachine. +func (VM VirtualMachine) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if VM.VirtualMachineProperties != nil { + objectMap["properties"] = VM.VirtualMachineProperties + } + return json.Marshal(objectMap) +} + +// UnmarshalJSON is the custom unmarshaler for VirtualMachine struct. +func (VM *VirtualMachine) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + VM.SystemData = &systemData + } + case "properties": + if v != nil { + var virtualMachineProperties VirtualMachineProperties + err = json.Unmarshal(*v, &virtualMachineProperties) + if err != nil { + return err + } + VM.VirtualMachineProperties = &virtualMachineProperties + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + VM.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + VM.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + VM.Type = &typeVar + } + } + } + + return nil +} + +// VirtualMachineAdditionalCapabilities the additional capabilities for a lab VM. +type VirtualMachineAdditionalCapabilities struct { + // InstallGpuDrivers - Flag to pre-install dedicated GPU drivers. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + InstallGpuDrivers EnableState `json:"installGpuDrivers,omitempty"` +} + +// VirtualMachineConnectionProfile the connection information for the virtual machine +type VirtualMachineConnectionProfile struct { + // PrivateIPAddress - READ-ONLY; The private IP address of the virtual machine. + PrivateIPAddress *string `json:"privateIpAddress,omitempty"` + // SSHAuthority - READ-ONLY; Port and host name separated by semicolon for connecting via SSH protocol to the virtual machine. + SSHAuthority *string `json:"sshAuthority,omitempty"` + // SSHInBrowserURL - READ-ONLY; URL for connecting via SSH protocol to the virtual machine in browser. + SSHInBrowserURL *string `json:"sshInBrowserUrl,omitempty"` + // RdpAuthority - READ-ONLY; Port and host name separated by semicolon for connecting via RDP protocol to the virtual machine. + RdpAuthority *string `json:"rdpAuthority,omitempty"` + // RdpInBrowserURL - READ-ONLY; URL for connecting via RDP protocol to the virtual machine in browser. + RdpInBrowserURL *string `json:"rdpInBrowserUrl,omitempty"` + // AdminUsername - READ-ONLY; The username used to log on to the virtual machine as admin. + AdminUsername *string `json:"adminUsername,omitempty"` + // NonAdminUsername - READ-ONLY; The username used to log on to the virtual machine as non-admin, if one exists. + NonAdminUsername *string `json:"nonAdminUsername,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineConnectionProfile. +func (vmcp VirtualMachineConnectionProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachineProfile the base virtual machine configuration for a lab. +type VirtualMachineProfile struct { + // CreateOption - Indicates what lab virtual machines are created from. Possible values include: 'CreateOptionImage', 'CreateOptionTemplateVM' + CreateOption CreateOption `json:"createOption,omitempty"` + // ImageReference - The image configuration for lab virtual machines. + ImageReference *ImageReference `json:"imageReference,omitempty"` + // OsType - READ-ONLY; The OS type of the image. Possible values include: 'OsTypeWindows', 'OsTypeLinux' + OsType OsType `json:"osType,omitempty"` + // Sku - The SKU for the lab. Defines the type of virtual machines used in the lab. + Sku *Sku `json:"sku,omitempty"` + // AdditionalCapabilities - Additional VM capabilities. + AdditionalCapabilities *VirtualMachineAdditionalCapabilities `json:"additionalCapabilities,omitempty"` + // UsageQuota - The initial quota alloted to each lab user. Must be a time span between 0 and 9999 hours. + UsageQuota *string `json:"usageQuota,omitempty"` + // UseSharedPassword - Enabling this option will use the same password for all user VMs. Possible values include: 'EnableStateEnabled', 'EnableStateDisabled' + UseSharedPassword EnableState `json:"useSharedPassword,omitempty"` + // AdminUser - Credentials for the admin user on the VM. + AdminUser *Credentials `json:"adminUser,omitempty"` + // NonAdminUser - Credentials for the non-admin user on the VM, if one exists. + NonAdminUser *Credentials `json:"nonAdminUser,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineProfile. +func (vmp VirtualMachineProfile) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if vmp.CreateOption != "" { + objectMap["createOption"] = vmp.CreateOption + } + if vmp.ImageReference != nil { + objectMap["imageReference"] = vmp.ImageReference + } + if vmp.Sku != nil { + objectMap["sku"] = vmp.Sku + } + if vmp.AdditionalCapabilities != nil { + objectMap["additionalCapabilities"] = vmp.AdditionalCapabilities + } + if vmp.UsageQuota != nil { + objectMap["usageQuota"] = vmp.UsageQuota + } + if vmp.UseSharedPassword != "" { + objectMap["useSharedPassword"] = vmp.UseSharedPassword + } + if vmp.AdminUser != nil { + objectMap["adminUser"] = vmp.AdminUser + } + if vmp.NonAdminUser != nil { + objectMap["nonAdminUser"] = vmp.NonAdminUser + } + return json.Marshal(objectMap) +} + +// VirtualMachineProperties virtual machine resource properties +type VirtualMachineProperties struct { + // ProvisioningState - READ-ONLY; Current provisioning state of the virtual machine. Possible values include: 'ProvisioningStateCreating', 'ProvisioningStateUpdating', 'ProvisioningStateDeleting', 'ProvisioningStateSucceeded', 'ProvisioningStateFailed', 'ProvisioningStateLocked' + ProvisioningState ProvisioningState `json:"provisioningState,omitempty"` + // State - READ-ONLY; The current state of the virtual machine. Possible values include: 'VirtualMachineStateStopped', 'VirtualMachineStateStarting', 'VirtualMachineStateRunning', 'VirtualMachineStateStopping', 'VirtualMachineStateResettingPassword', 'VirtualMachineStateReimaging', 'VirtualMachineStateRedeploying' + State VirtualMachineState `json:"state,omitempty"` + // ConnectionProfile - READ-ONLY; Profile for information about connecting to the virtual machine. + ConnectionProfile *VirtualMachineConnectionProfile `json:"connectionProfile,omitempty"` + // ClaimedByUserID - READ-ONLY; The lab user ID (not the PUID!) of who claimed the virtual machine. + ClaimedByUserID *string `json:"claimedByUserId,omitempty"` + // VMType - READ-ONLY; The type of this VM resource. Possible values include: 'VirtualMachineTypeUser', 'VirtualMachineTypeTemplate' + VMType VirtualMachineType `json:"vmType,omitempty"` +} + +// MarshalJSON is the custom marshaler for VirtualMachineProperties. +func (vmp VirtualMachineProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + return json.Marshal(objectMap) +} + +// VirtualMachinesRedeployFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesRedeployFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesRedeployFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesRedeployFuture.Result. +func (future *VirtualMachinesRedeployFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesRedeployFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.VirtualMachinesRedeployFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesReimageFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesReimageFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesReimageFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesReimageFuture.Result. +func (future *VirtualMachinesReimageFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesReimageFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.VirtualMachinesReimageFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesResetPasswordFuture an abstraction for monitoring and retrieving the results of a +// long-running operation. +type VirtualMachinesResetPasswordFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesResetPasswordFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesResetPasswordFuture.Result. +func (future *VirtualMachinesResetPasswordFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesResetPasswordFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.VirtualMachinesResetPasswordFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesStartFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesStartFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesStartFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesStartFuture.Result. +func (future *VirtualMachinesStartFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesStartFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.VirtualMachinesStartFuture") + return + } + ar.Response = future.Response() + return +} + +// VirtualMachinesStopFuture an abstraction for monitoring and retrieving the results of a long-running +// operation. +type VirtualMachinesStopFuture struct { + azure.FutureAPI + // Result returns the result of the asynchronous operation. + // If the operation has not completed it will return an error. + Result func(VirtualMachinesClient) (autorest.Response, error) +} + +// UnmarshalJSON is the custom unmarshaller for CreateFuture. +func (future *VirtualMachinesStopFuture) UnmarshalJSON(body []byte) error { + var azFuture azure.Future + if err := json.Unmarshal(body, &azFuture); err != nil { + return err + } + future.FutureAPI = &azFuture + future.Result = future.result + return nil +} + +// result is the default implementation for VirtualMachinesStopFuture.Result. +func (future *VirtualMachinesStopFuture) result(client VirtualMachinesClient) (ar autorest.Response, err error) { + var done bool + done, err = future.DoneWithContext(context.Background(), client) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesStopFuture", "Result", future.Response(), "Polling failure") + return + } + if !done { + ar.Response = future.Response() + err = azure.NewAsyncOpIncompleteError("labservices.VirtualMachinesStopFuture") + return + } + ar.Response = future.Response() + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/operationresults.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/operationresults.go new file mode 100644 index 000000000000..680f9d228c8b --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/operationresults.go @@ -0,0 +1,117 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationResultsClient is the client for the OperationResults methods of the Labservices service. +type OperationResultsClient struct { + BaseClient +} + +// NewOperationResultsClient creates an instance of the OperationResultsClient client. +func NewOperationResultsClient(subscriptionID string) OperationResultsClient { + return NewOperationResultsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationResultsClientWithBaseURI creates an instance of the OperationResultsClient client using a custom +// endpoint. Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure +// stack). +func NewOperationResultsClientWithBaseURI(baseURI string, subscriptionID string) OperationResultsClient { + return OperationResultsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns an azure operation result. +// Parameters: +// operationResultID - the operation result ID / name. +func (client OperationResultsClient) Get(ctx context.Context, operationResultID string) (result OperationResult, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationResultsClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: operationResultID, + Constraints: []validation.Constraint{{Target: "operationResultID", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "operationResultID", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "operationResultID", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.OperationResultsClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, operationResultID) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.OperationResultsClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.OperationResultsClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.OperationResultsClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client OperationResultsClient) GetPreparer(ctx context.Context, operationResultID string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "operationResultId": autorest.Encode("path", operationResultID), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/operationResults/{operationResultId}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client OperationResultsClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client OperationResultsClient) GetResponder(resp *http.Response) (result OperationResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusNoContent), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/operations.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/operations.go new file mode 100644 index 000000000000..e7fa64c1acc7 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/operations.go @@ -0,0 +1,140 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// OperationsClient is the client for the Operations methods of the Labservices service. +type OperationsClient struct { + BaseClient +} + +// NewOperationsClient creates an instance of the OperationsClient client. +func NewOperationsClient(subscriptionID string) OperationsClient { + return NewOperationsClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewOperationsClientWithBaseURI creates an instance of the OperationsClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewOperationsClientWithBaseURI(baseURI string, subscriptionID string) OperationsClient { + return OperationsClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List returns a list of all operations. +func (client OperationsClient) List(ctx context.Context) (result OperationListResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.olr.Response.Response != nil { + sc = result.olr.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.OperationsClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.olr.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.OperationsClient", "List", resp, "Failure sending request") + return + } + + result.olr, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.OperationsClient", "List", resp, "Failure responding to request") + return + } + if result.olr.hasNextLink() && result.olr.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client OperationsClient) ListPreparer(ctx context.Context) (*http.Request, error) { + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPath("/providers/Microsoft.LabServices/operations"), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client OperationsClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, autorest.DoRetryForStatusCodes(client.RetryAttempts, client.RetryDuration, autorest.StatusCodesForRetry...)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client OperationsClient) ListResponder(resp *http.Response) (result OperationListResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client OperationsClient) listNextResults(ctx context.Context, lastResults OperationListResult) (result OperationListResult, err error) { + req, err := lastResults.operationListResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.OperationsClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.OperationsClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.OperationsClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client OperationsClient) ListComplete(ctx context.Context) (result OperationListResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/OperationsClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx) + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/schedules.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/schedules.go new file mode 100644 index 000000000000..025d0af349c6 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/schedules.go @@ -0,0 +1,562 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SchedulesClient is the client for the Schedules methods of the Labservices service. +type SchedulesClient struct { + BaseClient +} + +// NewSchedulesClient creates an instance of the SchedulesClient client. +func NewSchedulesClient(subscriptionID string) SchedulesClient { + return NewSchedulesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSchedulesClientWithBaseURI creates an instance of the SchedulesClient client using a custom endpoint. Use this +// when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSchedulesClientWithBaseURI(baseURI string, subscriptionID string) SchedulesClient { + return SchedulesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate operation to create or update a lab schedule. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// scheduleName - the name of the schedule that uniquely identifies it within containing lab. Used in resource +// URIs. +func (client SchedulesClient) CreateOrUpdate(ctx context.Context, body Schedule, resourceGroupName string, labName string, scheduleName string) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.ScheduleProperties", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: scheduleName, + Constraints: []validation.Constraint{{Target: "scheduleName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "scheduleName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "scheduleName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.SchedulesClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, labName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + resp, err := client.CreateOrUpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "CreateOrUpdate", resp, "Failure sending request") + return + } + + result, err = client.CreateOrUpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "CreateOrUpdate", resp, "Failure responding to request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client SchedulesClient) CreateOrUpdatePreparer(ctx context.Context, body Schedule, resourceGroupName string, labName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client SchedulesClient) CreateOrUpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client SchedulesClient) CreateOrUpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to delete a schedule resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// scheduleName - the name of the schedule that uniquely identifies it within containing lab. Used in resource +// URIs. +func (client SchedulesClient) Delete(ctx context.Context, resourceGroupName string, labName string, scheduleName string) (result SchedulesDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: scheduleName, + Constraints: []validation.Constraint{{Target: "scheduleName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "scheduleName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "scheduleName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.SchedulesClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, labName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client SchedulesClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client SchedulesClient) DeleteSender(req *http.Request) (future SchedulesDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client SchedulesClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns the properties of a lab Schedule. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// scheduleName - the name of the schedule that uniquely identifies it within containing lab. Used in resource +// URIs. +func (client SchedulesClient) Get(ctx context.Context, resourceGroupName string, labName string, scheduleName string) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: scheduleName, + Constraints: []validation.Constraint{{Target: "scheduleName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "scheduleName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "scheduleName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.SchedulesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, labName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client SchedulesClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client SchedulesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client SchedulesClient) GetResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByLab returns a list of all schedules for a lab. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// filter - the filter to apply to the operation. +func (client SchedulesClient) ListByLab(ctx context.Context, resourceGroupName string, labName string, filter string) (result PagedSchedulesPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.ListByLab") + defer func() { + sc := -1 + if result.ps.Response.Response != nil { + sc = result.ps.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.SchedulesClient", "ListByLab", err.Error()) + } + + result.fn = client.listByLabNextResults + req, err := client.ListByLabPreparer(ctx, resourceGroupName, labName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "ListByLab", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLabSender(req) + if err != nil { + result.ps.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "ListByLab", resp, "Failure sending request") + return + } + + result.ps, err = client.ListByLabResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "ListByLab", resp, "Failure responding to request") + return + } + if result.ps.hasNextLink() && result.ps.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLabPreparer prepares the ListByLab request. +func (client SchedulesClient) ListByLabPreparer(ctx context.Context, resourceGroupName string, labName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLabSender sends the ListByLab request. The method will close the +// http.Response Body if it receives an error. +func (client SchedulesClient) ListByLabSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLabResponder handles the response to the ListByLab request. The method always +// closes the http.Response Body. +func (client SchedulesClient) ListByLabResponder(resp *http.Response) (result PagedSchedules, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLabNextResults retrieves the next set of results, if any. +func (client SchedulesClient) listByLabNextResults(ctx context.Context, lastResults PagedSchedules) (result PagedSchedules, err error) { + req, err := lastResults.pagedSchedulesPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.SchedulesClient", "listByLabNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLabSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.SchedulesClient", "listByLabNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLabResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "listByLabNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLabComplete enumerates all values, automatically crossing page boundaries as required. +func (client SchedulesClient) ListByLabComplete(ctx context.Context, resourceGroupName string, labName string, filter string) (result PagedSchedulesIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.ListByLab") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLab(ctx, resourceGroupName, labName, filter) + return +} + +// Update operation to update a lab schedule. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// scheduleName - the name of the schedule that uniquely identifies it within containing lab. Used in resource +// URIs. +func (client SchedulesClient) Update(ctx context.Context, body ScheduleUpdate, resourceGroupName string, labName string, scheduleName string) (result Schedule, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SchedulesClient.Update") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: scheduleName, + Constraints: []validation.Constraint{{Target: "scheduleName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "scheduleName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "scheduleName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.SchedulesClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, labName, scheduleName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Update", nil, "Failure preparing request") + return + } + + resp, err := client.UpdateSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Update", resp, "Failure sending request") + return + } + + result, err = client.UpdateResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SchedulesClient", "Update", resp, "Failure responding to request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client SchedulesClient) UpdatePreparer(ctx context.Context, body ScheduleUpdate, resourceGroupName string, labName string, scheduleName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "scheduleName": autorest.Encode("path", scheduleName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/schedules/{scheduleName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client SchedulesClient) UpdateSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client SchedulesClient) UpdateResponder(resp *http.Response) (result Schedule, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/skus.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/skus.go new file mode 100644 index 000000000000..c2372f90bf69 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/skus.go @@ -0,0 +1,156 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// SkusClient is the client for the Skus methods of the Labservices service. +type SkusClient struct { + BaseClient +} + +// NewSkusClient creates an instance of the SkusClient client. +func NewSkusClient(subscriptionID string) SkusClient { + return NewSkusClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewSkusClientWithBaseURI creates an instance of the SkusClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewSkusClientWithBaseURI(baseURI string, subscriptionID string) SkusClient { + return SkusClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// List returns a list of all the Azure Lab Services resource SKUs. +// Parameters: +// filter - the filter to apply to the operation. +func (client SkusClient) List(ctx context.Context, filter string) (result PagedLabServicesSkusPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.List") + defer func() { + sc := -1 + if result.plss.Response.Response != nil { + sc = result.plss.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.SkusClient", "List", err.Error()) + } + + result.fn = client.listNextResults + req, err := client.ListPreparer(ctx, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SkusClient", "List", nil, "Failure preparing request") + return + } + + resp, err := client.ListSender(req) + if err != nil { + result.plss.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.SkusClient", "List", resp, "Failure sending request") + return + } + + result.plss, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SkusClient", "List", resp, "Failure responding to request") + return + } + if result.plss.hasNextLink() && result.plss.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListPreparer prepares the List request. +func (client SkusClient) ListPreparer(ctx context.Context, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/skus", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListSender sends the List request. The method will close the +// http.Response Body if it receives an error. +func (client SkusClient) ListSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListResponder handles the response to the List request. The method always +// closes the http.Response Body. +func (client SkusClient) ListResponder(resp *http.Response) (result PagedLabServicesSkus, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listNextResults retrieves the next set of results, if any. +func (client SkusClient) listNextResults(ctx context.Context, lastResults PagedLabServicesSkus) (result PagedLabServicesSkus, err error) { + req, err := lastResults.pagedLabServicesSkusPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.SkusClient", "listNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.SkusClient", "listNextResults", resp, "Failure sending next results request") + } + result, err = client.ListResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.SkusClient", "listNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListComplete enumerates all values, automatically crossing page boundaries as required. +func (client SkusClient) ListComplete(ctx context.Context, filter string) (result PagedLabServicesSkusIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/SkusClient.List") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.List(ctx, filter) + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/usages.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/usages.go new file mode 100644 index 000000000000..3dad50e85aef --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/usages.go @@ -0,0 +1,162 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsagesClient is the client for the Usages methods of the Labservices service. +type UsagesClient struct { + BaseClient +} + +// NewUsagesClient creates an instance of the UsagesClient client. +func NewUsagesClient(subscriptionID string) UsagesClient { + return NewUsagesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsagesClientWithBaseURI creates an instance of the UsagesClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewUsagesClientWithBaseURI(baseURI string, subscriptionID string) UsagesClient { + return UsagesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// ListByLocation returns list of usage per SKU family for the specified subscription in the specified region. +// Parameters: +// location - the location name. +// filter - the filter to apply to the operation. +func (client UsagesClient) ListByLocation(ctx context.Context, location string, filter string) (result ListUsagesResultPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByLocation") + defer func() { + sc := -1 + if result.lur.Response.Response != nil { + sc = result.lur.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: location, + Constraints: []validation.Constraint{{Target: "location", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "location", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "location", Name: validation.Pattern, Rule: `^[-\w\._]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsagesClient", "ListByLocation", err.Error()) + } + + result.fn = client.listByLocationNextResults + req, err := client.ListByLocationPreparer(ctx, location, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsagesClient", "ListByLocation", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLocationSender(req) + if err != nil { + result.lur.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.UsagesClient", "ListByLocation", resp, "Failure sending request") + return + } + + result.lur, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsagesClient", "ListByLocation", resp, "Failure responding to request") + return + } + if result.lur.hasNextLink() && result.lur.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLocationPreparer prepares the ListByLocation request. +func (client UsagesClient) ListByLocationPreparer(ctx context.Context, location string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "location": autorest.Encode("path", location), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/providers/Microsoft.LabServices/locations/{location}/usages", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLocationSender sends the ListByLocation request. The method will close the +// http.Response Body if it receives an error. +func (client UsagesClient) ListByLocationSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLocationResponder handles the response to the ListByLocation request. The method always +// closes the http.Response Body. +func (client UsagesClient) ListByLocationResponder(resp *http.Response) (result ListUsagesResult, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLocationNextResults retrieves the next set of results, if any. +func (client UsagesClient) listByLocationNextResults(ctx context.Context, lastResults ListUsagesResult) (result ListUsagesResult, err error) { + req, err := lastResults.listUsagesResultPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.UsagesClient", "listByLocationNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLocationSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.UsagesClient", "listByLocationNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLocationResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsagesClient", "listByLocationNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLocationComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsagesClient) ListByLocationComplete(ctx context.Context, location string, filter string) (result ListUsagesResultIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsagesClient.ListByLocation") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLocation(ctx, location, filter) + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/users.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/users.go new file mode 100644 index 000000000000..effa712287e2 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/users.go @@ -0,0 +1,665 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// UsersClient is the client for the Users methods of the Labservices service. +type UsersClient struct { + BaseClient +} + +// NewUsersClient creates an instance of the UsersClient client. +func NewUsersClient(subscriptionID string) UsersClient { + return NewUsersClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewUsersClientWithBaseURI creates an instance of the UsersClient client using a custom endpoint. Use this when +// interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewUsersClientWithBaseURI(baseURI string, subscriptionID string) UsersClient { + return UsersClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// CreateOrUpdate operation to create or update a lab user. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// userName - the name of the user that uniquely identifies it within containing lab. Used in resource URIs. +func (client UsersClient) CreateOrUpdate(ctx context.Context, body User, resourceGroupName string, labName string, userName string) (result UsersCreateOrUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.CreateOrUpdate") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.UserProperties", Name: validation.Null, Rule: true, + Chain: []validation.Constraint{{Target: "body.UserProperties.Email", Name: validation.Null, Rule: true, Chain: nil}}}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userName, + Constraints: []validation.Constraint{{Target: "userName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "userName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "userName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsersClient", "CreateOrUpdate", err.Error()) + } + + req, err := client.CreateOrUpdatePreparer(ctx, body, resourceGroupName, labName, userName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "CreateOrUpdate", nil, "Failure preparing request") + return + } + + result, err = client.CreateOrUpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "CreateOrUpdate", result.Response(), "Failure sending request") + return + } + + return +} + +// CreateOrUpdatePreparer prepares the CreateOrUpdate request. +func (client UsersClient) CreateOrUpdatePreparer(ctx context.Context, body User, resourceGroupName string, labName string, userName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + body.SystemData = nil + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPut(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// CreateOrUpdateSender sends the CreateOrUpdate request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) CreateOrUpdateSender(req *http.Request) (future UsersCreateOrUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// CreateOrUpdateResponder handles the response to the CreateOrUpdate request. The method always +// closes the http.Response Body. +func (client UsersClient) CreateOrUpdateResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Delete operation to delete a user resource. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// userName - the name of the user that uniquely identifies it within containing lab. Used in resource URIs. +func (client UsersClient) Delete(ctx context.Context, resourceGroupName string, labName string, userName string) (result UsersDeleteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Delete") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userName, + Constraints: []validation.Constraint{{Target: "userName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "userName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "userName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsersClient", "Delete", err.Error()) + } + + req, err := client.DeletePreparer(ctx, resourceGroupName, labName, userName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Delete", nil, "Failure preparing request") + return + } + + result, err = client.DeleteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Delete", result.Response(), "Failure sending request") + return + } + + return +} + +// DeletePreparer prepares the Delete request. +func (client UsersClient) DeletePreparer(ctx context.Context, resourceGroupName string, labName string, userName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsDelete(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// DeleteSender sends the Delete request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) DeleteSender(req *http.Request) (future UsersDeleteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// DeleteResponder handles the response to the Delete request. The method always +// closes the http.Response Body. +func (client UsersClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted, http.StatusNoContent), + autorest.ByClosing()) + result.Response = resp + return +} + +// Get returns the properties of a lab user. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// userName - the name of the user that uniquely identifies it within containing lab. Used in resource URIs. +func (client UsersClient) Get(ctx context.Context, resourceGroupName string, labName string, userName string) (result User, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userName, + Constraints: []validation.Constraint{{Target: "userName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "userName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "userName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsersClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, labName, userName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client UsersClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, userName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client UsersClient) GetResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// Invite operation to invite a user to a lab. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// userName - the name of the user that uniquely identifies it within containing lab. Used in resource URIs. +func (client UsersClient) Invite(ctx context.Context, body InviteBody, resourceGroupName string, labName string, userName string) (result UsersInviteFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Invite") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userName, + Constraints: []validation.Constraint{{Target: "userName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "userName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "userName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsersClient", "Invite", err.Error()) + } + + req, err := client.InvitePreparer(ctx, body, resourceGroupName, labName, userName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Invite", nil, "Failure preparing request") + return + } + + result, err = client.InviteSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Invite", result.Response(), "Failure sending request") + return + } + + return +} + +// InvitePreparer prepares the Invite request. +func (client UsersClient) InvitePreparer(ctx context.Context, body InviteBody, resourceGroupName string, labName string, userName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}/invite", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// InviteSender sends the Invite request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) InviteSender(req *http.Request) (future UsersInviteFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// InviteResponder handles the response to the Invite request. The method always +// closes the http.Response Body. +func (client UsersClient) InviteResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ListByLab returns a list of all users for a lab. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// filter - the filter to apply to the operation. +func (client UsersClient) ListByLab(ctx context.Context, resourceGroupName string, labName string, filter string) (result PagedUsersPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListByLab") + defer func() { + sc := -1 + if result.pu.Response.Response != nil { + sc = result.pu.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsersClient", "ListByLab", err.Error()) + } + + result.fn = client.listByLabNextResults + req, err := client.ListByLabPreparer(ctx, resourceGroupName, labName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "ListByLab", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLabSender(req) + if err != nil { + result.pu.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "ListByLab", resp, "Failure sending request") + return + } + + result.pu, err = client.ListByLabResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "ListByLab", resp, "Failure responding to request") + return + } + if result.pu.hasNextLink() && result.pu.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLabPreparer prepares the ListByLab request. +func (client UsersClient) ListByLabPreparer(ctx context.Context, resourceGroupName string, labName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLabSender sends the ListByLab request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) ListByLabSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLabResponder handles the response to the ListByLab request. The method always +// closes the http.Response Body. +func (client UsersClient) ListByLabResponder(resp *http.Response) (result PagedUsers, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLabNextResults retrieves the next set of results, if any. +func (client UsersClient) listByLabNextResults(ctx context.Context, lastResults PagedUsers) (result PagedUsers, err error) { + req, err := lastResults.pagedUsersPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.UsersClient", "listByLabNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLabSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.UsersClient", "listByLabNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLabResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "listByLabNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLabComplete enumerates all values, automatically crossing page boundaries as required. +func (client UsersClient) ListByLabComplete(ctx context.Context, resourceGroupName string, labName string, filter string) (result PagedUsersIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.ListByLab") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLab(ctx, resourceGroupName, labName, filter) + return +} + +// Update operation to update a lab user. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// userName - the name of the user that uniquely identifies it within containing lab. Used in resource URIs. +func (client UsersClient) Update(ctx context.Context, body UserUpdate, resourceGroupName string, labName string, userName string) (result UsersUpdateFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/UsersClient.Update") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: userName, + Constraints: []validation.Constraint{{Target: "userName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "userName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "userName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.UsersClient", "Update", err.Error()) + } + + req, err := client.UpdatePreparer(ctx, body, resourceGroupName, labName, userName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Update", nil, "Failure preparing request") + return + } + + result, err = client.UpdateSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.UsersClient", "Update", result.Response(), "Failure sending request") + return + } + + return +} + +// UpdatePreparer prepares the Update request. +func (client UsersClient) UpdatePreparer(ctx context.Context, body UserUpdate, resourceGroupName string, labName string, userName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "userName": autorest.Encode("path", userName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPatch(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/users/{userName}", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// UpdateSender sends the Update request. The method will close the +// http.Response Body if it receives an error. +func (client UsersClient) UpdateSender(req *http.Request) (future UsersUpdateFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// UpdateResponder handles the response to the Update request. The method always +// closes the http.Response Body. +func (client UsersClient) UpdateResponder(resp *http.Response) (result User, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/version.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/version.go new file mode 100644 index 000000000000..d5e8c7d08bd6 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/version.go @@ -0,0 +1,19 @@ +package labservices + +import "github.com/Azure/azure-sdk-for-go/version" + +// 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. + +// UserAgent returns the UserAgent string to use when sending http.Requests. +func UserAgent() string { + return "Azure-SDK-For-Go/" + Version() + " labservices/2021-11-15-preview" +} + +// Version returns the semantic version (see http://semver.org) of the client. +func Version() string { + return version.Number +} diff --git a/services/preview/labservices/mgmt/2021-11-15-preview/labservices/virtualmachines.go b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/virtualmachines.go new file mode 100644 index 000000000000..588a0813fe48 --- /dev/null +++ b/services/preview/labservices/mgmt/2021-11-15-preview/labservices/virtualmachines.go @@ -0,0 +1,760 @@ +package labservices + +// 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. + +import ( + "context" + "github.com/Azure/go-autorest/autorest" + "github.com/Azure/go-autorest/autorest/azure" + "github.com/Azure/go-autorest/autorest/validation" + "github.com/Azure/go-autorest/tracing" + "net/http" +) + +// VirtualMachinesClient is the client for the VirtualMachines methods of the Labservices service. +type VirtualMachinesClient struct { + BaseClient +} + +// NewVirtualMachinesClient creates an instance of the VirtualMachinesClient client. +func NewVirtualMachinesClient(subscriptionID string) VirtualMachinesClient { + return NewVirtualMachinesClientWithBaseURI(DefaultBaseURI, subscriptionID) +} + +// NewVirtualMachinesClientWithBaseURI creates an instance of the VirtualMachinesClient client using a custom endpoint. +// Use this when interacting with an Azure cloud that uses a non-standard base URI (sovereign clouds, Azure stack). +func NewVirtualMachinesClientWithBaseURI(baseURI string, subscriptionID string) VirtualMachinesClient { + return VirtualMachinesClient{NewWithBaseURI(baseURI, subscriptionID)} +} + +// Get returns the properties for a lab virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// virtualMachineName - the ID of the virtual machine that uniquely identifies it within the containing lab. +// Used in resource URIs. +func (client VirtualMachinesClient) Get(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result VirtualMachine, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Get") + defer func() { + sc := -1 + if result.Response.Response != nil { + sc = result.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: virtualMachineName, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "virtualMachineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "Get", err.Error()) + } + + req, err := client.GetPreparer(ctx, resourceGroupName, labName, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Get", nil, "Failure preparing request") + return + } + + resp, err := client.GetSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Get", resp, "Failure sending request") + return + } + + result, err = client.GetResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Get", resp, "Failure responding to request") + return + } + + return +} + +// GetPreparer prepares the Get request. +func (client VirtualMachinesClient) GetPreparer(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// GetSender sends the Get request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) GetSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// GetResponder handles the response to the Get request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) GetResponder(resp *http.Response) (result VirtualMachine, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// ListByLab returns a list of all virtual machines for a lab. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// filter - the filter to apply to the operation. +func (client VirtualMachinesClient) ListByLab(ctx context.Context, resourceGroupName string, labName string, filter string) (result PagedVirtualMachinesPage, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLab") + defer func() { + sc := -1 + if result.pvm.Response.Response != nil { + sc = result.pvm.Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "ListByLab", err.Error()) + } + + result.fn = client.listByLabNextResults + req, err := client.ListByLabPreparer(ctx, resourceGroupName, labName, filter) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "ListByLab", nil, "Failure preparing request") + return + } + + resp, err := client.ListByLabSender(req) + if err != nil { + result.pvm.Response = autorest.Response{Response: resp} + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "ListByLab", resp, "Failure sending request") + return + } + + result.pvm, err = client.ListByLabResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "ListByLab", resp, "Failure responding to request") + return + } + if result.pvm.hasNextLink() && result.pvm.IsEmpty() { + err = result.NextWithContext(ctx) + return + } + + return +} + +// ListByLabPreparer prepares the ListByLab request. +func (client VirtualMachinesClient) ListByLabPreparer(ctx context.Context, resourceGroupName string, labName string, filter string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + if len(filter) > 0 { + queryParameters["$filter"] = autorest.Encode("query", filter) + } + + preparer := autorest.CreatePreparer( + autorest.AsGet(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ListByLabSender sends the ListByLab request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ListByLabSender(req *http.Request) (*http.Response, error) { + return client.Send(req, azure.DoRetryWithRegistration(client.Client)) +} + +// ListByLabResponder handles the response to the ListByLab request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ListByLabResponder(resp *http.Response) (result PagedVirtualMachines, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK), + autorest.ByUnmarshallingJSON(&result), + autorest.ByClosing()) + result.Response = autorest.Response{Response: resp} + return +} + +// listByLabNextResults retrieves the next set of results, if any. +func (client VirtualMachinesClient) listByLabNextResults(ctx context.Context, lastResults PagedVirtualMachines) (result PagedVirtualMachines, err error) { + req, err := lastResults.pagedVirtualMachinesPreparer(ctx) + if err != nil { + return result, autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "listByLabNextResults", nil, "Failure preparing next results request") + } + if req == nil { + return + } + resp, err := client.ListByLabSender(req) + if err != nil { + result.Response = autorest.Response{Response: resp} + return result, autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "listByLabNextResults", resp, "Failure sending next results request") + } + result, err = client.ListByLabResponder(resp) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "listByLabNextResults", resp, "Failure responding to next results request") + } + return +} + +// ListByLabComplete enumerates all values, automatically crossing page boundaries as required. +func (client VirtualMachinesClient) ListByLabComplete(ctx context.Context, resourceGroupName string, labName string, filter string) (result PagedVirtualMachinesIterator, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ListByLab") + defer func() { + sc := -1 + if result.Response().Response.Response != nil { + sc = result.page.Response().Response.Response.StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + result.page, err = client.ListByLab(ctx, resourceGroupName, labName, filter) + return +} + +// Redeploy action to redeploy a lab virtual machine to a different compute node. For troubleshooting connectivity. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// virtualMachineName - the ID of the virtual machine that uniquely identifies it within the containing lab. +// Used in resource URIs. +func (client VirtualMachinesClient) Redeploy(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result VirtualMachinesRedeployFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Redeploy") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: virtualMachineName, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "virtualMachineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "Redeploy", err.Error()) + } + + req, err := client.RedeployPreparer(ctx, resourceGroupName, labName, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Redeploy", nil, "Failure preparing request") + return + } + + result, err = client.RedeploySender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Redeploy", result.Response(), "Failure sending request") + return + } + + return +} + +// RedeployPreparer prepares the Redeploy request. +func (client VirtualMachinesClient) RedeployPreparer(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/redeploy", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// RedeploySender sends the Redeploy request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) RedeploySender(req *http.Request) (future VirtualMachinesRedeployFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// RedeployResponder handles the response to the Redeploy request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) RedeployResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Reimage re-image a lab virtual machine. The virtual machine will be deleted and recreated using the latest published +// snapshot of the reference environment of the lab. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// virtualMachineName - the ID of the virtual machine that uniquely identifies it within the containing lab. +// Used in resource URIs. +func (client VirtualMachinesClient) Reimage(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result VirtualMachinesReimageFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Reimage") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: virtualMachineName, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "virtualMachineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "Reimage", err.Error()) + } + + req, err := client.ReimagePreparer(ctx, resourceGroupName, labName, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Reimage", nil, "Failure preparing request") + return + } + + result, err = client.ReimageSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Reimage", result.Response(), "Failure sending request") + return + } + + return +} + +// ReimagePreparer prepares the Reimage request. +func (client VirtualMachinesClient) ReimagePreparer(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/reimage", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ReimageSender sends the Reimage request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ReimageSender(req *http.Request) (future VirtualMachinesReimageFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ReimageResponder handles the response to the Reimage request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ReimageResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// ResetPassword resets a lab virtual machine password. +// Parameters: +// body - the request body. +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// virtualMachineName - the ID of the virtual machine that uniquely identifies it within the containing lab. +// Used in resource URIs. +func (client VirtualMachinesClient) ResetPassword(ctx context.Context, body ResetPasswordBody, resourceGroupName string, labName string, virtualMachineName string) (result VirtualMachinesResetPasswordFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.ResetPassword") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: body, + Constraints: []validation.Constraint{{Target: "body.Username", Name: validation.Null, Rule: true, Chain: nil}, + {Target: "body.Password", Name: validation.Null, Rule: true, Chain: nil}}}, + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: virtualMachineName, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "virtualMachineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "ResetPassword", err.Error()) + } + + req, err := client.ResetPasswordPreparer(ctx, body, resourceGroupName, labName, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "ResetPassword", nil, "Failure preparing request") + return + } + + result, err = client.ResetPasswordSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "ResetPassword", result.Response(), "Failure sending request") + return + } + + return +} + +// ResetPasswordPreparer prepares the ResetPassword request. +func (client VirtualMachinesClient) ResetPasswordPreparer(ctx context.Context, body ResetPasswordBody, resourceGroupName string, labName string, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsContentType("application/json; charset=utf-8"), + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/resetPassword", pathParameters), + autorest.WithJSON(body), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// ResetPasswordSender sends the ResetPassword request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) ResetPasswordSender(req *http.Request) (future VirtualMachinesResetPasswordFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// ResetPasswordResponder handles the response to the ResetPassword request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) ResetPasswordResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Start action to start a lab virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// virtualMachineName - the ID of the virtual machine that uniquely identifies it within the containing lab. +// Used in resource URIs. +func (client VirtualMachinesClient) Start(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result VirtualMachinesStartFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Start") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: virtualMachineName, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "virtualMachineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "Start", err.Error()) + } + + req, err := client.StartPreparer(ctx, resourceGroupName, labName, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Start", nil, "Failure preparing request") + return + } + + result, err = client.StartSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Start", result.Response(), "Failure sending request") + return + } + + return +} + +// StartPreparer prepares the Start request. +func (client VirtualMachinesClient) StartPreparer(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/start", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StartSender sends the Start request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) StartSender(req *http.Request) (future VirtualMachinesStartFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StartResponder handles the response to the Start request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) StartResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} + +// Stop action to stop a lab virtual machine. +// Parameters: +// resourceGroupName - the name of the resource group. The name is case insensitive. +// labName - the name of the lab that uniquely identifies it within containing lab account. Used in resource +// URIs. +// virtualMachineName - the ID of the virtual machine that uniquely identifies it within the containing lab. +// Used in resource URIs. +func (client VirtualMachinesClient) Stop(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (result VirtualMachinesStopFuture, err error) { + if tracing.IsEnabled() { + ctx = tracing.StartSpan(ctx, fqdn+"/VirtualMachinesClient.Stop") + defer func() { + sc := -1 + if result.FutureAPI != nil && result.FutureAPI.Response() != nil { + sc = result.FutureAPI.Response().StatusCode + } + tracing.EndSpan(ctx, sc, err) + }() + } + if err := validation.Validate([]validation.Validation{ + {TargetValue: client.SubscriptionID, + Constraints: []validation.Constraint{{Target: "client.SubscriptionID", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: resourceGroupName, + Constraints: []validation.Constraint{{Target: "resourceGroupName", Name: validation.MaxLength, Rule: 90, Chain: nil}, + {Target: "resourceGroupName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: labName, + Constraints: []validation.Constraint{{Target: "labName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "labName", Name: validation.MinLength, Rule: 1, Chain: nil}}}, + {TargetValue: virtualMachineName, + Constraints: []validation.Constraint{{Target: "virtualMachineName", Name: validation.MaxLength, Rule: 100, Chain: nil}, + {Target: "virtualMachineName", Name: validation.MinLength, Rule: 1, Chain: nil}, + {Target: "virtualMachineName", Name: validation.Pattern, Rule: `^[-\w\\._\\(\\)]+$`, Chain: nil}}}}); err != nil { + return result, validation.NewError("labservices.VirtualMachinesClient", "Stop", err.Error()) + } + + req, err := client.StopPreparer(ctx, resourceGroupName, labName, virtualMachineName) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Stop", nil, "Failure preparing request") + return + } + + result, err = client.StopSender(req) + if err != nil { + err = autorest.NewErrorWithError(err, "labservices.VirtualMachinesClient", "Stop", result.Response(), "Failure sending request") + return + } + + return +} + +// StopPreparer prepares the Stop request. +func (client VirtualMachinesClient) StopPreparer(ctx context.Context, resourceGroupName string, labName string, virtualMachineName string) (*http.Request, error) { + pathParameters := map[string]interface{}{ + "labName": autorest.Encode("path", labName), + "resourceGroupName": autorest.Encode("path", resourceGroupName), + "subscriptionId": autorest.Encode("path", client.SubscriptionID), + "virtualMachineName": autorest.Encode("path", virtualMachineName), + } + + const APIVersion = "2021-11-15-preview" + queryParameters := map[string]interface{}{ + "api-version": APIVersion, + } + + preparer := autorest.CreatePreparer( + autorest.AsPost(), + autorest.WithBaseURL(client.BaseURI), + autorest.WithPathParameters("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.LabServices/labs/{labName}/virtualMachines/{virtualMachineName}/stop", pathParameters), + autorest.WithQueryParameters(queryParameters)) + return preparer.Prepare((&http.Request{}).WithContext(ctx)) +} + +// StopSender sends the Stop request. The method will close the +// http.Response Body if it receives an error. +func (client VirtualMachinesClient) StopSender(req *http.Request) (future VirtualMachinesStopFuture, err error) { + var resp *http.Response + future.FutureAPI = &azure.Future{} + resp, err = client.Send(req, azure.DoRetryWithRegistration(client.Client)) + if err != nil { + return + } + var azf azure.Future + azf, err = azure.NewFutureFromResponse(resp) + future.FutureAPI = &azf + future.Result = future.result + return +} + +// StopResponder handles the response to the Stop request. The method always +// closes the http.Response Body. +func (client VirtualMachinesClient) StopResponder(resp *http.Response) (result autorest.Response, err error) { + err = autorest.Respond( + resp, + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusAccepted), + autorest.ByClosing()) + result.Response = resp + return +} From a2759f8a8ca5d7d03d6d3a23538edf66b88e7b4e Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:29:26 +0800 Subject: [PATCH 7/8] Generated from specification/synapse/resource-manager/readme.md tag package-composite-v2 (commit hash: 3587a60ea8f18e76a41e4b56b72aeddce879aae9) --- .../synapse/mgmt/v2.0/synapse/CHANGELOG.md | 54 +++- .../synapse/mgmt/v2.0/synapse/_meta.json | 6 +- .../synapse/mgmt/v2.0/synapse/enums.go | 25 +- .../mgmt/v2.0/synapse/ipfirewallrules.go | 2 +- .../synapse/mgmt/v2.0/synapse/models.go | 288 +++++++++++++++++- 5 files changed, 342 insertions(+), 33 deletions(-) diff --git a/services/preview/synapse/mgmt/v2.0/synapse/CHANGELOG.md b/services/preview/synapse/mgmt/v2.0/synapse/CHANGELOG.md index 8f9752df72d7..92c7b637a920 100644 --- a/services/preview/synapse/mgmt/v2.0/synapse/CHANGELOG.md +++ b/services/preview/synapse/mgmt/v2.0/synapse/CHANGELOG.md @@ -2,26 +2,48 @@ ## Breaking Changes -### Removed Funcs +### Removed Constants -1. KustoPoolClient.ListSkus(context.Context) (SkuDescriptionList, error) -1. KustoPoolClient.ListSkusPreparer(context.Context) (*http.Request, error) -1. KustoPoolClient.ListSkusResponder(*http.Response) (SkuDescriptionList, error) -1. KustoPoolClient.ListSkusSender(*http.Request) (*http.Response, error) -1. NewKustoPoolClient(string) KustoPoolClient -1. NewKustoPoolClientWithBaseURI(string, string) KustoPoolClient +1. StorageAccountType.StorageAccountTypeZRS -### Struct Changes +## Additive Changes -#### Removed Structs +### New Constants -1. KustoPoolClient - -## Additive Changes +1. Kind.KindReadOnlyFollowing +1. PrincipalsModificationKind.PrincipalsModificationKindNone +1. PrincipalsModificationKind.PrincipalsModificationKindReplace +1. PrincipalsModificationKind.PrincipalsModificationKindUnion ### New Funcs -1. KustoPoolsClient.ListSkus(context.Context) (SkuDescriptionList, error) -1. KustoPoolsClient.ListSkusPreparer(context.Context) (*http.Request, error) -1. KustoPoolsClient.ListSkusResponder(*http.Response) (SkuDescriptionList, error) -1. KustoPoolsClient.ListSkusSender(*http.Request) (*http.Response, error) +1. *ReadOnlyFollowingDatabase.UnmarshalJSON([]byte) error +1. Database.AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) +1. PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind +1. ReadOnlyFollowingDatabase.AsBasicDatabase() (BasicDatabase, bool) +1. ReadOnlyFollowingDatabase.AsDatabase() (*Database, bool) +1. ReadOnlyFollowingDatabase.AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) +1. ReadOnlyFollowingDatabase.AsReadWriteDatabase() (*ReadWriteDatabase, bool) +1. ReadOnlyFollowingDatabase.MarshalJSON() ([]byte, error) +1. ReadOnlyFollowingDatabaseProperties.MarshalJSON() ([]byte, error) +1. ReadWriteDatabase.AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) +1. SQLPoolResourceProperties.MarshalJSON() ([]byte, error) + +### Struct Changes + +#### New Structs + +1. ManagedIntegrationRuntimeManagedVirtualNetworkReference +1. ReadOnlyFollowingDatabase +1. ReadOnlyFollowingDatabaseProperties + +#### New Struct Fields + +1. DynamicExecutorAllocation.MaxExecutors +1. DynamicExecutorAllocation.MinExecutors +1. ExtendedServerBlobAuditingPolicyProperties.IsDevopsAuditEnabled +1. ManagedIntegrationRuntime.*ManagedIntegrationRuntimeManagedVirtualNetworkReference +1. SelfHostedIntegrationRuntimeStatusTypeProperties.NewerVersions +1. SelfHostedIntegrationRuntimeStatusTypeProperties.ServiceRegion +1. ServerBlobAuditingPolicyProperties.IsDevopsAuditEnabled +1. WorkspaceProperties.TrustedServiceBypassEnabled diff --git a/services/preview/synapse/mgmt/v2.0/synapse/_meta.json b/services/preview/synapse/mgmt/v2.0/synapse/_meta.json index 7947baab6642..e73458649693 100644 --- a/services/preview/synapse/mgmt/v2.0/synapse/_meta.json +++ b/services/preview/synapse/mgmt/v2.0/synapse/_meta.json @@ -1,11 +1,11 @@ { - "commit": "9903ac0d18bab43964f5c216b7638bd2964eaac5", + "commit": "3587a60ea8f18e76a41e4b56b72aeddce879aae9", "readme": "/_/azure-rest-api-specs/specification/synapse/resource-manager/readme.md", "tag": "package-composite-v2", "use": "@microsoft.azure/autorest.go@2.1.187", "repository_url": "https://github.com/Azure/azure-rest-api-specs.git", - "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-composite-v2 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix /_/azure-rest-api-specs/specification/synapse/resource-manager/readme.md", + "autorest_command": "autorest --use=@microsoft.azure/autorest.go@2.1.187 --tag=package-composite-v2 --go-sdk-folder=/_/azure-sdk-for-go --go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix /_/azure-rest-api-specs/specification/synapse/resource-manager/readme.md", "additional_properties": { - "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --enum-prefix" + "additional_options": "--go --verbose --use-onever --version=V2 --go.license-header=MICROSOFT_MIT_NO_VERSION --pass-thru:schema-validator-swagger --enum-prefix" } } \ No newline at end of file diff --git a/services/preview/synapse/mgmt/v2.0/synapse/enums.go b/services/preview/synapse/mgmt/v2.0/synapse/enums.go index 1f09473e5547..23ac78022c5c 100644 --- a/services/preview/synapse/mgmt/v2.0/synapse/enums.go +++ b/services/preview/synapse/mgmt/v2.0/synapse/enums.go @@ -729,13 +729,15 @@ type Kind string const ( // KindDatabase ... KindDatabase Kind = "Database" + // KindReadOnlyFollowing ... + KindReadOnlyFollowing Kind = "ReadOnlyFollowing" // KindReadWrite ... KindReadWrite Kind = "ReadWrite" ) // PossibleKindValues returns an array of possible values for the Kind const type. func PossibleKindValues() []Kind { - return []Kind{KindDatabase, KindReadWrite} + return []Kind{KindDatabase, KindReadOnlyFollowing, KindReadWrite} } // KindBasicDataConnection enumerates the values for kind basic data connection. @@ -877,6 +879,23 @@ func PossibleOperationStatusValues() []OperationStatus { return []OperationStatus{OperationStatusCanceled, OperationStatusFailed, OperationStatusInProgress, OperationStatusSucceeded} } +// PrincipalsModificationKind enumerates the values for principals modification kind. +type PrincipalsModificationKind string + +const ( + // PrincipalsModificationKindNone ... + PrincipalsModificationKindNone PrincipalsModificationKind = "None" + // PrincipalsModificationKindReplace ... + PrincipalsModificationKindReplace PrincipalsModificationKind = "Replace" + // PrincipalsModificationKindUnion ... + PrincipalsModificationKindUnion PrincipalsModificationKind = "Union" +) + +// PossiblePrincipalsModificationKindValues returns an array of possible values for the PrincipalsModificationKind const type. +func PossiblePrincipalsModificationKindValues() []PrincipalsModificationKind { + return []PrincipalsModificationKind{PrincipalsModificationKindNone, PrincipalsModificationKindReplace, PrincipalsModificationKindUnion} +} + // PrincipalType enumerates the values for principal type. type PrincipalType string @@ -1336,13 +1355,11 @@ const ( StorageAccountTypeGRS StorageAccountType = "GRS" // StorageAccountTypeLRS ... StorageAccountTypeLRS StorageAccountType = "LRS" - // StorageAccountTypeZRS ... - StorageAccountTypeZRS StorageAccountType = "ZRS" ) // PossibleStorageAccountTypeValues returns an array of possible values for the StorageAccountType const type. func PossibleStorageAccountTypeValues() []StorageAccountType { - return []StorageAccountType{StorageAccountTypeGRS, StorageAccountTypeLRS, StorageAccountTypeZRS} + return []StorageAccountType{StorageAccountTypeGRS, StorageAccountTypeLRS} } // TransparentDataEncryptionStatus enumerates the values for transparent data encryption status. diff --git a/services/preview/synapse/mgmt/v2.0/synapse/ipfirewallrules.go b/services/preview/synapse/mgmt/v2.0/synapse/ipfirewallrules.go index 13f524de46aa..c229186d6a9a 100644 --- a/services/preview/synapse/mgmt/v2.0/synapse/ipfirewallrules.go +++ b/services/preview/synapse/mgmt/v2.0/synapse/ipfirewallrules.go @@ -117,7 +117,7 @@ func (client IPFirewallRulesClient) CreateOrUpdateSender(req *http.Request) (fut func (client IPFirewallRulesClient) CreateOrUpdateResponder(resp *http.Response) (result IPFirewallRuleInfo, err error) { err = autorest.Respond( resp, - azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated), + azure.WithErrorUnlessStatusCode(http.StatusOK, http.StatusCreated, http.StatusAccepted), autorest.ByUnmarshallingJSON(&result), autorest.ByClosing()) result.Response = autorest.Response{Response: resp} diff --git a/services/preview/synapse/mgmt/v2.0/synapse/models.go b/services/preview/synapse/mgmt/v2.0/synapse/models.go index 7717b7e42705..f7dff3b90dca 100644 --- a/services/preview/synapse/mgmt/v2.0/synapse/models.go +++ b/services/preview/synapse/mgmt/v2.0/synapse/models.go @@ -934,7 +934,7 @@ type BigDataPoolResourceProperties struct { ProvisioningState *string `json:"provisioningState,omitempty"` // AutoScale - Auto-scaling properties AutoScale *AutoScaleProperties `json:"autoScale,omitempty"` - // CreationDate - The time when the Big Data pool was created. + // CreationDate - READ-ONLY; The time when the Big Data pool was created. CreationDate *date.Time `json:"creationDate,omitempty"` // AutoPause - Auto-pausing properties AutoPause *AutoPauseProperties `json:"autoPause,omitempty"` @@ -977,9 +977,6 @@ func (bdprp BigDataPoolResourceProperties) MarshalJSON() ([]byte, error) { if bdprp.AutoScale != nil { objectMap["autoScale"] = bdprp.AutoScale } - if bdprp.CreationDate != nil { - objectMap["creationDate"] = bdprp.CreationDate - } if bdprp.AutoPause != nil { objectMap["autoPause"] = bdprp.AutoPause } @@ -1624,6 +1621,7 @@ func (csb CustomSetupBase) AsBasicCustomSetupBase() (BasicCustomSetupBase, bool) // BasicDatabase class representing a Kusto database. type BasicDatabase interface { AsReadWriteDatabase() (*ReadWriteDatabase, bool) + AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) AsDatabase() (*Database, bool) } @@ -1634,7 +1632,7 @@ type Database struct { Location *string `json:"location,omitempty"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty"` - // Kind - Possible values include: 'KindDatabase', 'KindReadWrite' + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` @@ -1656,6 +1654,10 @@ func unmarshalBasicDatabase(body []byte) (BasicDatabase, error) { var rwd ReadWriteDatabase err := json.Unmarshal(body, &rwd) return rwd, err + case string(KindReadOnlyFollowing): + var rofd ReadOnlyFollowingDatabase + err := json.Unmarshal(body, &rofd) + return rofd, err default: var d Database err := json.Unmarshal(body, &d) @@ -1699,6 +1701,11 @@ func (d Database) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { return nil, false } +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for Database. +func (d Database) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return nil, false +} + // AsDatabase is the BasicDatabase implementation for Database. func (d Database) AsDatabase() (*Database, bool) { return &d, true @@ -2526,6 +2533,10 @@ func (dwuap DataWarehouseUserActivitiesProperties) MarshalJSON() ([]byte, error) type DynamicExecutorAllocation struct { // Enabled - Indicates whether Dynamic Executor Allocation is enabled or not. Enabled *bool `json:"enabled,omitempty"` + // MinExecutors - The minimum number of executors alloted + MinExecutors *int32 `json:"minExecutors,omitempty"` + // MaxExecutors - The maximum number of executors alloted + MaxExecutors *int32 `json:"maxExecutors,omitempty"` } // EncryptionDetails details of the encryption associated with the workspace @@ -3620,6 +3631,17 @@ type ExtendedServerBlobAuditingPolicyProperties struct { // QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. // The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` + // IsDevopsAuditEnabled - Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor. + // In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true + // + // When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created. + // + // Diagnostic Settings URI format: + // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + // + // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"` } // ExtendedSQLPoolBlobAuditingPolicy an extended Sql pool blob auditing policy. @@ -8790,6 +8812,8 @@ type ManagedIntegrationRuntime struct { State IntegrationRuntimeState `json:"state,omitempty"` // ManagedIntegrationRuntimeTypeProperties - Managed integration runtime properties. *ManagedIntegrationRuntimeTypeProperties `json:"typeProperties,omitempty"` + // ManagedIntegrationRuntimeManagedVirtualNetworkReference - Managed integration runtime managed virtual network. + *ManagedIntegrationRuntimeManagedVirtualNetworkReference `json:"managedVirtualNetwork,omitempty"` // AdditionalProperties - Unmatched properties from the message are deserialized this collection AdditionalProperties map[string]interface{} `json:""` // Description - Integration runtime description. @@ -8805,6 +8829,9 @@ func (mir ManagedIntegrationRuntime) MarshalJSON() ([]byte, error) { if mir.ManagedIntegrationRuntimeTypeProperties != nil { objectMap["typeProperties"] = mir.ManagedIntegrationRuntimeTypeProperties } + if mir.ManagedIntegrationRuntimeManagedVirtualNetworkReference != nil { + objectMap["managedVirtualNetwork"] = mir.ManagedIntegrationRuntimeManagedVirtualNetworkReference + } if mir.Description != nil { objectMap["description"] = mir.Description } @@ -8864,6 +8891,15 @@ func (mir *ManagedIntegrationRuntime) UnmarshalJSON(body []byte) error { } mir.ManagedIntegrationRuntimeTypeProperties = &managedIntegrationRuntimeTypeProperties } + case "managedVirtualNetwork": + if v != nil { + var managedIntegrationRuntimeManagedVirtualNetworkReference ManagedIntegrationRuntimeManagedVirtualNetworkReference + err = json.Unmarshal(*v, &managedIntegrationRuntimeManagedVirtualNetworkReference) + if err != nil { + return err + } + mir.ManagedIntegrationRuntimeManagedVirtualNetworkReference = &managedIntegrationRuntimeManagedVirtualNetworkReference + } default: if v != nil { var additionalProperties interface{} @@ -8918,6 +8954,17 @@ func (mire ManagedIntegrationRuntimeError) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ManagedIntegrationRuntimeManagedVirtualNetworkReference managed integration runtime managed virtual +// network reference. +type ManagedIntegrationRuntimeManagedVirtualNetworkReference struct { + // ReferenceName - The reference name of the managed virtual network. + ReferenceName *string `json:"referenceName,omitempty"` + // Type - The type of the managed virtual network. + Type *string `json:"type,omitempty"` + // ID - The id of the managed virtual network. + ID *string `json:"id,omitempty"` +} + // ManagedIntegrationRuntimeNode properties of integration runtime node. type ManagedIntegrationRuntimeNode struct { // NodeID - READ-ONLY; The managed integration runtime node id. @@ -10735,6 +10782,165 @@ func (qs QueryStatistic) MarshalJSON() ([]byte, error) { return json.Marshal(objectMap) } +// ReadOnlyFollowingDatabase class representing a read only following database. +type ReadOnlyFollowingDatabase struct { + // ReadOnlyFollowingDatabaseProperties - The database properties. + *ReadOnlyFollowingDatabaseProperties `json:"properties,omitempty"` + // Location - Resource location. + Location *string `json:"location,omitempty"` + // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. + SystemData *SystemData `json:"systemData,omitempty"` + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' + Kind Kind `json:"kind,omitempty"` + // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} + ID *string `json:"id,omitempty"` + // Name - READ-ONLY; The name of the resource + Name *string `json:"name,omitempty"` + // Type - READ-ONLY; The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts" + Type *string `json:"type,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) MarshalJSON() ([]byte, error) { + rofd.Kind = KindReadOnlyFollowing + objectMap := make(map[string]interface{}) + if rofd.ReadOnlyFollowingDatabaseProperties != nil { + objectMap["properties"] = rofd.ReadOnlyFollowingDatabaseProperties + } + if rofd.Location != nil { + objectMap["location"] = rofd.Location + } + if rofd.Kind != "" { + objectMap["kind"] = rofd.Kind + } + return json.Marshal(objectMap) +} + +// AsReadWriteDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { + return nil, false +} + +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return &rofd, true +} + +// AsDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsDatabase() (*Database, bool) { + return nil, false +} + +// AsBasicDatabase is the BasicDatabase implementation for ReadOnlyFollowingDatabase. +func (rofd ReadOnlyFollowingDatabase) AsBasicDatabase() (BasicDatabase, bool) { + return &rofd, true +} + +// UnmarshalJSON is the custom unmarshaler for ReadOnlyFollowingDatabase struct. +func (rofd *ReadOnlyFollowingDatabase) UnmarshalJSON(body []byte) error { + var m map[string]*json.RawMessage + err := json.Unmarshal(body, &m) + if err != nil { + return err + } + for k, v := range m { + switch k { + case "properties": + if v != nil { + var readOnlyFollowingDatabaseProperties ReadOnlyFollowingDatabaseProperties + err = json.Unmarshal(*v, &readOnlyFollowingDatabaseProperties) + if err != nil { + return err + } + rofd.ReadOnlyFollowingDatabaseProperties = &readOnlyFollowingDatabaseProperties + } + case "location": + if v != nil { + var location string + err = json.Unmarshal(*v, &location) + if err != nil { + return err + } + rofd.Location = &location + } + case "systemData": + if v != nil { + var systemData SystemData + err = json.Unmarshal(*v, &systemData) + if err != nil { + return err + } + rofd.SystemData = &systemData + } + case "kind": + if v != nil { + var kind Kind + err = json.Unmarshal(*v, &kind) + if err != nil { + return err + } + rofd.Kind = kind + } + case "id": + if v != nil { + var ID string + err = json.Unmarshal(*v, &ID) + if err != nil { + return err + } + rofd.ID = &ID + } + case "name": + if v != nil { + var name string + err = json.Unmarshal(*v, &name) + if err != nil { + return err + } + rofd.Name = &name + } + case "type": + if v != nil { + var typeVar string + err = json.Unmarshal(*v, &typeVar) + if err != nil { + return err + } + rofd.Type = &typeVar + } + } + } + + return nil +} + +// ReadOnlyFollowingDatabaseProperties class representing the Kusto database properties. +type ReadOnlyFollowingDatabaseProperties struct { + // ProvisioningState - READ-ONLY; The provisioned state of the resource. Possible values include: 'ResourceProvisioningStateRunning', 'ResourceProvisioningStateCreating', 'ResourceProvisioningStateDeleting', 'ResourceProvisioningStateSucceeded', 'ResourceProvisioningStateFailed', 'ResourceProvisioningStateMoving', 'ResourceProvisioningStateCanceled' + ProvisioningState ResourceProvisioningState `json:"provisioningState,omitempty"` + // SoftDeletePeriod - READ-ONLY; The time the data should be kept before it stops being accessible to queries in TimeSpan. + SoftDeletePeriod *string `json:"softDeletePeriod,omitempty"` + // HotCachePeriod - The time the data should be kept in cache for fast queries in TimeSpan. + HotCachePeriod *string `json:"hotCachePeriod,omitempty"` + // Statistics - READ-ONLY; The statistics of the database. + Statistics *DatabaseStatistics `json:"statistics,omitempty"` + // LeaderClusterResourceID - READ-ONLY; The name of the leader cluster + LeaderClusterResourceID *string `json:"leaderClusterResourceId,omitempty"` + // AttachedDatabaseConfigurationName - READ-ONLY; The name of the attached database configuration cluster + AttachedDatabaseConfigurationName *string `json:"attachedDatabaseConfigurationName,omitempty"` + // PrincipalsModificationKind - READ-ONLY; The principals modification kind of the database. Possible values include: 'PrincipalsModificationKindUnion', 'PrincipalsModificationKindReplace', 'PrincipalsModificationKindNone' + PrincipalsModificationKind PrincipalsModificationKind `json:"principalsModificationKind,omitempty"` +} + +// MarshalJSON is the custom marshaler for ReadOnlyFollowingDatabaseProperties. +func (rofdp ReadOnlyFollowingDatabaseProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if rofdp.HotCachePeriod != nil { + objectMap["hotCachePeriod"] = rofdp.HotCachePeriod + } + return json.Marshal(objectMap) +} + // ReadWriteDatabase class representing a read write database. type ReadWriteDatabase struct { // ReadWriteDatabaseProperties - The database properties. @@ -10743,7 +10949,7 @@ type ReadWriteDatabase struct { Location *string `json:"location,omitempty"` // SystemData - READ-ONLY; Azure Resource Manager metadata containing createdBy and modifiedBy information. SystemData *SystemData `json:"systemData,omitempty"` - // Kind - Possible values include: 'KindDatabase', 'KindReadWrite' + // Kind - Possible values include: 'KindDatabase', 'KindReadWrite', 'KindReadOnlyFollowing' Kind Kind `json:"kind,omitempty"` // ID - READ-ONLY; Fully qualified resource ID for the resource. Ex - /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceProviderNamespace}/{resourceType}/{resourceName} ID *string `json:"id,omitempty"` @@ -10774,6 +10980,11 @@ func (rwd ReadWriteDatabase) AsReadWriteDatabase() (*ReadWriteDatabase, bool) { return &rwd, true } +// AsReadOnlyFollowingDatabase is the BasicDatabase implementation for ReadWriteDatabase. +func (rwd ReadWriteDatabase) AsReadOnlyFollowingDatabase() (*ReadOnlyFollowingDatabase, bool) { + return nil, false +} + // AsDatabase is the BasicDatabase implementation for ReadWriteDatabase. func (rwd ReadWriteDatabase) AsDatabase() (*Database, bool) { return nil, false @@ -12409,6 +12620,10 @@ type SelfHostedIntegrationRuntimeStatusTypeProperties struct { LatestVersion *string `json:"latestVersion,omitempty"` // AutoUpdateETA - READ-ONLY; The estimated time when the self-hosted integration runtime will be updated. AutoUpdateETA *date.Time `json:"autoUpdateETA,omitempty"` + // ServiceRegion - The service region of the integration runtime + ServiceRegion *string `json:"serviceRegion,omitempty"` + // NewerVersions - The newer versions on download center. + NewerVersions *[]string `json:"newerVersions,omitempty"` } // MarshalJSON is the custom marshaler for SelfHostedIntegrationRuntimeStatusTypeProperties. @@ -12420,6 +12635,12 @@ func (shirstp SelfHostedIntegrationRuntimeStatusTypeProperties) MarshalJSON() ([ if shirstp.Links != nil { objectMap["links"] = shirstp.Links } + if shirstp.ServiceRegion != nil { + objectMap["serviceRegion"] = shirstp.ServiceRegion + } + if shirstp.NewerVersions != nil { + objectMap["newerVersions"] = shirstp.NewerVersions + } return json.Marshal(objectMap) } @@ -13166,6 +13387,17 @@ type ServerBlobAuditingPolicyProperties struct { // QueueDelayMs - Specifies the amount of time in milliseconds that can elapse before audit actions are forced to be processed. // The default minimum value is 1000 (1 second). The maximum is 2,147,483,647. QueueDelayMs *int32 `json:"queueDelayMs,omitempty"` + // IsDevopsAuditEnabled - Specifies the state of devops audit. If state is Enabled, devops logs will be sent to Azure Monitor. + // In order to send the events to Azure Monitor, specify 'State' as 'Enabled', 'IsAzureMonitorTargetEnabled' as true and 'IsDevopsAuditEnabled' as true + // + // When using REST API to configure auditing, Diagnostic Settings with 'DevOpsOperationsAudit' diagnostic logs category on the master database should also be created. + // + // Diagnostic Settings URI format: + // PUT https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Sql/servers/{serverName}/databases/master/providers/microsoft.insights/diagnosticSettings/{settingsName}?api-version=2017-05-01-preview + // + // For more information, see [Diagnostic Settings REST API](https://go.microsoft.com/fwlink/?linkid=2033207) + // or [Diagnostic Settings PowerShell](https://go.microsoft.com/fwlink/?linkid=2033043) + IsDevopsAuditEnabled *bool `json:"isDevopsAuditEnabled,omitempty"` } // ServerSecurityAlertPolicy workspace managed Sql server security alert policy. @@ -15615,7 +15847,7 @@ type SQLPoolResourceProperties struct { RecoverableDatabaseID *string `json:"recoverableDatabaseId,omitempty"` // ProvisioningState - Resource state ProvisioningState *string `json:"provisioningState,omitempty"` - // Status - Resource status + // Status - READ-ONLY; Resource status Status *string `json:"status,omitempty"` // RestorePointInTime - Snapshot time to restore RestorePointInTime *date.Time `json:"restorePointInTime,omitempty"` @@ -15625,14 +15857,47 @@ type SQLPoolResourceProperties struct { // Recovery: Creates a sql pool by a geo-replicated backup. sourceDatabaseId must be specified as the recoverableDatabaseId to restore. // Restore: Creates a sql pool by restoring a backup of a deleted sql pool. SourceDatabaseId should be the sql pool's original resource ID. SourceDatabaseId and sourceDatabaseDeletionDate must be specified. Possible values include: 'CreateModeDefault', 'CreateModePointInTimeRestore', 'CreateModeRecovery', 'CreateModeRestore' CreateMode CreateMode `json:"createMode,omitempty"` - // CreationDate - Date the SQL pool was created + // CreationDate - READ-ONLY; Date the SQL pool was created CreationDate *date.Time `json:"creationDate,omitempty"` - // StorageAccountType - The storage account type used to store backups for this sql pool. Possible values include: 'StorageAccountTypeGRS', 'StorageAccountTypeLRS', 'StorageAccountTypeZRS' + // StorageAccountType - The storage account type used to store backups for this sql pool. Possible values include: 'StorageAccountTypeGRS', 'StorageAccountTypeLRS' StorageAccountType StorageAccountType `json:"storageAccountType,omitempty"` // SourceDatabaseDeletionDate - Specifies the time that the sql pool was deleted SourceDatabaseDeletionDate *date.Time `json:"sourceDatabaseDeletionDate,omitempty"` } +// MarshalJSON is the custom marshaler for SQLPoolResourceProperties. +func (sprp SQLPoolResourceProperties) MarshalJSON() ([]byte, error) { + objectMap := make(map[string]interface{}) + if sprp.MaxSizeBytes != nil { + objectMap["maxSizeBytes"] = sprp.MaxSizeBytes + } + if sprp.Collation != nil { + objectMap["collation"] = sprp.Collation + } + if sprp.SourceDatabaseID != nil { + objectMap["sourceDatabaseId"] = sprp.SourceDatabaseID + } + if sprp.RecoverableDatabaseID != nil { + objectMap["recoverableDatabaseId"] = sprp.RecoverableDatabaseID + } + if sprp.ProvisioningState != nil { + objectMap["provisioningState"] = sprp.ProvisioningState + } + if sprp.RestorePointInTime != nil { + objectMap["restorePointInTime"] = sprp.RestorePointInTime + } + if sprp.CreateMode != "" { + objectMap["createMode"] = sprp.CreateMode + } + if sprp.StorageAccountType != "" { + objectMap["storageAccountType"] = sprp.StorageAccountType + } + if sprp.SourceDatabaseDeletionDate != nil { + objectMap["sourceDatabaseDeletionDate"] = sprp.SourceDatabaseDeletionDate + } + return json.Marshal(objectMap) +} + // SQLPoolRestorePointsCreateFuture an abstraction for monitoring and retrieving the results of a // long-running operation. type SQLPoolRestorePointsCreateFuture struct { @@ -19660,6 +19925,8 @@ type WorkspaceProperties struct { Settings map[string]interface{} `json:"settings"` // AzureADOnlyAuthentication - Enable or Disable AzureADOnlyAuthentication on All Workspace subresource AzureADOnlyAuthentication *bool `json:"azureADOnlyAuthentication,omitempty"` + // TrustedServiceBypassEnabled - Is trustedServiceBypassEnabled for the workspace + TrustedServiceBypassEnabled *bool `json:"trustedServiceBypassEnabled,omitempty"` } // MarshalJSON is the custom marshaler for WorkspaceProperties. @@ -19710,6 +19977,9 @@ func (wp WorkspaceProperties) MarshalJSON() ([]byte, error) { if wp.AzureADOnlyAuthentication != nil { objectMap["azureADOnlyAuthentication"] = wp.AzureADOnlyAuthentication } + if wp.TrustedServiceBypassEnabled != nil { + objectMap["trustedServiceBypassEnabled"] = wp.TrustedServiceBypassEnabled + } return json.Marshal(objectMap) } From e7dfde0622e535930dafa6ce48e3f035f211d00c Mon Sep 17 00:00:00 2001 From: 804873052 <804873052@qq.com> Date: Fri, 14 Jan 2022 11:36:37 +0800 Subject: [PATCH 8/8] v61.2.0 --- CHANGELOG.md | 22 ++++++++++++++++++++++ version/version.go | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ee96e332e5a4..380f1cbfd50a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # CHANGELOG +## `v61.2.0` + +### New Packages + +- `github.com/Azure/azure-sdk-for-go/services/iothub/mgmt/2021-07-02/devices` +- `github.com/Azure/azure-sdk-for-go/services/preview/containerregistry/mgmt/2021-09-01/containerregistry` +- `github.com/Azure/azure-sdk-for-go/services/preview/labservices/mgmt/2021-11-15-preview/labservices` +- `github.com/Azure/azure-sdk-for-go/services/web/mgmt/2021-03-01/web` + +### Updated Packages + +| Package Path | Changelog | +| :--- | :---: | +| `github.com/Azure/azure-sdk-for-go/services/datafactory/mgmt/2018-06-01/datafactory` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/datafactory/mgmt/2018-06-01/datafactory/CHANGELOG.md) | + +### Breaking Changes + +| Package Path | Changelog | +| :--- | :---: | +| `github.com/Azure/azure-sdk-for-go/services/preview/botservice/mgmt/2021-05-01-preview/botservice` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/preview/botservice/mgmt/2021-05-01-preview/botservice/CHANGELOG.md) | +| `github.com/Azure/azure-sdk-for-go/services/preview/synapse/mgmt/v2.0/synapse` | [details](https://github.com/Azure/azure-sdk-for-go/tree/main/services/preview/synapse/mgmt/v2.0/synapse/CHANGELOG.md) | + ## `v61.1.0` ### New Packages diff --git a/version/version.go b/version/version.go index 7330fc5bda4f..ef8efc9588ad 100644 --- a/version/version.go +++ b/version/version.go @@ -4,4 +4,4 @@ package version // Licensed under the MIT License. See License.txt in the project root for license information. // Number contains the semantic version of this SDK. -const Number = "v61.1.0" +const Number = "v61.2.0"